How fast can i call nodemcu api via UART
Posted: Sat Jun 20, 2015 2:08 pm
Hi all,
I'm writing a firmware on a MCU and want to use ESP8266 as a Wifi bridge. In my main application, i would call some nodemcu api to create connections and send POST requests to a server. So far so good, however, i have problem calling 2 nodemcu commands continuously.
For example,
printf("create_conn=function() conn=net.createConnection(net.TCP,0)"
"conn:on(\"receive\",function(conn_s,pl) print(\"Sent\") end)"
"conn:on(\"disconnection\",function(conn_s,pl) create_conn() end)"
"conn:connect(7777,\"192.168.0.103\") return conn end;\n");
printf("conn=create_conn();\n");
Calling these 2 functions without a delay between them would sometimes confuse nodemcu and it can't recognize my commands appropriately.
Adding a delay of 500ms between them will help solve the problem. But i want to send POST data continuously to a server and adding a delay between requests does really slow the whole thing down a lot.
My question is how fast can i send 2 continuous commands without having nodemcu unable to recognize them properly?
Regards,
Hoang
I'm writing a firmware on a MCU and want to use ESP8266 as a Wifi bridge. In my main application, i would call some nodemcu api to create connections and send POST requests to a server. So far so good, however, i have problem calling 2 nodemcu commands continuously.
For example,
printf("create_conn=function() conn=net.createConnection(net.TCP,0)"
"conn:on(\"receive\",function(conn_s,pl) print(\"Sent\") end)"
"conn:on(\"disconnection\",function(conn_s,pl) create_conn() end)"
"conn:connect(7777,\"192.168.0.103\") return conn end;\n");
printf("conn=create_conn();\n");
Calling these 2 functions without a delay between them would sometimes confuse nodemcu and it can't recognize my commands appropriately.
Adding a delay of 500ms between them will help solve the problem. But i want to send POST data continuously to a server and adding a delay between requests does really slow the whole thing down a lot.
My question is how fast can i send 2 continuous commands without having nodemcu unable to recognize them properly?
Regards,
Hoang