Comments (20)
What OS are you on? Are you also on Fedora like the original poster of that issue? Is your network setup pretty normal? What is the prefix of your network's local address? (e.g., 192.168.1.x, 10.0.0.x)
There was a recent pull request that changed the way that the library gets the local network address for broadcasting the discovery message. Historically that functionality has had a lot of problems working consistently on every operating system. The code finally got to a place where it was working fine, but it required a third-party library called netifaces that was annoying for people to install, so I recently accepted a pull request to change the code (#129). It's hard to know right now what is causing your issue given the lack of output, but I have my suspicions and I would definitely start by seeing what the output of get_broadcast_addrs()
is (in device.py
).
Sorry I can't be of better help right now -- finishing up my dissertation over the next week. I can only provide high-level guidance about where the problem might be until the dissertation is filed. Let me know what you find and I'll try to follow up.
from lifxlan.
I am on Pop!_Os which is an ubuntu fork. My bulbs are on 192.168.1.x. Not sure how to get the output of get_broadcast_addrs(), would I have to put it in an IDE?
from lifxlan.
Run this code however you'd prefer:
from lifxlan import *
print(device.get_broadcast_addrs())
What does it print out?
from lifxlan.
it prints out ['192.168.1.255']
from lifxlan.
Great! So that's not the issue. What does this print out?
from lifxlan import *
lan = LifxLAN()
print(lan.get_devices())
print("---")
print(lan.lights)
print("---")
print(lan.devices)
from lifxlan.
print(lan.get_devices())
[<lifxlan.device.Device object at 0x7ff28d397f10>, <lifxlan.device.Device object at 0x7ff28d397d90>, <lifxlan.device.Device object at 0x7ff28d397ee0>, <lifxlan.device.Device object at 0x7ff28d397f70>, <lifxlan.device.Device object at 0x7ff28d32d130>, <lifxlan.device.Device object at 0x7ff28d32d220>, <lifxlan.device.Device object at 0x7ff28d32d1c0>, <lifxlan.device.Device object at 0x7ff28d32d100>]
print("---")
'---'
print(lan.lights)
[]
print("---")
'---'
print(lan.devices)
[<lifxlan.device.Device object at 0x7ff28d397f10>, <lifxlan.device.Device object at 0x7ff28d397d90>, <lifxlan.device.Device object at 0x7ff28d397ee0>, <lifxlan.device.Device object at 0x7ff28d397f70>, <lifxlan.device.Device object at 0x7ff28d32d130>, <lifxlan.device.Device object at 0x7ff28d32d220>, <lifxlan.device.Device object at 0x7ff28d32d1c0>, <lifxlan.device.Device object at 0x7ff28d32d100>]
I put quotes around --- to prevent github from putting a line
from lifxlan.
Is it recognizing my lights as devices?
from lifxlan.
Ah ha! That's great, so the network-based discovery is working, whew!
In lifxlan
, everything that gets discovered is labeled a device by default. A device only gets tagged as a light as well if its product ID shows up in the light_products
list in this file: https://github.com/mclarkk/lifxlan/blob/master/lifxlan/products.py
(You can see the product ID when you print out the device, e.g. with print(lan.get_devices()[0])
. I would be interested in knowing the product IDs for the devices that aren't being recognized as lights!)
That products.py
file was updated recently. If your version of lifxlan is older than 1.2.6, it would be a good idea to upgrade or reinstall it now. If you installed via pip, pip show lifxlan
will print out the version info. If it's not 1.2.6, there's a good chance the products.py file is out of date and upgrading/reinstalling lifxlan will fix your problem.
from lifxlan.
No its 1.2.6, I also dont know why it wouldn't show its just A19 bulbs. When I use this print(lan.get_devices()[0]) it says Product: 93 (Unknown product) and Version: 67305733
from lifxlan.
Your list on products.py is missing 93? I have A19 lifx color bulbs.
from lifxlan.
I put lifx white bulbs in that I had that I was going to return and that shows up in ambience although only with the on off function, no dimming or anything, so the program is working just not with my a19 bulbs
from lifxlan.
As a suggestion I find it best to download the code from GitHub and install locally. It ensures the latest is installed. I then use the Hello world script to test.
From my limited knowledge I think this would be best for you.
from lifxlan.
Wow yeah, product 93 is missing somehow. That shouldn't happen, especially since we switched to generating products.py
directly from LIFX's products.json using an automatic script! I'll look into it.
from lifxlan.
All right, I updated both the source on Github and also the version on pip
, so however you installed lifxlan
, upgrade it and let me know if it works now @Arndorferd!
from lifxlan.
I cant seem to upgrade it, I installed by source. I cant really find a way to uninstall the old one either.
from lifxlan.
To upgrade from source, navigate into the root lifxlan
folder and do git pull
to get the latest source. To install the newly updated code, run python setup.py install
in that same root folder.
from lifxlan.
Idk what you mean by root lifxlan folder, I tried just downloading the file off of here and doing python setup.py install in it. Its still the same issue but, pip show lifxlan shows 1.2.6 and not 1.2.7 so not sure if it updated.
from lifxlan.
Did you ever install lifxlan via pip, perhaps when following the instructions for Ambience? Ambience may also have installed lifxlan through pip automatically.
If lifxlan was ever installed by pip, then Python will still be using the pip version. You should upgrade the pip version by running pip3 install --upgrade lifxlan
. If you really want to install from source for some reason let me know and I can help you uninstall the pip version, but I suspect that just upgrading the pip-installed one is going to be easier.
from lifxlan.
This is working at least in that its showing up as lights with,
from lifxlan import *
lan = LifxLAN()
print(lan.get_devices())
print("---")
print(lan.lights)
print("---")
print(lan.devices)
however ambience is still not showing them, perhaps the issue is still an issue with Ambience.
from lifxlan.
Great! Glad to have helped.
If Ambience isn't working there could be a number of reasons why. I would recommend uninstalling it and reinstalling it fresh first, and if that still doesn't work post an issue on their repo.
from lifxlan.
Related Issues (20)
- Light misclassified as Device HOT 1
- Candle Colour should be a chain device HOT 1
- Setup.py does not work. HOT 2
- Newest "LIFX Color A19 1100 lm" bulbs not recognized as color bulbs HOT 2
- Products Definition dependant on firmware HOT 1
- Link to onboarding script in readme &/or provide onboarding support HOT 1
- get_devices() throws a "OSError: [WinError 10051] A socket operation was attempted to an unreachable network" if a Hyper-V Virtual Ethernet is active HOT 4
- Issues on manjaro
- Can't get Group or Light to work with static MAC/IP definitions... HOT 3
- Discovery + Use Appears to Fail on LIFX Firmware 3.70 HOT 4
- Most lights being detected but some of same model are not HOT 5
- Light.get_power() stopped working after firmware update HOT 2
- bitstring 4.x .CreationError: Token with length 64 packed with value of length 0 (bits:64=0). HOT 3
- PyPi version out of date, unusable due to now-resolved bug HOT 3
- Having issues with a product
- "It's no longer possible to auto initialise a bitstring from an integer" error HOT 7
- [Example request] The most basic way to turn an individual, specific light on and off
- On a computer with multiple NICs including onese from hyper-v and vmware I am getting -> OSError: [WinError 10051] A socket operation was attempted to an unreachable network error.
- Discovery not working - defining using MAC & IP
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lifxlan.