Reliable approach to determine whether devices on or offline [Resolved]

I am trying to ensure I have a reliable mechanism to determine whether devices are online or offline to a Web Console App. There are a couple of approaches I could use:

  1. Particle List Cloud API command
  2. Monitor spark/status event messages
  3. Have devices all send a regular update event and if no event received within >2 cycle time then assume device offline

I note there are threads that say 1. and 2. are not 100% reliable and that has been my personal observation.

Does the community have any advice about which method to use?

I can second that observation. Currently, the console and command line say that my Electron is online, but I can clearly see it unpowered on my desk right now.

4. Polling, whenever you actively want to know (per device via e.g Particle.variable() or for a fleet via an event all devices subscribe to and answer via Particle.publish())


Yes, that’s a good idea. Thanks.

You are a very knowledgable person in the Particle community - do you agree that the methods 1 and 2 are not 100% reliable?


Yes, this is fact - especially for the Electron that’s an inherent “problem” of the used UDP protocol and the call for minimal data consumption.


Thanks for the great suggestion @ScruffR!