Electrons suddenly stop functioning, need reset


We have a fleet of Electron devices out (around 30 pcs.), and sometimes they simply disconnect and require a manual reset to work again. Usually, they will work fine for days, until they randomly fail. They can fail at any time, also in the middle of the night where they’re not taking any inputs. A press on the reset button always solves it, but since these devices are spread around the city, having to manually press reset is not a viable solution.

I managed to get a video clip of the LEDs of an Electron that has stopped working. The charging LED seems to be blinking at 1 Hz (but they randomly start doing that even when functioning, since the PMIC has been disabled; instead of battery, they are powered on VIN from a stable CUI 12V power supply). What’s interesting, however, is that neither the status LED or the D7 LED is on. The firmware running on the Electron will keep D7 on at all times, so it seems that nothing is running on the Electron in this state:


As mentioned before, pressing the reset button will make it reconnect and work again. In the firmware, I’ve integrated a watchdog timer as well as various network diagnostics tools, that should do a modem reset in case it disconnects (using https://github.com/rickkas7/electronsample).

Some of the Electrons have yet to fail in this setup and seem to be running indefinitely; but it might still be a random event that will happen eventually, I just can’t figure out the cause.

Does any of you have an idea of what could be causing this issue?

Thank you!

There are many possible causes, mostly related to user code - but without seeing the code, we could only guess.

One common thing that leads to behaviour like this is the frequent use of String objects (or other objects that dynamically allocate memory).

BTW, the voltage of your power supply is not the only factor that plays a role in regards to the ability to connect to the cellular network - amperage and response time for sudden power surges play a role too.
For testing purposes having a charged LiPo connected may help to remove that from the list of possible causes.

1 Like

Thank you, @ScruffR !

I think the first step is to identify whether it’s a code related issue, or something related to power (e.g. delivery of amperage during peak power situations as you mention). However, the 18W power supply should be sufficient in theory.

I will try to attach a LiPo battery to a few, but it might take a while to conclude anything since they typically work fine for several days.

You mention code as a possible cause as well; I don’t use String objects that frequently, although there’s quite a few integer arrays. I’ll try to post the code later, but it’s over 1300 lines…

Do you or anyone else know if the Electron can behave like this (main status LED in off state) based on user code alone, or is that more related to hardware / power issues? There’s no deep sleep or anything else in the code that should turn off the LED.

One other thing that may cause a frozen RGB LED is some kind of deadlock between threads.