Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are a few things you can do to prevent prints on ESP8266 from becoming unsynchronized when using the Arduino framework:

  1. Use Serial.println() instead of Serial.print() - This will add a newline character at the end of the text, which helps with synchronization.

  2. Use delays between prints - Adding a small delay (e.g. 10ms) between prints can help ensure that the data is fully sent before the next print statement.

  3. Use a buffer - If you have multiple print statements, it can be helpful to put them in a buffer and then print the entire buffer at once. This helps ensure that all the data is sent at once.

  4. Increase the baud rate - If you are using a slower baud rate (e.g. 9600), increasing it can help with synchronization. However, make sure your serial monitor can support the higher rate.

  5. Use a different serial port - If your ESP8266 has multiple serial ports, try using a different one. This can help prevent synchronization issues.