Electron without Internet

Can the Electron not function without internet connectivity? I am trying to build something where the Electron publishes data on the console when connected to the internet and when there is no internet, it logs the data in a file on the SD card (using SDFat lib). So far I’ve been removing the antenna and/or sim card to simulate the “No Connectivity” scenario. But every time the Electron goes into this mode of no internet, it stops working, rather halts, until it re-gains the network connection, and then continues as it should when there is internet.

Questions I have:

  1. Can the Electron not work without Internet Connection?

  2. Is losing the internet through antenna/ sim detachment a wrong way to simulate no internet? If so, how do I simulate a scenario of “No Internet”?

  3. Particle.isConnected() outputs a 1 when connected to internet. But the code stops progressing altogether when there is no internet and I do not get a 0 or a null when the Electron is disconnected from network. Is there another way to check network connectivity status for an Electron?

Much appreciate all inputs and feedback. Thank you!

https://docs.particle.io/reference/firmware/electron/#cellular

2 Likes

Also look at
https://docs.particle.io/reference/firmware/electron/#system-modes
and
https://docs.particle.io/reference/firmware/electron/#system-thread

2 Likes

Multithreading fixed it!!!

2 Likes