Keep Electron running with intermittent signal?

Out here in the wilds of Oklahoma, my phone usually only has 2 bars, so the Electron frequently looses the signal. When this happens, it’s flashing GREEN in a panic and the program stops running until it is back to breathing cyan.

In use, this might be a bit of a disaster.

Is there a way I can keep the program running while the particle is searching for network, and for the program to know that the network is disconnected so it can take some action, like sound an alarm and display, “NO NETWORK” or something?

To get around that you can use SYSTEM_THREAD(ENABLED) and then you can check Cellular.ready(), Particle.connected() or subscribe to some of the related system events.

1 Like

Cool. Thanks.

I was getting lost in the online docs.

And that was completely easy.

1 Like