HAP-python icon indicating copy to clipboard operation
HAP-python copied to clipboard

occasional exception in zeroconf stops HAP listener

Open kolbe opened this issue 6 years ago • 2 comments

Occasionally, I encounter a problem like this:

python3[433]: WARNING:zeroconf:Exception occurred:
python3[433]: Traceback (most recent call last):
python3[433]:   File "/home/pi/.local/lib/python3.5/site-packages/zeroconf.py", line 2245, in send
python3[433]:     bytes_sent = s.sendto(packet, 0, (addr, port))
python3[433]: OSError: [Errno 22] Invalid argument

My script doesn't exit, it just appears that the HAP server stops listening on HTTP, thus rendering the service basically dead (without exiting, which would allow systemd to restart it).

Am I doing something wrong? Should I be trying to manually handle this exception somehow?

My listener: https://github.com/kolbe/Floathouse/blob/master/hap_driver.py My accessory: https://github.com/kolbe/Floathouse/blob/master/LightBulb.py

I was using HAP-python 2.4.2, but I just upgraded to 2.6.0. It doesn't look like there are any changes that would affect this.

Thanks!

kolbe avatar Nov 13 '19 22:11 kolbe

This should be fixed in the latest zeroconf. Are you still seeing this issue?

bdraco avatar May 26 '20 14:05 bdraco

I think this can be closed now

bdraco avatar Aug 22 '21 20:08 bdraco