LIFX Developer Zone

Connection with Raspberry Pi

#1

I am using the Lifx lamp connected to my Raspberry Pi system and using the commands via python script. I would like to know if there is a way of the bulb not lose connection with raspberry even if the internet from home does not work… P2P protocol is a solution?

#2

I’m not sure if I understand your question, but I think you’re asking if you really need the internet.

I’ve been using my own Python app lately, which runs on a Zero and does all of its communication over local WiFi using the so-called LAN Protocol. As an experiment, I unplugged my WiFi from my ISP’s modem, and the app still worked. So I think the LAN Protocol works fine without the outside internet (as it should).

1 Like
#3

Nice, You understood correctly. I used mclarkk / lifxlan but it did not work when I disconnected from the internet, I’m seeing a way to connect the lamp to the Wifi router without needing the mobile app too.

#4

Ok, I see what you’re saying. I did another experiment, which was to:

  1. Cut off power to the bulbs.
  2. Disconnect the internet.
  3. Power up the bulbs.

The results were ugly. I was pretty much unable to use them, even with the Android app. So then I did this:

  1. Cut off power to the bulbs.
  2. Re-connect the internet.
  3. Power up the bulbs.

The bulbs are no longer reliably present on the network. My app is having serious problems discovering them, and the “hello_world.py” script from LifxLAN is no longer finding all of them consistently. I have 4 bulbs, and the number it dicscovers ranges between 1 and 4.

I could control them somewhat with the LIFX Android app, but not reliably. In fact, I saw really strange behavior like flickering, even though my own app is shut down. They intermittently disappear from the Android app’s home screen, and then return again after a while.

I also tried using Google Home on my phone, which used to work fine, but it’s not doing too well, either; attempting to turn them all on or off works for only some of the bulbs.

So, I was mistaken. You need to be connected to the internet to use the bulbs, although I can’t think of any technical reason why this should be true. In fact, it seems like they’re in a bad state and may need to be reset.

Anyway, this seems to be a tricky issue. I’m going to fool around with this in my spare time, and will post an update when I have more information.

#5

Quick follow-up: the solution was to shut down the WiFi and turn it back on again. I think forcing the bulbs to reset their WiFi connections may have solved it.