Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware 3.60 may have broken listening, small workaround #13

Open
spacelama opened this issue Sep 17, 2020 · 0 comments
Open

Firmware 3.60 may have broken listening, small workaround #13

spacelama opened this issue Sep 17, 2020 · 0 comments

Comments

@spacelama
Copy link

spacelama commented Sep 17, 2020

I have a LIFX mini W, which appears to be gen 4, which only just got an updated firmware for me: 3.60

I think this coincides with lazylights now failing get_state() for that bulb (still works for a LIFX A19).

tcpdumping at my router shows the working bulb always responding to port 56700:
23:07:29.514312 IP 192.168.1.2.58762 > 192.168.1.54.56700: UDP, length 36
23:07:29.516658 IP 192.168.1.54.56700 > 255.255.255.255.56700: UDP, length 88

But the new firmware responds to the port we opened the communication from, which isn't listening:
23:08:22.308758 IP 192.168.1.2.58112 > 192.168.1.52.56700: UDP, length 36
23:08:22.316400 IP 192.168.1.52.56700 > 192.168.1.2.58112: UDP, length 88
23:08:22.317095 IP 192.168.1.2 > 192.168.1.52: ICMP 192.168.1.2 udp port 58112 unreachable, length 124

I can make lazylights work for both these cases by forcing outgoing comms to go out via 56700 (tradeoff will be it now becomes exclusive use and I can't run this as part of a daemon without retry upon failure):

--- a/lazylights.py      2018-08-28 22:55:32.687390081 +1000
+++ b/lazylights.py   2020-09-17 23:08:47.493875184 +1000
@@ -140,6 +140,7 @@
     discovery). On exit, the socket is closed.
     """
     sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
+    sock.bind(ADDR_LISTEN)
     if broadcast:
         sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
     with closing(sock):

Communication looks like this:
23:09:31.362724 IP 192.168.1.2.56700 > 192.168.1.52.56700: UDP, length 36
23:09:31.367141 IP 192.168.1.52.56700 > 192.168.1.2.56700: UDP, length 88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant