Offline- nothing works- Solution (kind of)


#1

It seems that when any arduino/iot device goes offline, all triggers stop working.
This is pretty alarming- you could end up with a locked door, or worse

I’ve read a few post, and I believe it has not been solved yet There is a big problem. Without the Internet triggers and timers on raspberry3 not work. If you turn off the Internet and does not work a timer or trigger a fire or a flood can occur

I’m currently using a wemos d1 and this library. #include <CayenneMQTTESP8266.h>.
If you look for this file CayenneArduinoMQTTClient.h
and find this line:

void connect() {
		CAYENNE_LOG("Connecting to %s:%d", CAYENNE_DOMAIN, CAYENNE_PORT);
		int error = MQTT_FAILURE;
		do {
			if (!NetworkConnect(&_network, CAYENNE_DOMAIN, CAYENNE_PORT)) {
			

If you add a restart like this :

do {
			if (!NetworkConnect(&_network, CAYENNE_DOMAIN, CAYENNE_PORT)) {
				CAYENNE_LOG("No internet! Restarting in 10 seconds");
				delay(10000);
				 ESP.restart();		

After a network connection issue, it will restart 10 seconds, then on boot, the relays will be reset to your setup logical level


#2

when there is an internet connection loss, the code continuously loops in to check whether there is internet connection or not. thus not executing any other code.

this is a nice way, but setting to initial value help in your case? for eg if you set the door open in your setup, and there is an internet issue when you are out of the house, so the door will be kept open for the robbers to enter?


#3

" when you are out of the house, so the door will be kept open for the robbers to enter?"

:smiley:. You have a point, but the electromagnetic door is only for keeping the house warm, when we’re in the garden. I’m not using the system for security purposes. I’m more concerned on not getting locked out because of this bug. Setup can be customised appropriately tho


#4

i will suggest an alternative to your issue: use this code and whenever there is an internet issue use an keypad or any other security input to open the door. How can i end the {cayenne.loop()} if there is no connection?