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

State change methods sometimes don't succeed #23

Closed
sinnottj opened this issue Dec 10, 2015 · 2 comments
Closed

State change methods sometimes don't succeed #23

sinnottj opened this issue Dec 10, 2015 · 2 comments

Comments

@sinnottj
Copy link

Hi,

I've been testing this library and I think it's really good!

However, I've observed a problem with the 'state change' methods (light.on, light.off, light.color) occasionally not succeeding. This only happens when the client has been idle for some time (e.g. running for 1 hour without being used.)

I've observed this issue using the interactive-cli.js script. I start the script and the initial tests work fine. I then leave the script running in the background for a while (e.g. 1 hour). When I come back to the script and try to turn the lights on/off or change their colour, it seems to work but nothing happens to the physical lights. When I try again the lights start responding and all seems to be OK (and sometimes it takes a few goes before the lights start to respond.)

If it's any use, here are some examples of the debugging output from interactive-cli.js.

First - here's when I tried to turn the lights off and it failed:

All lights turned off
D - 2a00001444763bb1d073d5018c4600000000000000000019000000000000000075000000000000000000 > 192.168.0.106
D - 2400003444763bb100000000000000000000000000000019000000000000000002000000 > 255.255.255.255
D - 2900005444763bb1d073d5018c4600004c49465856320019447d4aa01e841e1403000000017cdd0000 < 192.168.0.106
D - 2900005444763bb1d073d5018c4600004c4946585632001944a13ea11e841e1403000000057cdd0000 < 192.168.0.106
D - 2400003444763bb100000000000000000000000000000019000000000000000002000000 > 255.255.255.255
D - 240000340000000000000000000000000000000000000000000000000000000002000000 < 192.168.0.115
D - 2400003444763bb100000000000000000000000000000019000000000000000002000000 > 255.255.255.255
D - 2900005444763bb1d073d5018c4600004c49465856320019c431b0ef20841e1403000000017cdd0000 < 192.168.0.106
D - 2900005444763bb1d073d5018c4600004c49465856320019c455a4f020841e1403000000057cdd0000 < 192.168.0.106
D - 2400003444763bb100000000000000000000000000000019000000000000000002000000 > 255.255.255.255

Second - here's where I turned the lights off and it worked:

All lights turned off
D - 2a00001444763bb1d073d5018c460000000000000000001a000000000000000075000000000000000000 > 192.168.0.106
D - 240000340000000000000000000000000000000000000000000000000000000002000000 < 192.168.0.115
D - 2900005400000000d073d5018c4600004c49465856320000c4354bd122841e1403000000017cdd0000 < 192.168.0.106
D - 2900005400000000d073d5018c4600004c49465856320000c4593fd222841e1403000000057cdd0000 < 192.168.0.106
D - 2400003444763bb10000000000000000000000000000001a000000000000000002000000 > 255.255.255.255
D - 2400003444763bb10000000000000000000000000000001a000000000000000002000000 > 255.255.255.255
D - 2900005444763bb1d073d5018c4600004c4946585632001ac44faa6f24841e1403000000017cdd0000 < 192.168.0.106
D - 2900005444763bb1d073d5018c4600004c4946585632001ac4739e7024841e1403000000057cdd0000 < 192.168.0.106
D - 240000340000000000000000000000000000000000000000000000000000000002000000 < 192.168.0.115
D - 2900005400000000d073d5018c4600004c4946585632000004805a2625841e1403000000017cdd0000 < 192.168.0.106
D - 2900005400000000d073d5018c4600004c4946585632000004a44e2725841e1403000000057cdd0000 < 192.168.0.106
D - 2400003444763bb10000000000000000000000000000001a000000000000000002000000 > 255.255.255.255

Regards,

James.

@MariusRumpf
Copy link
Owner

The protocol is based on UDP, which does not guarantee that the packets arrive correct. The LIFX protocol has a method to request if a packet was successful send, the implementation in this library is pending and documented in #14.
I assume that the LIFX lamps go to some kind of power saving mode after a while. The mobile apps request various infos including an echo request which might wake it up again. I will see if I get info for that in the LIFX Developer Forum. Another suggestion is that these packages are lost on the way to the way to the bulb, while routed through the network.

@MariusRumpf
Copy link
Owner

Asking in the LIFX developer forum did not bring any clues. There is no power saving used by the lamp. I assume that this is udp or the network. Since there is a package confirmation now this should not be an issue any more. Closing this since there is nothing I can to.

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

2 participants