All Projects → krzychb → Espsavecrash

krzychb / Espsavecrash

Licence: lgpl-2.1
Save exception details and stack trace anytime and anywhere the ESP8266 crashes

Projects that are alternatives of or similar to Espsavecrash

Garhage
a Home-Automation-friendly ESP8266-based MQTT Garage Door Controller
Stars: ✭ 163 (+120.27%)
Mutual labels:  arduino-ide, esp8266
Arduino Applemidi Library
Send and receive MIDI messages over Ethernet (rtpMIDI or AppleMIDI)
Stars: ✭ 177 (+139.19%)
Mutual labels:  arduino-ide, esp8266
Irremoteesp8266
Infrared remote library for ESP8266/ESP32: send and receive infrared signals with multiple protocols. Based on: https://github.com/shirriff/Arduino-IRremote/
Stars: ✭ 1,964 (+2554.05%)
Mutual labels:  arduino-ide, esp8266
Dhtesp
Optimized DHT library for ESP32/ESP8266 using Arduino framework
Stars: ✭ 184 (+148.65%)
Mutual labels:  arduino-ide, esp8266
Deviot
Sublime Text plugin for IoT development based in PlatformIO ecosystem (Arduino IDE)
Stars: ✭ 281 (+279.73%)
Mutual labels:  arduino-ide, esp8266
Ideasnprojects
That Project's Source Code
Stars: ✭ 344 (+364.86%)
Mutual labels:  arduino-ide, esp8266
Esp8266 Spotify Remote
Control your Spotify player from a ESP8266 with color touch display
Stars: ✭ 170 (+129.73%)
Mutual labels:  arduino-ide, esp8266
Esp32marauder
A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32
Stars: ✭ 233 (+214.86%)
Mutual labels:  arduino-ide, esp8266
Jarolift MQTT
Controlling Jarolift TDEF 433MHZ radio shutters via ESP8266 and CC1101 Transceiver Module in asynchronous mode
Stars: ✭ 43 (-41.89%)
Mutual labels:  esp8266, arduino-ide
Espui
A simple web user interface library for ESP32 and ESP8266
Stars: ✭ 330 (+345.95%)
Mutual labels:  arduino-ide, esp8266
Bleeper
Library to manage your firmware configurations written in C++
Stars: ✭ 54 (-27.03%)
Mutual labels:  arduino-ide, esp8266
Stickwatch
A DIY smart watch based on M5Stick of ESP32
Stars: ✭ 68 (-8.11%)
Mutual labels:  esp8266
Ws2812fx
WS2812 FX Library for Arduino and ESP8266
Stars: ✭ 1,113 (+1404.05%)
Mutual labels:  esp8266
Deepsleepscheduler
DeepSleepScheduler is a lightweight, cooperative task scheduler library with configurable sleep and task supervision.
Stars: ✭ 59 (-20.27%)
Mutual labels:  esp8266
Esp8266 wifi captive portal 2.0
🔑 WiFi captive portal for ESP8266 (Fake sign in)
Stars: ✭ 59 (-20.27%)
Mutual labels:  esp8266
Sik Guide Code
Example code from the SparkFun Inventor's Kit Guide.
Stars: ✭ 72 (-2.7%)
Mutual labels:  arduino-ide
Blinker Library
An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
Stars: ✭ 1,095 (+1379.73%)
Mutual labels:  esp8266
Esp8266
This repository contains source code for the ESP8266.
Stars: ✭ 58 (-21.62%)
Mutual labels:  esp8266
Esp8266 deauther
Affordable WiFi hacking platform for testing and learning
Stars: ✭ 9,312 (+12483.78%)
Mutual labels:  esp8266
Pysmartnode
Micropython Smarthome framework
Stars: ✭ 58 (-21.62%)
Mutual labels:  esp8266

EspSaveCrash Build Status

Save exception details and stack trace anytime and anywhere the ESP8266 crashes. Implement it in your sketch in two simple steps.

Overview

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:

  1. Include the library
#include "EspSaveCrash.h"
  1. Declare object
EspSaveCrash SaveCrash;
  1. Print out saved crash details
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.

alt text alt text
Quick Start Code Examples

Compatibility

Functionality

  • Registers callback to automatically capture and save crash details
  • Captures several crashes to save them to ESP8266 module's flash
  • Captures exceptions and software WDT restarts (not hardware WDT)
  • The following information is saved:
    • Time of crash using the ESP's milliseconds counter
    • Reason of restart - see rst cause
    • Exception cause - see EXCCAUSE
    • epc1, epc2, epc3, excvaddr and depc
    • Stack trace in format you can analyze with ESP Exception Decoder
  • Automatically arms itself to operate after each restart or power up of module
  • Saves crash details within defined flash space and then stops

Example output of SaveCrash.print():

alt text

Examples

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.

Tested With

Arduino Core

Programming Environment

  • Arduino IDE 1.8.10 portable version running on Windows 7 x64 and Linux Ubuntu 18.04 LTE
  • PlatformIO IDE 1.3.0 CLI 2.11.0 running on Windows 7 x64
  • Visual Micro 1606.17.10 with Visual Studio Community 2015 running on Windows 7 x64

Installation

  • Arduino IDE - use Library Manager in Arduino IDE and search for EspSaveCrash.
  • PlatformIO IDE - use PlatformIO's Library Manager. In particular execute pio lib install 376.
  • Visual Micro - installation procedure is the same as for Arduino IDE above.

Contribute

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.

Author

krzychb

Credits

  • Preparation of this library has been inspired by issue #1152 in esp8266 / Arduino repository.
  • Development was possible thanks to Ivan Grokhotkov, who clarified how to register a crash callback and suggested to save crash information on flash.
  • Actual implementation of library has been done thanks to djoele who provided first working code and suggested to convert it into general functionality.
  • Thanks to contribution by Juan L. Pérez Díez the library accepts offset and size parameters passed into the constructor.
  • With kind contribution by brainelectronics the crash log can be stored to char buffer for more convenient use with a web server.
  • Oxan van Leeuwen brought nice code improvements, intoduced size buffer check to prevent the buffer overflow and fixed some spelling errors.

License

GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].