Formatting UDP hexadecimal packets

1,030 views
Skip to first unread message

Andrew Jawitz

unread,
Dec 7, 2014, 3:33:43 PM12/7/14
to node...@googlegroups.com
While specific info that could help me create a custom node for MiLight/LimitlessLED Smart bulbs appears to be tough to come by, I thought I would take things step by step by testing whether or not I can configure the function node to control the lights via UDP commands.
 According to the reference at http://www.limitlessled.com/dev/ 

All UDP Commands are 3 Bytes. First byte is from the list below [All On, All Off etc], plus a fixed 2 byte suffix of 0x00 (decimal: 0) and 0x55 (decimal: 85)

 Therefore, 

 to turn all RGBW COLOR LimitlessLED Smart lights to ON then send the TCP/IP UDP packet of:  0x42 0x00 0x55

  So I'm trying to set up a test flow consisting of an Inject node, a Function node, and a UDP Out and Debug  node configured as outputs.  I have configured the UDP Out node with the ip address of the wifi-hub and the port of 8899 (as specified by the LimitlessLED documentation).

  I can't find any other examples in the flow library that might be able to serve as a template, but I would greatly appreciate any advice on how best to set this test flow up.  Specifically, I would really appreciate any advice about how to format the TCP/IP UDP packet in the Function node.

Dave C-J

unread,
Dec 8, 2014, 3:59:30 AM12/8/14
to node...@googlegroups.com
Hi,

in your function just define a Buffer as an array of bytes....

msg.payload = new Buffer([ 0x42, 0x00, 0x55 ]);

and you should be on the way.
Reply all
Reply to author
Forward
0 new messages