Particle.connected versus Cellular.ready

I want my electron to publish data only if it is already connected to the cloud and ready to publish. Otherwise I don’t want to publish. In other words

if (Particle is ready to publish) {
} else {
Do something else (don’t publish)

For the if statement I think I can use Particle.connected or Cellular.ready, but what is the difference? What I’m finding is that my electron never enters the else statement for some reason (using Particle.connected)

Why not read the docs?

I have. If the Particle is connected to cellular, does that not mean it is also connected to the cloud?


When your computer is connected to the internet, does this mean that you are also connected to any particular server?
The Particle cloud server(s) are just a set of particular machines but the cellular network would allow to connect to any server.

If it was the same, why would we have a dedicated Particle.connect() command?

See also the documentation on System Modes. By default, yes, your device will connect to the Particle Cloud. But you can use SYSTEM_MODE(SEMI_AUTOMATIC) or SYSTEM_MODE(MANUAL) to change that behavior.

But in addition, you should also look at how SYSTEM_THREAD(ENABLED) factors in.

These options give you a great deal of control over your device’s connection and how it reacts to connection problems.