I’m having a strange problem. My device has a cellular connection(I know this as I can see it as “online” on the Console) but seemingly has no cloud connection as it wont publish any events? I was able to call a cloud function on it, however, to reset the device and from then on it has worked perfectly. Is this actually a problem with Particle.publish() not working for some reason? I’m quite baffled and have looked into it but not really found any explanation as to why publish wont work even with a cellular connection. I am using WITH_ACK so this could be part of it. Any clarity would be great thanks.
If you are able to call a function and the device is listed online, then you have a cloud connection.
The most common reason the publish does not go out is that you issue it before the cloud connection is up. This can cause the publish to be discarded in various conditions that are timing-sensitive. You should always check Particle.connected()
before publish to make sure the device is online.
You should also check the result from Particle.publish()
and log that and see what it’s returning. Using the USB serial debug log is a good way to do that.
Hey thanks for the reply. I make sure particle.connected returns true before attempting to publish using an if statement. Unfortunately this issue is happening in field devices so I cant hook up the USB serial to them, and cant recreate the issue with my office device. Ill keep on looking into my code to try find something
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.