Cellular/Cloud disconnection detection

Hi,
The Electron I run shall do some measurement at a random interval and publish measurement values.
So to detect Cellular or Cloud disconnection I check both for the connection status (Particle.connected(); and
Cellular.ready();)
I also check the return from:
Particle.publish("Notice",data, PRIVATE);.
So if there is any indication that the connection is broken the measurements are stored and published when the connection is reestablished.

I test this by disconneting the antenna from the PCB.
The storage functionallty work very well except during the time between antenna disconnection until I get green blinking LED.
During this period no measurement are stored.

This period is between 7 and 30 seconds. Is there a way to detect disconnection faster than this?

I use
SYSTEM_MODE(AUTOMATIC); and
SYSTEM_THREAD(ENABLED);

As well as the
ConnectionEvents.h
ConnectionCheck.h
Libs supplied by Rickkas7.

keepAlive maybe could affect this. That I have set at default
Particle.keepAlive(23 * 60);.

Any advice?

You want Particle.publish("Notice",data, PRIVATE, WITH_ACK); in order for the return value to indicate successful ACK from the Particle cloud. Keep in mind this could increase the duration a Particle.publish blocks waiting on retries and various timeouts.

1 Like

To other reading this topic, have a look here: