Coder Social home page Coder Social logo

Comments (20)

mclarkk avatar mclarkk commented on August 23, 2024

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.

Arndorferd avatar Arndorferd commented on August 23, 2024

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.

mclarkk avatar mclarkk commented on August 23, 2024

Run this code however you'd prefer:

from lifxlan import *
print(device.get_broadcast_addrs())

What does it print out?

from lifxlan.

Arndorferd avatar Arndorferd commented on August 23, 2024

it prints out ['192.168.1.255']

from lifxlan.

mclarkk avatar mclarkk commented on August 23, 2024

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.

Arndorferd avatar Arndorferd commented on August 23, 2024

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.

Arndorferd avatar Arndorferd commented on August 23, 2024

Is it recognizing my lights as devices?

from lifxlan.

mclarkk avatar mclarkk commented on August 23, 2024

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.

Arndorferd avatar Arndorferd commented on August 23, 2024

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.

Arndorferd avatar Arndorferd commented on August 23, 2024

Your list on products.py is missing 93? I have A19 lifx color bulbs.

from lifxlan.

Arndorferd avatar Arndorferd commented on August 23, 2024

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.

ceboxsell avatar ceboxsell commented on August 23, 2024

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.

mclarkk avatar mclarkk commented on August 23, 2024

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.

mclarkk avatar mclarkk commented on August 23, 2024

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.

Arndorferd avatar Arndorferd commented on August 23, 2024

I cant seem to upgrade it, I installed by source. I cant really find a way to uninstall the old one either.

from lifxlan.

mclarkk avatar mclarkk commented on August 23, 2024

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.

Arndorferd avatar Arndorferd commented on August 23, 2024

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.

mclarkk avatar mclarkk commented on August 23, 2024

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.

Arndorferd avatar Arndorferd commented on August 23, 2024

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.

mclarkk avatar mclarkk commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.