I have an ESP8266 project which reads my gas consumption. The hardware and the project run satisfactorily. Sporadically, the ESP8266 can no longer write to its file system and therefore cannot save any data. As soon as I upload the complete data and the sketch to the device again, it works for a few months. After that, the mistake occurred again and again. What could that be?

The ESP8266 then has an "Exception" error. Unfortunately, I have not yet been able to find the reason for the error, why it always happens.

Does anyone have a tip on how I can isolate the problem?


  • 1
    what is what you write? configuration or log files? if you upload the data does it contain the files with logged data? isn't the file system simply full?
    – Juraj
    Feb 13, 2020 at 14:56
  • does github.com/me-no-dev/EspExceptionDecoder give you any more info about what's exploding? Does rebooting once a day fix it?
    – dandavis
    Feb 13, 2020 at 19:12
  • The link is broken, I believe. It may also be that the module's flash is wearing out, although I'm not sure how reuploading would fix that, if that is the case.
    – user47164
    Feb 14, 2020 at 21:25
  • The link is now revised. Feb 15, 2020 at 22:04

1 Answer 1


I have faced the same issue with my water leak detector, based on esp8266. It was caused by memory leak in the ESP binaries, so, I've updated it to ver 2.6.3

So, you can try to log (print to serial) free memory amount:

extern "C" 
    #include "user_interface.h"
uint32_t free = system_get_free_heap_size();
  • Thanks for the answer. I now have the problem that it can be compiled with the Core 2.5.2 but not with the Core 2.6.3. I added the code above. Suddenly a variable should not be declared. exit status 1 StaticRequestHandler has not been declared Feb 13, 2020 at 11:17
  • The line 'extern "C" { #include "user_interface.h" }' is in code already in. Feb 13, 2020 at 11:18
  • the memory leak was with WiFiClient in 2.4.1 2 years ago
    – Juraj
    Feb 13, 2020 at 14:43
  • @Juraj, okay, so, any other ideas?
    – gbg
    Feb 13, 2020 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.