LIFX Developer Zone

LIFX and Crestron

I have been trying to control the LIFX bulb with my Crestron system with no luck. I have tried using both the UDP LAN protocol and the HTTP both with no luck. I can see with the UDP using wireshark that it being sent to the network but the bulb does not respond. Tried sending this UDP to both the lamp IP and broadcast (255.255.255.255). The lamp does not respond. /x31/x00/x00/x34/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x00/x66/x00/x00/x00/x00/x55/x55/xFF/xFF/xFF/xFF/xAC/x0D/x00/x04/x00/x00

Any ideas? Thanks.

Your packet that you are sending looks fine. :smiley: Here it is decompiled:

lifx_packet(
  frame_header=frame_header(
    size=49,
    origin=0,
    tagged=1,
    addressable=1,
    protocol=1024,
    source=0),
  frame_address=frame_address(
    target=0,
    reserved1=0,
    reserved2=0,
    ack_required=0,
    res_required=0,
    sequence=0),
  protocol_header=protocol_header(
    reserved1=0,
    pkt_type=102,
    reserved2=0),
  payload=payload_light_setcolor(
    reserved=0,
    hue=21845,
    saturation=65535,
    brightness=65535,
    kelvin=3500,
    duration=1024)
)

You should make sure that the tool you are using to send them properly strips the \x control codes and sends the packets as binary. Could you PM me the wireshark dump so I can take a look?

When you mentioned them being sent by binary, I checked and they were not. So I formatted the packets differently and it’t working now. Thanks for the help.

Question would this be formatted correctly for setting the lamp to full power?
\x00\x28\x00\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x75\x00\x00\x00\xFF\xFF\x00\x04\x00\x00

This is an invalid LIFX packet, for a start the length is set to 10240 bytes, but the packet itself is much shorter. Indeed a packet this big is way bigger than the maximum allowed packet in the LIFX protocol.

This post has more details on how to build packets yourself:

Hey M.clark, I just got my first LIFX bulb too and am trying to get it linked up with my Crestron MC3, I’ve started to try sending several packets through a UDP com symbol but have yet to successfully gain control. Any chance you could give me a little boost on the crestron end? I’d be eternally grateful for a sample program and maybe we could gang up on writing a simpl + module. to form packets with a few solid analog joins to drive the parameters.

Here is a Crestron module I made. It uses the HTTP API.

If you want fully local control, take a look at Photons Interactor to replace the HTTP API. It has a very similar format and functionality, though it’s not quite a drop-in replacement.