Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.77k stars 1.64k forks source link

Handling wifi disconnects for ESP8266 / CC2530 #2683

Closed Z0l closed 4 years ago

Z0l commented 4 years ago

Running 1.8.0 from docker with the coordinator being an ESP8266 with a CC2530 flashed to the 1.2 coordinator firmware. I reboot my wifi routers regularly (to fix memory leaks and other weird issues that come from lack of reboots) but now that the coordinator is on wifi as well, I noticed that once the connection was lost at 3:30AM, the app didn't even try to connect back until I restarted the thing in the evening. See below log snippet with some details:

...log... error 2020-01-05 03:30:44: Adapter disconnected, stopping info 2020-01-05 19:42:20: Logging to console and directory: 'data/log' info 2020-01-05 19:42:20: Starting zigbee2mqtt version 1.8.0 (commit #da4d26a) info 2020-01-05 19:42:20: Starting zigbee-herdsman... error 2020-01-05 19:42:27: Error while starting zigbee-herdsman info 2020-01-05 19:42:40: Logging to console and directory: 'data/log' info 2020-01-05 19:42:41: Starting zigbee2mqtt version 1.8.0 (commit #da4d26a) info 2020-01-05 19:42:41: Starting zigbee-herdsman... info 2020-01-05 19:42:46: zigbee-herdsman started info 2020-01-05 19:42:46: Coordinator firmware version: '{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}}' ...log...

Is it possible to introduce a setting that allows connection retries when virtual serial port is used?

pepp86 commented 4 years ago

Which restart policy do you have for your docker container?

Z0l commented 4 years ago

I didn't even know I have one until you asked :) I was following the instructions here, so turns out I don't have a restart policy: https://www.zigbee2mqtt.io/information/docker.html

Maybe this could be updated to include --restart on-failure (or one of the other flavours)?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.