Hi all, I trying to figure out how to send a message (color change, power on, power off, and so on) to a group of bulbs ?
I understand that each group is identified by a 16 bytes ID, but how is it used when forging a LAN packet ?
Side question #1 : is there any drawback to use groups intensively ? I don’t use Lifx bulbs for domestic use but rather for lighting effects, so if I use groups my application will create groups very often, and affect bulbs to several groups very often too.
Side question #2 : I’m seeking for the best synchronicity, best response time (because light effects are sometimes sync’ed with sounds or videos) - For 12 bulbs, is there a big performance gain with bulbs hardwired groups compared to application side groups (same message being sent to several bulbs) ?
Have a nice day !
To send a message to each bulb in a group you craft and send a unicast packet to each bulb in the group. The 16 byte ID is just a label on the bulb, the application handles all the multiplexing. Originally we did support talking to groups using broadcast messages, but on 802.11 networks broadcast messages are unreliable often reaching some bulbs later, and sometimes not at all. In the end our applications had to track group members and retransmissions to each member anyway, and when we switched to unicast the efficiency improved by leaps and bounds.
Not that I’m aware of.
Sending unicast messages directly to each individual bulb is hands down the best way to get the best synchronicity and response time. Make sure your application tracks the replies (or acks) from each message and resends it if it doesn’t get one. Of course the hard part here is tuning the timeout so that you resend fast enough, while not sending duplicates.
Hi thanks Daniel ! I followed your advice about unicast messages (and handles groups on application side, not lifx ones) and it seems to work pretty well - really better than with broadcast messages which with I’ve been struggling for days…