I’m trying to UART send some data to my Arduino. I can post data to the imp and read it fine. But when I try the other way around I get nothing on the Arduino end. I have triple checked the connections and seems fine.
The scenario I’m testing is the HTTP in form post. I used the documentation example and I’m receiving the value from the form fine.
I then trying to use that value to send to the Arduino.
class impeeIn extends InputPort
{
name = “UART Out”;
type = “string”;
function set(v)
{
hardware.uart57.write("Hello, World!\\r\
");
server.log("v.x: “+v.x+” v.y: "+v.y);
}
}
Just to debug I’m sending Hello World across but no love. Is there anything obvious I’m missing in this piece?
If you read the example code in there, it says it can only listen on one at a time:
“In order to listen on a software port, you call port.listen().
When using two software serial ports, you have to switch ports
by listen()ing on each one in turn. Pick a logical time to switch
ports, like the end of an expected transmission, or when the
buffer is empty. This example switches ports when there is nothing
more to read from a port”
…which is why real serial ports rock, and why we have 3 of them on the imp and 4.5 of them (one is RX only) on the module!