

InvalidInputĭeserializeJson() returns InvalidInput when the input JSON document is incorrect. In this case, you can solve the problem by increasing the timeout or by polling Serial::available() before calling deserializeJson(). Usually, this problem causes an EmptyInput error, but there are a few situations where it could return IncompleteInput. In the second case, the sender writes bytes slower than the receiver expects, so the read times out. You could solve this issue by increasing the serial buffer size the details depend on each platform.Īrduino Leonardo’s default is 64 and can be changed by defining the SERIAL_RX_BUFFER_SIZE macro.įor ESP8266 and ESP32, the default is 256 and can be changed by calling setRxBufferSize(). It also occurs when the receiver logs incoming data at a slower rate that’s why it’s crucial to get the “debug” serial running much faster than the “communication” serial. In the first case, the sender writes bytes faster than the receiver reads them, filling up the receiver’s serial buffer until it overflows and drops incoming bytes.įor example, this problem happens when the receiver is busy doing some other task when the sender is transmitting. receiver reading too slowly and dropping bytes.

When applied to serial communication, this error is usually caused by: #include void setup () Things used in these programsĭeserializeJson() returns IncompleteInput when the input JSON is truncated.
