mclarkk / lifxlan

Python library for accessing LIFX devices locally using the official LIFX LAN protocol.
MIT License
508 stars 116 forks source link

I got this error after several successful executions #123

Open masterchop opened 5 years ago

masterchop commented 5 years ago

This is the error:

Traceback (most recent call last): File "RoomLight_project.py", line 227, in sys.exit(main() or 0) File "RoomLight_project.py", line 189, in main lapi.L_setLight("off", 5) File "/home/pi/Scripts/Chop_Utils/LIFX_api.py", line 51, in L_setLight bulb.set_power(state, duration) File "/usr/local/lib/python3.5/dist-packages/lifxlan/light.py", line 56, in set_power self.req_with_ack(LightSetPower, {"power_level": 0, "duration": duration}) File "/usr/local/lib/python3.5/dist-packages/lifxlan/device.py", line 477, in req_with_ack self.req_with_resp(msg_type, Acknowledgement, payload, timeout_secs, max_attempts) File "/usr/local/lib/python3.5/dist-packages/lifxlan/device.py", line 526, in req_with_resp raise WorkflowException("WorkflowException: Did not receive {} from {} (Name: {}) in response to {}".format(str(response_type), str(self.mac_addr), str(self.label), str(msg_type))) lifxlan.errors.WorkflowException: WorkflowException: Did not receive [<class 'lifxlan.msgtypes.Acknowledgement'>] from d0:73:d5:20:6d:c5 (Name: BedRoom Light) in response to <class 'lifxlan.msgtypes.LightSetPower'>

Any help is appreciated.

samclane commented 5 years ago

For a quick-fix, putting rapid=True on your bulb.set_power call will bypass the req_with_ack, instead using a "fire-and-forget" policy.

How quickly are you calling lapi.L_setLight? Too much traffic can muck up your network's bandwidth and cause some ack packets to get lost/ignored.