sharph / lifx-python

A python library for the LIFX wifi-enabled bulbs
GNU Affero General Public License v3.0
38 stars 9 forks source link

Multiple Bulbs #2

Open franc-carter opened 10 years ago

franc-carter commented 10 years ago

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

lachlanmcdonald commented 10 years ago

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...

franc-carter commented 10 years ago

Interesting,

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

thanks

sharph commented 10 years ago

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

franc-carter commented 10 years ago

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 notifications@github.com 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 commented 10 years ago

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 franc.carter@gmail.comwrote:

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 notifications@github.com 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

jheld commented 10 years ago

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

franc-carter commented 10 years ago

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 notifications@github.comwrote:

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

sharph commented 10 years ago

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

franc-carter commented 10 years ago

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 notifications@github.com 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
jheld commented 10 years ago

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.

GNious commented 10 years ago

(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 :)

jheld commented 10 years ago

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.