You use PlatformIO, and your program works correctly when compiled in “release” mode.
However, when you compile with the “debug” mode, the ESP8266 behaves weirdly or crashes with
This is a known issue due to a stack overflow in the recursive part of
Indeed, when compiled with the flag
-Og (the default when you build in “debug” mode), the stack usage in
deserializeJson() is multiplied by five.
To fix this issue, upgrade to ArduinoJson 6.16 or above.
As an alternative, you can also change the
Instead of the default
-Og -g2 -ggdb2, use
-O0 -g2 -ggdb2.
; platformio.ini build_type = debug debug_build_flags = -O0 -g2 -ggdb2