Particle.publish() always blocks loop() code if no WiFi?

Even with SYSTEM_THREAD(ENABLED), I notice that a particle.publish() within my loop() blocks the execution of application code if there is no WiFi connection. Is this normal?

To get around it I’m using:

if(WiFi.ready)
{
particle.publish()
}

It seems to work… comments?
Thanks.

1 Like

That currently is the default behaviour, but should get addressed some time.
To ensure this doesn’t get lost, you could open a GitHub issue.

Actually you should check the cloud connection, not only WiFi

  if (Particle.connected())
    Particle.publish();
2 Likes

Thank you for the reply. I will change my code as well.