Rules stop executing when there is no wifi

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
shashwat767
New user
Posts: 1
Joined: 09 Dec 2017, 12:54

Rules stop executing when there is no wifi

#1 Post by shashwat767 » 09 Dec 2017, 13:04

Hi folks,

I am using a NodeMCU Amica and running ESP Easy on it. I have connected a switch and a relay to its GPIO pins and am using a rule to toggle the relay. I am also using MQTT to control the relay.

It all works flawlessly until the ESP loses wifi connection. After that, using the physically connected button to toggle the relay works randomly for a few ~5-10 secs and then stops again.

Maybe because too busy trying to connect to WiFi and the MQTT server?

I would like it to work when it does not have any wifi connection.

Thanks!
Shashwat

User avatar
enesbcs
Normal user
Posts: 587
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary

Re: Rules stop executing when there is no wifi

#2 Post by enesbcs » 09 Dec 2017, 16:58

shashwat767 wrote: 09 Dec 2017, 13:04 It all works flawlessly until the ESP loses wifi connection. After that, using the physically connected button to toggle the relay works randomly for a few ~5-10 secs and then stops again.

Maybe because too busy trying to connect to WiFi and the MQTT server?

I would like it to work when it does not have any wifi connection.
In Controller.ino there are an MQTTCheck() function, you can try to raise delay(1000) for ex: delay(20000) and recompile, than you can see if it helps.

WifiCheck() occcurs every 30seconds at ESPEasy.ino, you can try to hack it also in the runEach30Seconds() but i think that the MQTT connection will be the slowest point.

TD-er
Core team member
Posts: 9905
Joined: 01 Sep 2017, 22:13
Location: the Netherlands

Re: Rules stop executing when there is no wifi

#3 Post by TD-er » 09 Dec 2017, 21:09

Maybe the MQTTConnect function should suggest a delay to the MQTTCheck based on the availability of WiFi.

Who is online

Users browsing this forum: Anthropic Claude Bot [bot], opensiteexplorer.org/dotbot [bot] and 22 guests