elad-bar / DahuaVTO2MQTT

Listens to events from Dahua VTO unit and publishes them via MQTT Message
103 stars 39 forks source link

Hack to reconnect until someone who actually knows python can fix it #20

Closed Spartan-II-117 closed 3 years ago

Spartan-II-117 commented 3 years ago

I have been having frequent wifi dropouts on my VTO, and many of them restart on a schedule. so i hacked on this until i could get it to reconnect. if someone knows how to do this properly, please feel free to reject this and do it right.

Spartan-II-117 commented 3 years ago

talking to a python dev co-worker, I might have figured out a way to make this a bit cleaner, I will try tonight

Spartan-II-117 commented 3 years ago

the changes i could think of had no effect. I welcome improvements from anyone else, this code does work, but with each restart starts showing "WARNING asyncio socket.send() raised exception." it does reconnect successfully and continues to pass reports to MQTT

elad-bar commented 3 years ago

@Spartan-II-117 i've done it bit differently but similiar to your solution, thanks