bruhautomation / ESP-MQTT-JSON-Multisensor

(OBSOLETE) ESP MQTT JSON Multisensor for Home Assistant. Supported sensors include the TEMT6000 light, AM312 PIR, DHT22 temperature/humidity sensors. RGB led supports flash, fade, and transition. Over-The-Air (OTA) uploading, too!
https://youtu.be/jpjfVc-9IrQ
Apache License 2.0
340 stars 152 forks source link

MQTT not functional after Wifi disconnect #8

Closed VegasIOT closed 7 years ago

VegasIOT commented 7 years ago

About once a day my sensor would just stop being able to send or receive data over MQTT. I could still ping the MCU. The serial monitor showed nothing.

I was able to replicate the issue either by simply rebooting my router or using the Wifi MAC filter to temporarily block the MCU. Afterwards the MCU would reconnect to wifi (as evidenced by the ping) but no longer function for MQTT send/receive.

TheFitzZZ commented 7 years ago

I may experience the same issue. I have six sensors around the house and yesterday I noticed that two weren't sending updates anymore for no reason. Maybe we need some kind of automatic restart or so?

VegasIOT commented 7 years ago

I wrote a fix for this issue and submitted it, its been working reliably for about a week now.

sketch_may04a redacted.zip

bruhautomation commented 7 years ago

Sorry about the issue! Knutella has a solid fix for this which I will merge ASAP. Thanks much for reporting it and for the fix @knutella!

TheFitzZZ commented 7 years ago

Can confirm that this solves this issue perfectly, have been testing it since @knutella posted the fix.

bruhautomation commented 7 years ago

I just merged this code into the repo so the fix should now be live. Thanks for the patch @knutella! Cheers!