Determining Successful Particle Cloud Handshake

Hello,

Quick question. I searched the form and wasn’t able to find a good answer for this.

What is the best way to determine a successful particle cloud keys handshake? My current code will not initiate cloud actions (such as publishing) until I have successfully connected to the cloud using the Particle.connected(). The system thread is enabled for this application.

Lately I have been experiencing intermittent keys errors and stack overflows. While doing some troubleshooting I noticed that my firmware indicated Particle.connected() as true once the RGB LED is flashing cyan, but not breathing cyan. I have a suspicion that initiating a number of cloud commands before a successful handshake could be contributing to my intermittent stack overflows. I have added some non-blocking delays to create some headroom, but I would prefer to confirm that the handshaking is successful before I start publishing.

Thanks for the help