I have a wifi module that i have to configure with a long lua command .
If i take that command and write in the Arduino terminal and send it to the chip ( the hardware serial) it works great and the chip react right to command.
Then if i try to send it to him from the software serial , i can see that the chip is getting the message, but he is not reacting to it, that means there is some syntax problem with the printing, and i think i am not doing it right .
So, the line that works in a serial from the arduino IDE is :
sv=net.createServer(net.TCP) sv:listen(80,function(c) c:on("receive", function(c, pl) print(pl) end) c:send("HTTP/1.1 200 OK\r\n") c:send("Content-Type: application/json\n\n") c:send("ok") end)
then i am trying to send it from code with software serial, this is the code :
SoftwareSerial wifiSerial(5,6);
void setup()
{
Serial.begin(9600);
while (!Serial)
{;}
wifiSerial.begin(9600);
while (!wifiSerial)
{;}
wifiSerial.println("sv=net.createServer(net.TCP) sv:listen(80,function(c) c:on(\"receive\", function(c, pl) print(pl) end) c:send(\"HTTP/1.1 200 OK\r\n\") c:send(\"Content-Type: application/json\n\n\") c:send(\"ok\") end) ");
} //
The module gets that row, and react to it, but is not reacting well, because something in the way is wrong.
The pins 5/6 are connected to it directly .
Why that same line is working in the IDE serial and not in code ?