Electron OTA Hard Fault Requiring Power Reboot

There may in fact be a bug in system firmware, but I’m not sure.

I set up a minimal test case for this. I have a server that echos data and an Electron app that connects to it and sends 1 byte per second, and receives whatever is sent.

I tested with both 0.6.4 and 0.7.0 and I had a hard time getting it to receive an OTA update. Most of the time it would timeout. It also was unable to receive a ping from the console.

I tested a version that waited 15 seconds before connecting by TCP to the server and was able to OTA flash in that interval, but once after blinking magenta, it seemed to lock up, with the LED off. Resetting solved the problem.

Then I modified the code to not use SYSTEM_THREAD(ENABLED). It worked flawlessly in non-threaded mode. I was able to receive OTA updates and the reboot afterwards worked perfectly even while connected by TCP.

Here’s the code I used. It includes both the Electron and server (node.js) code.

Though the interesting thing is that with packet level debugging turned on

SerialDebugOutput debugOutput(9600, ALL_LEVEL);

I’m not actually seeing packets from the cloud trying to start the OTA flash. That kind of surprised me. That may or may not be significant.

The next step would probably to compare the ALL_LEVEL logs from threaded and non-threaded mode to look for differences but I ran out of time today. I figured you’d want the intermediate results.

3 Likes