Save exception details and stack trace anytime and anywhere the ESP8266 crashes. Implement it in your sketch in two simple steps.
Do you face random crashes of ESP8266? Do you have difficulty to capture diagnostic information because module is in remote location? Or maybe module crashes after several hours of operation and it is inconvenient to keep serial monitor open until it fails?
EspSaveCrash is a handy little library that will keep automatically catching and saving crash information to ESP8266 module's flash in case it fails due to exception or software WDT. You will then be able to analyze the crash log and decode the stack trace using ESP Exception Decoder.
You will implement it in your sketch in two simple steps:
#include "EspSaveCrash.h"
EspSaveCrash SaveCrash;
SaveCrash.print();
To clear existing crash history from the flash use SaveCrash.clear()
.
Check section Quick Start for sample implementation of this library and tracking down where the program crash happened. More code samples are available in section Examples, that also covers access to saved information remotely with a web browser.
![]() |
![]() |
---|---|
Quick Start | Code Examples |
epc1
, epc2
, epc3
, excvaddr
and depc
Example output of SaveCrash.print()
:
Library comes with example sketches that let you trigger some exceptions and see how to visualize saved data.
Please check separate section how to use example sketches and what particular functionality they provide.
pio lib install 376
.Feel free to contribute to the project in any way you like!
If you find any issues with code or descriptions please report them using Issues tab above.
krzychb
GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999