Handle offline situation


#1

Hello there

How can I handle a situation where a device looses internet connection?

My code receives values from some sliders in cayenne.

I would like to allow my code to continue executing even if I am offline to cayenne.

Seems like my ESP almost freezes completely when offline.

It still executes but there seems to be some huge timeout between each execution loop.

Is it possible to tell cayenne

  • If you are not connected to the cayenne network after X attempts do not try for the next Y seconds? -

Thank you!

Kind regards

Roman


#2

Sure just do it using CAYENNE_CONNECTED(){} function and making and if statement with Cayenne.run() inside. If you don’t know how to do it, just tell me.


#3

I have a project where I made a couple simple modifications to the cayenne library to identify if it was online or not which works well. You could probably start a timer when it goes offline that basically excludes the cayenne.run() for a specified amount of time. Let me see if I can find the post I used to do that.


#4

Ah here it is. Works great :+1: