Check Photon online status

Does anyone know of a way to code for one photon to see if another is online?

For example, one of my Photons logs temperature data (I’m using ThingSpeak to handle the data.). That Photon is outdoors on a solar panel/battery setup.

My other Photon pulls that temperature data from ThingSpeak and puts it on a display.

Sometimes the battery dies on the outdoor board and the board goes offline. When that happens, my display just keeps showing the last posted data to ThingSpeak.

I’d like my display to post a message warning me when data hasn’t been updated in a while. That might be complicated code though and I’d be happy just to have a message that says the outdoor board isn’t communicating. Any ideas?

Christian

There are multiple ways, but one of the easiest and most flexible ones would be a pub/sub combo where one device publishes a “AnybodyThere?” event to which the other replies with another “YesMe_deviceID” event. If this doesn’t come back in time, youre fist one knows the other one isn’t there.

Another one would be to push the temp reading along with a timestamp based on that timestamp your receiver could guess the other one isn’t there anymore - and to confirm that guess you can do above.

1 Like