Jump to content

Polyglot LIFX NodeSever


einstein.42

Recommended Posts

I appreciate the issues with this nodeserver, and I have not forgotten about it. In fact I've put in a couple of hundred hours over the last couple of months developing a couple of things that will solve this. This project was one of the main motivators behind it. Be patient another couple of weeks and I will have something ready for release. 

 

Cheers,

 

E

Link to comment
Share on other sites

Einstein,

 

I have to say I never doubted for a moment that you were not on top of things. That's just who you are! I appreciate the status and look forward to playing with new shiny toys in the near future.

 

Kaz

Link to comment
Share on other sites

Hi Einstein,

 

Not sure if you'll be able to do anything about this, but I just upgraded one bulb to the firmware here:

 

https://community.lifx.com/t/beta-firmware-2-14-available-for-lifx-and-lifx-lights/2971

 

and Polyglot no longer discovers that bulb.  It's listed as beta firmware, but according to the website it's going to be released in the next week or two.  It says the focus is on improving connectivity (which is ironic).  For the time being I'm going to try to flash it back to the previous firmware... 

 

Thanks!

Chris

 

Edit: I guess flashing to downgrade isn't supported. :(

 

Edit2:  There have been a ton of commits recently over at lifxlan...didn't have time to dig through and see if anything addresses this new firmware specifically though.

Link to comment
Share on other sites

Just saw over at lifxlan that she updated the version number to reflect compatibility with the new firmware.  I tried cloning lifxlan to replace the version within lifx-nodeserver, but it didn't run.  It apparently needs your magic to make it work! :)

 

Edit:  

 

Looks like this commit fixes the issue:  https://github.com/mclarkk/lifxlan/commit/1beb22ac517d635b5eb8e9902111ba62d0ba31d0

 

I made those changes and the missing bulb is back again!

Link to comment
Share on other sites

Ok I fixed this in the master branch of the lifx-nodeserver. I apologize I was traveling all week. Go ahead and git pull, this should work now.

 

EDIT: Since so many changes are occurring with the LiFX Lan protocol, I'm going to work with Meghan(the writer of the python lifxlan module) and make sure my code works as much as possible with her 'non-customized' version, so we don't have to include it in the lifx-nodeserver source directly. 

 

That being said, I still have this other project coming out in the next week or so that will change some stuff anyway. Be on the look out. 

Link to comment
Share on other sites

Just FYI. I have submitted a pull request for the bug we hit with lifxlan that caused me to initially fork it. If she accepts the merge then I can fully test the rest of it and go back to using the original module. I will monitor and update as needed.

Link to comment
Share on other sites

Just FYI. I have submitted a pull request for the bug we hit with lifxlan that caused me to initially fork it. If she accepts the merge then I can fully test the rest of it and go back to using the original module. I will monitor and update as needed.

 

Looks like it caused her to realize she had other related issues, which she addressed with many thanks to you.  And as always thanks so much from all of us for your work this as well, it's truly appreciated!!

Link to comment
Share on other sites

You know the funny part of that is that I think I was the one that wrote all the group code initially several years ago for her. Hopefully I just didn't fix my own mistake! haha. Anyway, I'll test it this weekend and hopefully we can just use the normal lifxlan module from here on out. 

 

I'm finishing up documentation on the new stuff so hopefully I can get that out this weekend as well. 

Link to comment
Share on other sites

 

Ok I removed the lifxlan custom module, everything seems to be working fine.

sudo pip install -U lifxlan
# then update the lifx nodeserver
git pull

Thanks for keeping this node server updated!  It works here with six A19 generation 3 bulbs.

Link to comment
Share on other sites

  • 2 weeks later...

Hi einstein -

 

Out of the blue today I started getting the error below on startup of the lifx node, causing it to crash.  Oddly, it's happening every time I restart the node now, so I can't get it to work at all.  Any ideas?

 

Thanks!

Chris

ERROR    [07-26-2017 10:10:13] polyglot.nodeserver_manager: LIFX: Traceback (most recent call last):
ERROR    [07-26-2017 10:10:13] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 58, in <module>
ERROR    [07-26-2017 10:10:13] polyglot.nodeserver_manager: LIFX:     main()
ERROR    [07-26-2017 10:10:13] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 53, in main
ERROR    [07-26-2017 10:10:13] polyglot.nodeserver_manager: LIFX:     nserver.setup()
ERROR    [07-26-2017 10:10:13] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 24, in setup
ERROR    [07-26-2017 10:10:13] polyglot.nodeserver_manager: LIFX:     self.controller.discover()
ERROR    [07-26-2017 10:10:14] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx_types.py", line 65, in discover
ERROR    [07-26-2017 10:10:14] polyglot.nodeserver_manager: LIFX:     if d.supports_multizone():
ERROR    [07-26-2017 10:10:14] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/lifxlan/device.py", line 341, in supports_multizone
ERROR    [07-26-2017 10:10:14] polyglot.nodeserver_manager: LIFX: TypeError: 'NoneType' object has no attribute '__getitem__'
Link to comment
Share on other sites

Can you unplug and replug your Z?

 

 

Sent from my iPhone using Tapatalk

 

Ha - I was just coming back to edit my post and say after unplugging the z-strip everything worked.  After reading your post I plugged it back in and yep, all is well now.  Sorry for the false alarm, thanks for your help!!  Weird thing is it was still controllable via the app/web API, so it never occurred to me it might just be in a weird state of some sort.  But I guess that was it!

Link to comment
Share on other sites

  • 2 weeks later...

Hi einstein!

 

Two questions for when you're hanging around bored and dying to code! :P

 

Is there any way to implement a heartbeat of some sort to indicate when the lifx nodeserver has crashed?  I watch for it in a variety of ways now, but it would be more efficient if there was a heartbeat, much like io_guy has implemented in Nodelink.  Not sure if it's even possible in Polyglot node servers, but figured I'd ask!

 

Also, would it be possible to implement an all of utilizing lifxlan? (lifxlan.set_power_all_lights("off", rapid=True) Perhaps it could go on the Polyglot controller page?  This seems to be the fastest way to shut everything down when leaving the house, etc.  I'm currently hitting it via network resources and the example python script, but it would be awesome to have it integrated into the node server!

 

Obviously we all appreciate all of the work you've put into this up to this point for sure, and neither of these are huge deals.  I figured I'd just throw them out there in case you were tinkering in your spare time. :)

 

Thanks again for all your work on this!!

 

Chris

Link to comment
Share on other sites

  • 2 weeks later...

I just updated to the new 1.22 firmware, which has solved a number of timeout issues I was having with various bulbs.  However, it seems to have broken compatibility with the Z-strip.  I've tried unplugging/replugging it to reset it many times, no help.  Without fail, the only way to keep the nodeserver from crashing is to let it go through discovery with the Z-strip unplugged.  Error below:

ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX: Traceback (most recent call last):
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 58, in <module>
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:     main()
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 53, in main
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:     nserver.setup()
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 24, in setup
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:     self.controller.discover()
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx_types.py", line 67, in discover
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:     self.parent.bulbs.append(LIFXMZ(self.parent, self.parent.get_node('lifxcontrol'), address, name, d, manifest))
ERROR    [08-20-2017 11:12:03] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx_types.py", line 445, in __init__
ERROR    [08-20-2017 11:12:04] polyglot.nodeserver_manager: LIFX:     self.num_zones = len(self.device.get_color_zones())
ERROR    [08-20-2017 11:12:04] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/lifxlan/multizonelight.py", line 16, in get_color_zones
ERROR    [08-20-2017 11:12:04] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/lifxlan/device.py", line 476, in req_with_resp
ERROR    [08-20-2017 11:12:04] polyglot.nodeserver_manager: LIFX: lifxlan.device.WorkflowException: WorkflowException: Did not receive [<class 'lifxlan.msgtypes.MultiZoneStateZone'>, <class 'lifxlan.msgtypes.MultiZoneStateMultiZone'>] from XX:XX:XX:XX:XX:XX (Name: Strip) in response to <class 'lifxlan.msgtypes.MultiZoneGetColorZones'>

Please let me know if there's anything else I can provide to assist in troubleshooting.  Thanks!!!

 

Edit:  Also tried factory resetting the Z just in case, but same result. :( 

Link to comment
Share on other sites

Hey einstein - 

 

Just a quick update for above issue.  Turns out that for whatever reason, the lifxlan version included with your code did not get removed via the pull.  I have no idea why that is, I can see in your commit you removing all that code....but in my poking around the lifxlan repository yesterday it struck me that line 476 was the exception line in device.py in the version of lifxlan before Megan committed your changes.  Sure enough, when I looked more closely at the node server directory, the old lifxlan was there in addition to the correction newer version installed at dist-packages.  I removed the entire lifxlan directory within the nodeserver, started it back up, and it works fine now!  8)

Link to comment
Share on other sites

  • 2 weeks later...

Thank you James for the LIFX node server

 

I have been using it now for about 3 weeks and have noticed that every 2 or 3 days I would loose control of the LIFX bulbs.  On investigation I would find that the LIFX Node server had stopped.  I am attaching a copy of the last entries on the server:

 

DEBUG    [09-01-2017 20:55:27] polyglot.nodeserver_manager: LIFX STDIN: {"ping": {}}
DEBUG    [09-01-2017 20:55:27] polyglot.nodeserver_manager:     LIFX [0] ( 0.00) STDOUT: {"pong": {}}
DEBUG    [09-01-2017 20:55:27] polyglot.nodeserver_manager:     LIFX [0] ( 0.00)   Done: {"pong": {}}
DEBUG    [09-01-2017 20:55:29] polyglot.nodeserver_manager:     LIFX [0] ( 0.00) STDOUT: {"restcall": {"api": "nodes/n001_lifxcontrol", "seq": 104...
DEBUG    [09-01-2017 20:55:29] polyglot.nodeserver_manager:     LIFX [1] ( 0.00)   Done: {"restcall": {"api": "nodes/n001_lifxcontrol", "seq": 104...
DEBUG    [09-01-2017 20:55:29] polyglot.nodeserver_manager:     LIFX [0] ( 0.00) _request_handler: command=restcall seq=1043
DEBUG    [09-01-2017 20:55:29] polyglot.element_manager.isy: ISY: Request: http://10.100.100.145:80/rest/nodes/n001_lifxcontrol
INFO     [09-01-2017 20:55:29] requests.packages.urllib3.connectionpool: Resetting dropped connection: 10.100.100.145
DEBUG    [09-01-2017 20:55:29] polyglot.nodeserver_manager: LIFX: **DEBUG: request_node_probe: na="lifxcontrol" fa="n001_lifxcontrol" api="nodes/n001_lifxcontrol"
DEBUG    [09-01-2017 20:55:29] requests.packages.urllib3.connectionpool: "GET /rest/nodes/n001_lifxcontrol HTTP/1.1" 200 436
INFO     [09-01-2017 20:55:29] polyglot.element_manager.isy: ISY: [1] ( 0.03) 200 OK: http://10.100.100.145:80/rest/nodes/n001_lifxcontrol
DEBUG    [09-01-2017 20:55:29] polyglot.nodeserver_manager:     LIFX [0] ( 0.04) _request_handler: completed.
DEBUG    [09-01-2017 20:55:29] polyglot.nodeserver_manager: LIFX STDIN: {"result": {"text": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><nodeInfo><node flag=\"128\" nodeDefId=\"lifxcontrol\"><address>n001_lifxcontrol</address><name>LIFX Control</name><family instance=\"1\">10</family><type>1.1.0.0</type><enabled>true</enabled><deviceClass>0</deviceClass><wattage>0</wattage><dcPeriod>0</dcPeriod><startDelay>0</startDelay><endDelay>0</endDelay><pnode>n001_lifxcontrol</pnode><ELK_ID>I02</ELK_ID></node><properties></properties></nodeInfo>", "elapsed": 0.032434940338134766, "status_code": 200, "seq": 1043, "retries": 0}}
DEBUG    [09-01-2017 20:55:29] polyglot.nodeserver_manager: LIFX: **DEBUG: probe: st=200 na="lifxcontrol" text: <?xml version="1.0" encoding="UTF-8"?><nodeInfo><node flag="128" nodeDefId="lifxcontrol"><address>n001_lifxcontrol</address><name>LIFX Control</name><family instance="1">10</family><type>1.1.0.0</type><enabled>true</enabled><deviceClass>0</deviceClass><wattage>0</wattage><dcPeriod>0</dcPeriod><startDelay>0</startDelay><endDelay>0</endDelay><pnode>n001_lifxcontrol</pnode><ELK_ID>I02</ELK_ID></node><properties></properties></nodeInfo>
INFO     [09-01-2017 20:55:30] polyglot.nodeserver_manager: LIFX: **INFO: probe: fa=n001_lifxcontrol pfa=n001_lifxcontrol id=lifxcontrol fl=128 en=True nm="LIFX Control"
ERROR    [09-01-2017 20:55:36] polyglot.nodeserver_manager: LIFX: Traceback (most recent call last):
ERROR    [09-01-2017 20:55:36] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 58, in <module>
ERROR    [09-01-2017 20:55:36] polyglot.nodeserver_manager: LIFX:     main()
ERROR    [09-01-2017 20:55:36] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 55, in main
ERROR    [09-01-2017 20:55:37] polyglot.nodeserver_manager: LIFX:     nserver.run()
ERROR    [09-01-2017 20:55:37] polyglot.nodeserver_manager: LIFX:   File "/tmp/polyglot_t0tr_w/polyglot/nodeserver_api.py", line 710, in run
ERROR    [09-01-2017 20:55:37] polyglot.nodeserver_manager: LIFX:     self.poll()
ERROR    [09-01-2017 20:55:37] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 30, in poll
ERROR    [09-01-2017 20:55:37] polyglot.nodeserver_manager: LIFX:     i.update_info()
ERROR    [09-01-2017 20:55:37] polyglot.nodeserver_manager: LIFX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx_types.py", line 255, in update_info
ERROR    [09-01-2017 20:55:37] polyglot.nodeserver_manager: LIFX:     except (IOError, TypeError, WorkflowException, socket_error) as e:
ERROR    [09-01-2017 20:55:37] polyglot.nodeserver_manager: LIFX: NameError: global name 'WorkflowException' is not defined
ERROR    [09-01-2017 20:56:01] polyglot.nodeserver_manager: Node Server LIFX has exited unexpectedly.
 
Any help on how fix this issue would be appreciated.
Link to comment
Share on other sites

I updated my bulbs (3 color 1000s) to firmware v1.22 tonight and they've all stopped showing up in the LiFX node server.

 

I've tried restarting the node server and polyglot, doing a git pull, and even removed and re-added it from my isy to no avail.  Then I noticed in the /config/lifx-nodeserver/LiFx.log that I get "INFO        LiFx 0 bulbs found" every time I restart the server, whereas the older logs always show 3 bulbs found.

 

Any thoughts? Thanks in advance.

Link to comment
Share on other sites

  • 1 month later...

Einstein!

 

It's been a while since I had time to play with your LifX NS and I'm having a bit of an install issue I am hoping you can help point me in the right direction to fix.

 

I started with a fresh install of Polyglot .8 on a Pi3 running the latest raspbian OS. Acess to Polyglot on port 8080 is perfect and the LifX NS is listed as an available choice but when I set it up I see this in the polyglot logs on the Pi.

INFO     [10-20-2017 14:48:11] polyglot.core: Creating Polyglot, version 0.0.8
INFO     [10-20-2017 14:48:11] polyglot.config_manager: Config file changes detected, updating config file.
INFO     [10-20-2017 14:48:11] polyglot.core: Starting Polyglot
INFO     [10-20-2017 14:48:11] polyglot.element_manager: Loading Elements
INFO     [10-20-2017 14:48:11] polyglot.element_manager.http: Started HTTP server on port 8080
INFO     [10-20-2017 14:48:11] polyglot.element_manager.http: Loaded HTTP element
INFO     [10-20-2017 14:48:11] polyglot.element_manager.api: Loaded API element
INFO     [10-20-2017 14:48:11] polyglot.element_manager.isy: ISY: [1] ( 0.21) 200 OK: http://10.0.0.50:8880/rest/config
INFO     [10-20-2017 14:48:11] polyglot.element_manager.isy: ISY: firmware version: 5.0.10E
INFO     [10-20-2017 14:48:11] polyglot.element_manager.isy: Loaded ISY element
INFO     [10-20-2017 14:48:11] polyglot.element_manager.frontend: Loaded Frontend element
INFO     [10-20-2017 14:48:11] polyglot.nodeserver_manager: Loading Node Servers
INFO     [10-20-2017 14:48:11] polyglot.nodeserver_manager: Starting Node Server: lifx-nodeserver:LifX
INFO     [10-20-2017 14:48:11] polyglot.nodeserver_manager: Config file option not found in server.json
INFO     [10-20-2017 14:48:11] polyglot.nodeserver_manager: Using interface type Default
ERROR    [10-20-2017 14:48:12] polyglot.nodeserver_manager: LifX: Traceback (most recent call last):
ERROR    [10-20-2017 14:48:12] polyglot.nodeserver_manager: LifX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx.py", line 7, in <module>
ERROR    [10-20-2017 14:48:12] polyglot.nodeserver_manager: LifX:     from polylifx_types import LIFXControl
ERROR    [10-20-2017 14:48:12] polyglot.nodeserver_manager: LifX:   File "/home/pi/Polyglot/config/node_servers/lifx-nodeserver/polylifx_types.py", line 2, in <module>
ERROR    [10-20-2017 14:48:12] polyglot.nodeserver_manager: LifX:     import lifxlan
ERROR    [10-20-2017 14:48:12] polyglot.nodeserver_manager: LifX: ImportError: No module named lifxlan
INFO     [10-20-2017 14:48:12] polyglot.nodeserver_manager: Started Node Server: lifx-nodeserver:LifX (11814)
ERROR    [10-20-2017 14:48:12] polyglot.nodeserver_manager: Node Server LifX has exited unexpectedly.

I'm not really sure where to go with this. polylifx_types.py makes reference to lifxlan in line 2, but I don't see the lifxlan in the downloaded files anywhere. It's not on the Github release either. What am I missing?

 

Thank you!

Link to comment
Share on other sites

...

I'm not really sure where to go with this. polylifx_types.py makes reference to lifxlan in line 2, but I don't see the lifxlan in the downloaded files anywhere. It's not on the Github release either. What am I missing?

 

Thank you!

 

Try 'sudo pip install -U lifxlan', that will (should) install the required module.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.5k
    • Total Posts
      367.6k
×
×
  • Create New...