ESP8266 delays the received data output to serial
Posted: Sat Jun 23, 2018 12:32 am
Hello esp8266 comunity,
My first post, don't get angry if I do something wrong please
So, I am connecting my ESP8266 to a TCP server running on my PC, the purpose is the board to receive certain strings and float values and to relay them to the serial port without changing them.
It does what's supposed to, however with a long delay - in the range of 9 to 10 seconds.
I am monitoring the traffic via Wireshark, and all looks fine there, the module responds to the server messages almost immediately sending ACK message, but on the serial port, there's a big pause before all messages are sent at once. No lost messages, but my application will be somehow time critical and this issue spoils all the fun.
here the snippet of the code running in loop:
I also tried inserting
Please advice what is that I'm not doing right.
Apart from that it's a great little board and I see lots of projects coming to this one.
Cheers!
My first post, don't get angry if I do something wrong please
So, I am connecting my ESP8266 to a TCP server running on my PC, the purpose is the board to receive certain strings and float values and to relay them to the serial port without changing them.
It does what's supposed to, however with a long delay - in the range of 9 to 10 seconds.
I am monitoring the traffic via Wireshark, and all looks fine there, the module responds to the server messages almost immediately sending ACK message, but on the serial port, there's a big pause before all messages are sent at once. No lost messages, but my application will be somehow time critical and this issue spoils all the fun.
here the snippet of the code running in loop:
Code: Select all
void loop() {
String line = client.readStringUntil('\r');
Serial.println(line);
}
I also tried inserting
Code: Select all
after the read line, but no change.client.flush()
Please advice what is that I'm not doing right.
Apart from that it's a great little board and I see lots of projects coming to this one.
Cheers!