garybixler Posted January 1, 2023 Posted January 1, 2023 (edited) @xKing Hi I have moved the LiFX node server onto the eisy and found that it no longer will do a discovery. Just shows the following errors when discovery initiated. Any suggestions. Thanks Gary 023-01-01 13:17:46,081 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING command 2023-01-01 13:17:46,081 Thread-2527 udi_interface INFO lifx-poly:_discovery_process: Starting LiFX Discovery thread... 2023-01-01 13:17:46,082 Thread-2527 udi_interface ERROR udi_interface:write: Exception in thread 2023-01-01 13:17:46,082 Thread-2527 udi_interface ERROR udi_interface:write: Thread-2527 2023-01-01 13:17:46,082 Thread-2527 udi_interface ERROR udi_interface:write: : 2023-01-01 13:17:46,082 Thread-2527 udi_interface ERROR udi_interface:write: Traceback (most recent call last): 2023-01-01 13:17:46,082 Thread-2527 udi_interface ERROR udi_interface:write: File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner 2023-01-01 13:17:46,083 Thread-2527 udi_interface ERROR udi_interface:write: self.run() 2023-01-01 13:17:46,083 Thread-2527 udi_interface ERROR udi_interface:write: File "/usr/local/lib/python3.9/threading.py", line 917, in run 2023-01-01 13:17:46,083 Thread-2527 udi_interface ERROR udi_interface:write: self._target(*self._args, **self._kwargs) 2023-01-01 13:17:46,084 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/lifx-poly.py", line 206, in _discovery_process 2023-01-01 13:17:46,084 Thread-2527 udi_interface ERROR udi_interface:write: devices = self.lifxLan.get_lights() 2023-01-01 13:17:46,084 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/lifxlan.py", line 42, in get_lights 2023-01-01 13:17:46,084 Thread-2527 udi_interface ERROR udi_interface:write: self.discover_devices() 2023-01-01 13:17:46,084 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/lifxlan.py", line 50, in discover_devices 2023-01-01 13:17:46,085 Thread-2527 udi_interface ERROR udi_interface:write: responses = self.broadcast_with_resp(GetService, StateService,) 2023-01-01 13:17:46,085 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/lifxlan.py", line 234, in broadcast_with_resp 2023-01-01 13:17:46,085 Thread-2527 udi_interface ERROR udi_interface:write: msg = msg_type(BROADCAST_MAC, self.source_id, seq_num=0, payload=payload, ack_requested=False, response_requested=True) 2023-01-01 13:17:46,085 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/msgtypes.py", line 19, in __init__ 2023-01-01 13:17:46,085 Thread-2527 udi_interface ERROR udi_interface:write: super(GetService, self).__init__(MSG_IDS[GetService], target_addr, source_id, seq_num, ack_requested, response_requested) 2023-01-01 13:17:46,085 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/message.py", line 43, in __init__ 2023-01-01 13:17:46,086 Thread-2527 udi_interface ERROR udi_interface:write: self.packed_message = self.generate_packed_message() 2023-01-01 13:17:46,086 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/message.py", line 47, in generate_packed_message 2023-01-01 13:17:46,086 Thread-2527 udi_interface ERROR udi_interface:write: self.header = self.get_header() 2023-01-01 13:17:46,086 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/message.py", line 55, in get_header 2023-01-01 13:17:46,086 Thread-2527 udi_interface ERROR udi_interface:write: frame_addr = self.get_frame_addr() 2023-01-01 13:17:46,086 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/message.py", line 80, in get_frame_addr 2023-01-01 13:17:46,087 Thread-2527 udi_interface ERROR udi_interface:write: mac_addr = little_endian(bitstring.pack(mac_addr_format, convert_MAC_to_int(self.target_addr))) 2023-01-01 13:17:46,087 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/bitstring.py", line 4689, in pack 2023-01-01 13:17:46,088 Thread-2527 udi_interface ERROR udi_interface:write: s._addright(BitStream._init_with_token(name, length, value)) 2023-01-01 13:17:46,088 Thread-2527 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/bitstring.py", line 1435, in _init_with_token 2023-01-01 13:17:46,089 Thread-2527 udi_interface ERROR udi_interface:write: raise CreationError(f"Token with length {token_length} packed with value of length {b.len} " 2023-01-01 13:17:46,089 Thread-2527 udi_interface ERROR udi_interface:write: bitstring 2023-01-01 13:17:46,089 Thread-2527 udi_interface ERROR udi_interface:write: . 2023-01-01 13:17:46,089 Thread-2527 udi_interface ERROR udi_interface:write: CreationError 2023-01-01 13:17:46,089 Thread-2527 udi_interface ERROR udi_interface:write: : 2023-01-01 13:17:46,089 Thread-2527 udi_interface ERROR udi_interface:write: Token with length 64 packed with value of length 0 (bits:64=0). 2023-01-01 13:17:53,299 MQTT udi_interface.interface DEBUG interface:_message: QUEUING incoming message shortPoll Edited January 5, 2023 by garybixler
garybixler Posted January 9, 2023 Author Posted January 9, 2023 @xKing Hi, after checking my network and access points LiFX is still unable to do a discovery. Still produces the above errors. Using the eisy on Ethernet. eisy 5.5.2, PG3 3.1.18 Thanks
JeffR Posted January 14, 2023 Posted January 14, 2023 I have the same issue on eisy v5.5.3 \ v3.1.18. I assume since the auto discovery fails the DB object is never correctly created. I added a devlist file using the serial number for mac as recommended for firmware 3.7+ and the node is created. Unfortunately the status is always shown as offline and commands always fail. I created static addresses in my router since mac and serial numbers are no longer the same. 2023-01-14 14:17:10,559 Command udi_interface.interface ERROR interface:_handleInput: _parseInput: node address d073d56ade00 does not exist. {'address': 'd073d56ade00', 'cmd': 'DON', 'query': {}}
asbril Posted January 16, 2023 Posted January 16, 2023 Has anyone heard back from @xKing and/or has anyone found a solution for the Lifx Node Server to work with ZMatter on eisy ?
garybixler Posted January 16, 2023 Author Posted January 16, 2023 Sadly no responses or solutions so far. 1
asbril Posted January 19, 2023 Posted January 19, 2023 While waiting for a solution, I am trying to use Home Assistant. I would like to duplicate on HA a program that I have on eisy (not working because of Lifx Node Server not being recognized) : IF From Sunset to 10 pm THEN Lifx 1 = ON at 100% and color Blue Lifx 2 = ON at 100% and color Blue Else Lifx 1 = ON at 100% and color White Lifx 2 = ON at 100% and color White Wait 10 seconds Lifx 1 = OFF Lifx 2 = OFF Anyone knows how to make this automation on HA (while waiting for ISY Lifx Node Server to work) ?
MrBill Posted January 19, 2023 Posted January 19, 2023 @asbril I don't have any of the bulbs, but here are some building blocks for you... First, you need 2 automatons. First automation: Trigger: sun @sunset conditions: none Actions: Whatever "Device" actions you need to turn the bulbs to 100% blue Second automation: Trigger: Time: at 10:00PM Conditions: none Actions: Whatever "Device" actions you need to turn the bulbs on 100% White Wait 10 seconds Whatever "Device" actions you need to turn the bulbs off.
asbril Posted January 19, 2023 Posted January 19, 2023 Thanks @MrBill So in fact simpler than I had expected 1
xKing Posted January 20, 2023 Posted January 20, 2023 so original LiFX integration is based on LifxLAN python project that was abandoned for a few years, one of the libraries it depends on updated and broke it you can work around that by doing something like this: sudo -u polyglot bash pip3 uninstall bitstring pip3 install bitstring==3.1.9 I don't know if LifxLAN author is going to update their library...
garybixler Posted January 20, 2023 Author Posted January 20, 2023 @xKing I tried the suggested SSH commands but no difference. I still get the string of errors when doing a re-discover. Also tried reinstalling the NS. eisy 5.5.4 Thanks
xKing Posted January 20, 2023 Posted January 20, 2023 what do you see in pip3 list output? Problem is not related to hardware platform (eisy, polisy, rpi, etc), it's just a new library compatibility.
garybixler Posted January 20, 2023 Author Posted January 20, 2023 Please show how to display pip3 list. Thanks
garybixler Posted January 20, 2023 Author Posted January 20, 2023 I redid the commands and copied the results. [polyglot@eisy /usr/home/admin]$ pip3 uninstall bitstring Found existing installation: bitstring 3.1.9 Uninstalling bitstring-3.1.9: Would remove: /var/polyglot/.local/lib/python3.9/site-packages/bitstring-3.1.9.dist-info/* /var/polyglot/.local/lib/python3.9/site-packages/bitstring.py Proceed (Y/n)? y Successfully uninstalled bitstring-3.1.9 [polyglot@eisy /usr/home/admin]$ pip3 install bitstring==3.1.9 Defaulting to user installation because normal site-packages is not writeable Collecting bitstring==3.1.9 Using cached bitstring-3.1.9-py3-none-any.whl (38 kB) Installing collected packages: bitstring Successfully installed bitstring-3.1.9 [polyglot@eisy /usr/home/admin]$
xKing Posted January 20, 2023 Posted January 20, 2023 so what exactly do you get in the lifx log? bitstring version is ok (3.1.9). Version 4.0 is what caused trouble
garybixler Posted January 20, 2023 Author Posted January 20, 2023 2023-01-20 09:35:05,585 Command udi_interface.interface DEBUG interface:_parseInput: DEQUEING command 2023-01-20 09:35:05,586 Thread-106 udi_interface INFO lifx-poly:_discovery_process: Starting LiFX Discovery thread... 2023-01-20 09:35:05,587 Thread-106 udi_interface ERROR udi_interface:write: Exception in thread 2023-01-20 09:35:05,587 Thread-106 udi_interface ERROR udi_interface:write: Thread-106 2023-01-20 09:35:05,587 Thread-106 udi_interface ERROR udi_interface:write: : 2023-01-20 09:35:05,587 Thread-106 udi_interface ERROR udi_interface:write: Traceback (most recent call last): 2023-01-20 09:35:05,587 Thread-106 udi_interface ERROR udi_interface:write: File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner 2023-01-20 09:35:05,588 Thread-106 udi_interface ERROR udi_interface:write: self.run() 2023-01-20 09:35:05,588 Thread-106 udi_interface ERROR udi_interface:write: File "/usr/local/lib/python3.9/threading.py", line 917, in run 2023-01-20 09:35:05,588 Thread-106 udi_interface ERROR udi_interface:write: self._target(*self._args, **self._kwargs) 2023-01-20 09:35:05,588 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/lifx-poly.py", line 206, in _discovery_process 2023-01-20 09:35:05,589 Thread-106 udi_interface ERROR udi_interface:write: devices = self.lifxLan.get_lights() 2023-01-20 09:35:05,589 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/lifxlan.py", line 42, in get_lights 2023-01-20 09:35:05,589 Thread-106 udi_interface ERROR udi_interface:write: self.discover_devices() 2023-01-20 09:35:05,589 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/lifxlan.py", line 50, in discover_devices 2023-01-20 09:35:05,589 Thread-106 udi_interface ERROR udi_interface:write: responses = self.broadcast_with_resp(GetService, StateService,) 2023-01-20 09:35:05,589 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/lifxlan.py", line 234, in broadcast_with_resp 2023-01-20 09:35:05,590 Thread-106 udi_interface ERROR udi_interface:write: msg = msg_type(BROADCAST_MAC, self.source_id, seq_num=0, payload=payload, ack_requested=False, response_requested=True) 2023-01-20 09:35:05,590 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/msgtypes.py", line 19, in __init__ 2023-01-20 09:35:05,590 Thread-106 udi_interface ERROR udi_interface:write: super(GetService, self).__init__(MSG_IDS[GetService], target_addr, source_id, seq_num, ack_requested, response_requested) 2023-01-20 09:35:05,590 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/message.py", line 43, in __init__ 2023-01-20 09:35:05,590 Thread-106 udi_interface ERROR udi_interface:write: self.packed_message = self.generate_packed_message() 2023-01-20 09:35:05,591 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/message.py", line 47, in generate_packed_message 2023-01-20 09:35:05,591 Thread-106 udi_interface ERROR udi_interface:write: self.header = self.get_header() 2023-01-20 09:35:05,591 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/message.py", line 55, in get_header 2023-01-20 09:35:05,591 Thread-106 udi_interface ERROR udi_interface:write: frame_addr = self.get_frame_addr() 2023-01-20 09:35:05,591 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/lifxlan/message.py", line 80, in get_frame_addr 2023-01-20 09:35:05,591 Thread-106 udi_interface ERROR udi_interface:write: mac_addr = little_endian(bitstring.pack(mac_addr_format, convert_MAC_to_int(self.target_addr))) 2023-01-20 09:35:05,592 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/bitstring.py", line 4689, in pack 2023-01-20 09:35:05,593 Thread-106 udi_interface ERROR udi_interface:write: s._addright(BitStream._init_with_token(name, length, value)) 2023-01-20 09:35:05,593 Thread-106 udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/bitstring.py", line 1435, in _init_with_token 2023-01-20 09:35:05,594 Thread-106 udi_interface ERROR udi_interface:write: raise CreationError(f"Token with length {token_length} packed with value of length {b.len} " 2023-01-20 09:35:05,594 Thread-106 udi_interface ERROR udi_interface:write: bitstring 2023-01-20 09:35:05,594 Thread-106 udi_interface ERROR udi_interface:write: . 2023-01-20 09:35:05,594 Thread-106 udi_interface ERROR udi_interface:write: CreationError 2023-01-20 09:35:05,594 Thread-106 udi_interface ERROR udi_interface:write: : 2023-01-20 09:35:05,594 Thread-106 udi_interface ERROR udi_interface:write: Token with length 64 packed with value of length 0 (bits:64=0).
xKing Posted January 20, 2023 Posted January 20, 2023 Ah I see, polyglot 3 uses separate package repo for each node server - in this case /var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/bitstring.py is unique for LiFX install. I'll need to look around to see how to make it downgrade I'm still on PG2 myself 1
Solution xKing Posted January 20, 2023 Solution Posted January 20, 2023 try maybe sudo -u polyglot bash pip3 uninstall bitstring pip3 uninstall --prefix /var/polyglot/pg3/ns/0021b9026038_7/.local bitstring pip3 install --prefix /var/polyglot/pg3/ns/0021b9026038_7/.local bitstring==3.1.9 1
garybixler Posted January 20, 2023 Author Posted January 20, 2023 Good News. After doing the SSH commands and restarting the NS it discovered the bulbs. Thanks so much. Gary 1
firstone Posted January 20, 2023 Posted January 20, 2023 2 hours ago, xKing said: Ah I see, polyglot 3 uses separate package repo for each node server - in this case /var/polyglot/pg3/ns/0021b9026038_7/.local/lib/python3.9/site-packages/bitstring.py is unique for LiFX install. I'll need to look around to see how to make it downgrade I'm still on PG2 myself Probably can change requirements to point to specific version? Not >=.
kzboray Posted January 20, 2023 Posted January 20, 2023 (edited) @xKing =============Update============= Update 1/21/2023 The file structure for Polisy is slightly different than the eisy use the following to replace bitstring on a Polisy. sudo -u polyglot bash pip3 uninstall bitstring pip3 uninstall --prefix /var/polyglot/.local bitstring pip3 install --prefix /var/polyglot/.local bitstring==3.1.9 ===============Original Problem============ I've tried the suggested uninstall / install you listed above and am still have some issues. Can you point me in the right direction? This is on a Polisy running 5.5.4. 2023-01-20 14:05:58,036 MainThread udi_interface INFO polylogger:set_basic_config: set_basic_config: enable=True level=30 2023-01-20 14:06:00,769 MainThread udi_interface INFO __init__:<module>: UDI Python Interface for Polyglot version 3 3.0.46 Starting... 2023-01-20 14:06:00,835 MainThread udi_interface ERROR udi_interface:write: Traceback (most recent call last): 2023-01-20 14:06:00,836 MainThread udi_interface ERROR udi_interface:write: File "/var/polyglot/pg3/ns/000db9560fac_3/./lifx-poly.py", line 10, in <module> 2023-01-20 14:06:00,838 MainThread udi_interface ERROR udi_interface:write: import lifxlan 2023-01-20 14:06:00,839 MainThread udi_interface ERROR udi_interface:write: File "/var/polyglot/.local/lib/python3.9/site-packages/lifxlan/__init__.py", line 1, in <module> 2023-01-20 14:06:00,841 MainThread udi_interface ERROR udi_interface:write: from .lifxlan import LifxLAN 2023-01-20 14:06:00,841 MainThread udi_interface ERROR udi_interface:write: File "/var/polyglot/.local/lib/python3.9/site-packages/lifxlan/lifxlan.py", line 10, in <module> 2023-01-20 14:06:00,843 MainThread udi_interface ERROR udi_interface:write: from .device import DEFAULT_ATTEMPTS, DEFAULT_TIMEOUT, Device, UDP_BROADCAST_IP_ADDRS, UDP_BROADCAST_PORT 2023-01-20 14:06:00,844 MainThread udi_interface ERROR udi_interface:write: File "/var/polyglot/.local/lib/python3.9/site-packages/lifxlan/device.py", line 29, in <module> 2023-01-20 14:06:00,845 MainThread udi_interface ERROR udi_interface:write: from .msgtypes import Acknowledgement, GetGroup, GetHostFirmware, GetInfo, GetLabel, GetLocation, GetPower, GetVersion, \ 2023-01-20 14:06:00,846 MainThread udi_interface ERROR udi_interface:write: File "/var/polyglot/.local/lib/python3.9/site-packages/lifxlan/msgtypes.py", line 9, in <module> 2023-01-20 14:06:00,848 MainThread udi_interface ERROR udi_interface:write: import bitstring 2023-01-20 14:06:00,849 MainThread udi_interface ERROR udi_interface:write: ModuleNotFoundError 2023-01-20 14:06:00,849 MainThread udi_interface ERROR udi_interface:write: : 2023-01-20 14:06:00,850 MainThread udi_interface ERROR udi_interface:write: No module named 'bitstring' [polyglot@polisy ~]$ pip3 install --prefix /var/polyglot/pg3/ns/000db9560fac_3/.local bitstring==3.1.9 Collecting bitstring==3.1.9 Using cached bitstring-3.1.9-py3-none-any.whl (38 kB) Installing collected packages: bitstring Attempting uninstall: bitstring Found existing installation: bitstring 4.0.1 Uninstalling bitstring-4.0.1: Successfully uninstalled bitstring-4.0.1 Successfully installed bitstring-3.1.9 [polyglot@polisy ~]$ Edited January 22, 2023 by kzboray
Recommended Posts