Hi @robikovacs ,
The frequency at which online/offline status indicator is dependent on a number of factors. Which Particle SKU or SKUs are you interested in attempting to build on?
For graceful shutdowns, such as sleep or OTAs, Particle devices may send an event to indicate they will be going offline. However, I imagine you are more interested in the cases where devices may not gracefully shut down or lose connectivity. More on this below:
Particle’s wifi SKUs are generally more responsive to online/offline events. I don’t have the exact number off the top of my head, but I believe it’s around 30s-60s before our wi-fi devices flag as offline.
For cellular devices, it’s a bit longer of a timeout. Because our cellular devices are exclusively UDP and we leverage high NAT timeouts to decrease bandwidth, there’s increased idle time before verifying online state. Particle devices check in every 23 minutes with a keepAlive ping to prevent the cellular carrier timeout from occurring and putting the device into a half-duplex situation. We also allow devices to miss one online ping and will flag it offline after the second missed check-in – meaning Particle’s online status indicator for cellular devicse may not indicate the device is actually offline for up to 46 minutes.
If you find need to validate this more frequently, there are some workaround you can use, such as requesting a variable from the device to validate its online state. Do be warned that requesting functions or variables in such a manner will increase data operations consumption.