homieiot / convention

🏡 The Homie Convention: a lightweight MQTT convention for the IoT
https://homieiot.github.io/
Other
715 stars 60 forks source link

WiFi loss #189

Closed nelfata closed 4 years ago

nelfata commented 4 years ago

What is the expected behavior if the WiFi connection was lost or the MQTT server no longer responds? In my initial test, it seems like upon WiFi connection loss the device no longer performs any task (I had a simple automation setup to turn on an LED upon a button press). So the button press was no longer responsive. I think that should never occur, the WiFi loss should not interfere with the programmed automation/task. In addition it should be able to recover and should not require a power cycle.

lorenwest commented 4 years ago

In my experience I had to listen for the state change events, and perform custom state transitions based on my application. Some things stayed working, some things changed behavior based on entering/leaving the different states.

I also wrote reconnect logic to perform a software board reset if wifi doesn't connect within a minute. Many times it reconnects within that minute, but I found that if I don't ever do a software board reset, sometimes it never re-connects.

davidgraeff commented 4 years ago

Wrong repo. The specification handles connection lost via the "state" topic and an mqtt last will. Automation tasks are not homie convention specific.

nelfata commented 4 years ago

Sorry, if I ended up here, but the main website brought me to this. Which link should I use to post my issue?

davidgraeff commented 4 years ago

https://github.com/homieiot/homie-esp8266

nelfata commented 4 years ago

Thanks.