Sketch doesn't run when search for Internet on Electron?

Hello,

Although I live and work in San Francisco, I sometimes only get “1 bar” of cellular connectivity. So, I’m not surprised that an Electron sometimes goes to flashing green for whatever reason. However, a serious issue seems to be that my Loop() isn’t working when that happens. That can be a problem for a consumer device obviously! The use can be pushing a button, for example, and the device would be ignoring him. Note the user won’t see the Electron and so won’t see the indicator light. He just knows that it isn’t working. So to solve I could:

  1. somehow know that the Electron is no longer connected and show an indicator to the user that the device is currently unavailable. Obviously not preferred. It can be doing it’s green flashing thing for a couple of minutes.
  2. have the loop still service IO, taking no more than 200 ms to service other things (otherwise the user’s keypress is missed)

Ideas?

Best,
Tahl

Though there are plenty of topics to be found on this when using search, you might want to check out System modes: https://docs.particle.io/reference/firmware/electron/#system-modes and System threads: https://docs.particle.io/reference/firmware/electron/#system-thread

@Moors7, thanks a lot. Missed that. It looks like if I use SYSTEM_THREAD(ENABLED) when the Electron will still service my DIO even it is also trying to reconnect to the cloud.

Best,
Tahl