Electron sample code for fault tolerance and problem debugging

New version of electronsample!

  • The new version includes a library and all of the useful features are split out into classes so you can just include the ones you want instead of copy and pasting them into your code. All of the features are optional now.
  • Battery monitoring can sleep the Electron for a period of time with the battery is low to prevent flash corruption.
  • Modem reset does both AT+CFUN=16 and SLEEP_MODE_DEEP to maximize the chance of success.
  • New session monitoring can publish an event subscribed to on the device at a configurable frequency and reset session if the events are lost multiple times.
  • New node.js script can monitor and decode the connection events.
  • ApplicationWatchdog uses increases stack size to prevent problems on 0.7.0 and later.
  • Tester functions for periodic publish, entering safe mode, more sleep modes, and reset session.

As before, the code can be configured to record various events (cellular connect and disconnect, cloud connect and disconnect, and many more). These are stored in retained memory and uploaded when there’s a working cloud connection. But new in this version is a live decoding and printing tool:

eseries1,2018-05-10T22:39:39.000Z,62,SETUP_STARTED
eseries1,2018-05-10T22:39:41.000Z,2576,CELLULAR_READY connected
eseries1,2018-05-10T22:39:45.000Z,6388,CLOUD_CONNECTED connected
electron1,2018-05-10T22:45:42.000Z,164,SETUP_STARTED
electron1,2018-05-10T22:45:45.000Z,2912,CELLULAR_READY connected
electron1,2018-05-10T22:45:57.000Z,15169,CLOUD_CONNECTED connected
electron2,2018-05-11T00:08:36.000Z,54,SETUP_STARTED
electron2,2018-05-11T00:08:36.000Z,54,RESET_REASON RESET_REASON_PIN_RESET
electron2,2018-05-11T00:08:48.000Z,11866,CELLULAR_READY connected
electron2,2018-05-11T00:08:50.000Z,13935,CLOUD_CONNECTED connected
electron1,2018-05-11T04:33:27.000Z,20865018,SESSION_EVENT_LOST
electron1,2018-05-11T04:34:13.000Z,20913003,CLOUD_CONNECTED disconnected
electron1,2018-05-11T04:34:23.000Z,20922675,CLOUD_CONNECTED connected

In the same location as before:

6 Likes