lifx-python icon indicating copy to clipboard operation
lifx-python copied to clipboard

Multiple Bulbs

Open franc-carter opened this issue 11 years ago • 12 comments

Hi,

It looks like get_lights() does not always return all the lights and the lights that get returned tend to change over time.

Any ideas ?

thanks

franc-carter avatar Mar 09 '14 06:03 franc-carter

It seems sometimes the bulbs, when on for a long period of time, go into a kind of "sleep mode" and won't respond to subsequent requests. Not sure if thats the cause here. I find the controller bulb always seems to respond, its just the meshed bulbs which sometimes don't...

lachlanmcdonald avatar Mar 16 '14 06:03 lachlanmcdonald

Interesting,

I'll see if I can work out if this is what is happening to mine

thanks

franc-carter avatar Mar 16 '14 07:03 franc-carter

I'm at a bit of a loss, since I only have two bulbs and they are located right next to each other. However, I've added some extra "GetLightState" packets in the discovery process to hopefully account for packet loss.

I'd love to know if your experience improves.

Sharp

sharph avatar Mar 20 '14 03:03 sharph

Thanks !!,

I'll grab an update on the weekend and let you know how it goes

cheers

On Thu, Mar 20, 2014 at 2:18 PM, sharp [email protected] wrote:

I'm at a bit of a loss, since I only have two bulbs and they are located right next to each other. However, I've added some extra "GetLightState" packets in the discovery process to hopefully account for packet loss.

I'd love to know if your experience improves.

Sharp

Reply to this email directly or view it on GitHubhttps://github.com/sharph/lifx-python/issues/2#issuecomment-38131772 .

Franc

franc-carter avatar Mar 20 '14 04:03 franc-carter

Hi,

I'm afraid I didn't see any major change (randomness is tricky . . .).

cheers

On Thu, Mar 20, 2014 at 3:05 PM, Franc Carter [email protected]:

Thanks !!,

I'll grab an update on the weekend and let you know how it goes

cheers

On Thu, Mar 20, 2014 at 2:18 PM, sharp [email protected] wrote:

I'm at a bit of a loss, since I only have two bulbs and they are located right next to each other. However, I've added some extra "GetLightState" packets in the discovery process to hopefully account for packet loss.

I'd love to know if your experience improves.

Sharp

Reply to this email directly or view it on GitHubhttps://github.com/sharph/lifx-python/issues/2#issuecomment-38131772 .

Franc

Franc

franc-carter avatar Mar 24 '14 09:03 franc-carter

Yes, I'm certainly seeing similar issues, and I have 10 (a bit on the extreme side it seems).

jheld avatar Mar 29 '14 02:03 jheld

I have 4, but bough them in too batches - I think the issues only started with the fourth

cheers

On Sat, Mar 29, 2014 at 1:24 PM, Jason Held [email protected]:

Yes, I'm certainly seeing similar issues, and I have 10 (a bit on the extreme side it seems).

Reply to this email directly or view it on GitHubhttps://github.com/sharph/lifx-python/issues/2#issuecomment-38984326 .

Franc

franc-carter avatar Mar 29 '14 11:03 franc-carter

Could someone who is experiencing this issue use the listen.py script and report back? (run python3 -m lifx.listen)

I'm thinking there's a chance there might be 2 or more "gateway" bubs. If you play around with the bulbs while the listen script is running, you should see a dump of all bulb related network traffic.

If there are multiple values for "site" that means there are multiple gateways. If this is the case, we'll have to rethink some code in network.py.

When posting, feel free to search and replace the bulb's addresses. They could be used to predict your bulb's IP address in some IPv6 enabled future.

Sharp

sharph avatar Mar 29 '14 18:03 sharph

I got a stackdump after leaving this running for a while

[root@homectl ~]# python3 -m lifx.listen Traceback (most recent call last): File "/usr/lib64/python3.3/runpy.py", line 160, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib64/python3.3/runpy.py", line 73, in _run_code exec(code, run_globals) File "/usr/lib/python3.3/site-packages/lifx/listen.py", line 23, in main() File "/usr/lib/python3.3/site-packages/lifx/listen.py", line 19, in main print(addr, unicode(packet)) NameError: global name 'unicode' is not defined

However, I have also been playing with the nodejs module for lifx and from the debug output of that it looks very much like I have two gateways bulbs reasonably often

cheers

On Sun, Mar 30, 2014 at 5:26 AM, sharp [email protected] wrote:

Could someone who is experiencing this issue use the listen.py script and report back? (run python3 -m lifx.listen)

I'm thinking there's a chance there might be 2 or more "gateway" bubs. If you play around with the bulbs while the listen script is running, you should see a dump of all bulb related network traffic.

If there are multiple values for "site" that means there are multiple gateways. If this is the case, we'll have to rethink some code in network.py.

When posting, feel free to search and replace the bulb's addresses. They could be used to predict your bulb's IP address in some IPv6 enabled future.

Sharp

Reply to this email directly or view it on GitHubhttps://github.com/sharph/lifx-python/issues/2#issuecomment-39004216 .

Franc

franc-carter avatar Mar 29 '14 22:03 franc-carter

OK, this issue is still occurring. I power cycled a bulb (and the other one on that same light switch) because it was coming up in android, but not in this library. Now all 10 bulbs show. This is with the UDP beta code, but I've had this issue before then, too, just not with that bulb.

jheld avatar Aug 03 '14 20:08 jheld

(duplicating part of response) Yeah, multiple gateways don't look to be supported in the python-lib, but should be solvable. When I have more details, will look at fixing, unless @sharph beats me to it :)

GNious avatar Aug 04 '14 14:08 GNious

A couple nights ago it was missing one, and now 3. Restarting the bulbs and the raspberry pi did not help. Using of the UDP branch as the base. I have the tcpdump if needed. Fing only showed one LIFX bulb on the network.

jheld avatar Aug 14 '14 00:08 jheld