BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Keep working even offline

I’m creating a system using a ESP8266 and a SIM800. And the function is just to control the lights, either by the physical buttons connected directly to the ESP or by the Blynk app, however, if the connection drops, the ESP8266 restarts, and it keeps trying to connect to the Blynk servers, and, as there is no connection, ends up getting into a loop of trying to connect to Blynk servers > Failed to connect > restart > trying to connect to Blynk servers and so on until you can connect again. That way, I’m also unable to control the lights through the physical buttons, because the system never starts.

Is there any way to prevent this automatic restart? For example, if there is no connection, my system continues to work offline and, after a few moments, try to connect again (So I could call the Blynk.begin function from time to time until the connection is re-established, without my system restarting).

Yes.

Blynk.begin is a blocking function, and if there’s no connection to either the internet or the Blynk server then all code processing will halt at that point.

It’s impossible to suggest a solution without more info, including your code.

Pete.

I would be interested in this also if there is a way to run “offline”, what part of code would you need to see for a suggested solution?

It depends exactly what you are trying to achieve.

But, rather than hijacking this topic with details of your own objectives, it would be better if you started a new topic and explained in detail what it is that you are trying to achieve, what hardware you are using, what functionality you’d like when offline and why, and any other relevant information including existing code etc.

Pete.