LIFX Developer Zone

LAN API and 1st generation LIFX Z

#1

We’ve made a prototype iOS/Android app which uses the LAN API to control LIFX lights. It works fine in my office on some new bulbs we’ve just purchased, but won’t pick up my LIFX Z (1st generation) LED lights in my own home. The new bulbs do show up when I put them on my home network, so I don’t think this is an issue with my router config.

Are generation 1 LIFX Z strips (firmware 1.2) supposed to work with the LAN API? I know they work with the HTTP API, because I have some IFTTT recipes successfully hitting my lights.

Apologies if this is documented somewhere, but we couldn’t find anything.

#2

Hello,

Generation 1 LIFX Z strips do indeed support the LAN API.

Is discovery not working or control or both?

And what IOS/Android libraries are you using in your app?

#3

Thanks for the response.

We are not using any iOS or Android libraries - it is all pure C#, in a Unity app.

And we haven’t got as far as testing control with these lights, because the discovery is failing.

Hope this helps.

#4

I see.

In that case, how are you doing discovery?

#5

So, from my developer…

" We are broadcasting a GetService message.
Listening for responses then sending unicasts to each with GetState and GetLocation.
After that we send unicast SetColor messages."

We’re using these as reference:


On my home network, my LIFX Z (gen 1) did not respond, but a new LIFX bulb worked fine.

Thanks,

Danny.

#6

That sounds correct.

When you create the GetService packet are you setting the source field to a non zero value?

#7

So, yes, we are indeed setting the source field to a non-zero value. Is this correct?

#8

yeap, a nonzero value is correct (setting source to zero can have weird behaviour).

In that case I’m really not sure.

If you have python3.6+ installed and do pip install lifx-photons-core and run lifx lan:find_devices does it find your strip?

#9

I’ll try this over the weekend, and let you know how I get on. Thanks for your help on this.