1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

UDP Device

BACKGROUND
---------------------------------------------------------
The UDP led device type can be used to send LED data over UDP packets.
It was originally designed to support an ESP8266 Wifi module based WS2812
LED strip controller.

I've used this to support :
- A string of 600 LEDs as xmas decorations
The effects development kit is great for these scenarios

- a 61 LED collection of concentric circles
This has been used as a "night light" and a super lo-res
TV

In each of these cases, the hyperion-remote iOS app is a great way to
control the effects.


CONFIG
---------------------------------------------------------
Simple example for devices that support a raw binary protocol.
"device" :
{
"name" : "MyPi",
"type" : "udp",
"output" : "esp201-0.home:2391", "protocol" : 0,
"rate" : 1000000,
"colorOrder" : "grb"
},



If you are using an ESP8266/Arduino device with a long LED strip, you chould use this alternate protocol.
The ESP8266/Arduino doesnt support datagram re-assembly so will never see any udp packets greater than 1450.
"device" :
{
"name" : "MyPi",
"type" : "udp",
// "output" : "esp201-0.home:2392", "protocol" : 2, "maxpacket" : 1450,
"rate" : 1000000,
"colorOrder" : "rgb"
},

PROTOCOL
---------------------------------------------------------
Simple UDP packets are sent.

Packet Format protocol 0:
3 bytes per LED as R, G, B

Packet Format protocol 2:
0: update number & 0xf;
1: fragment of this update
2: 1st led# of this update - high byte
3: 1st led# of this update - low byte
4..n 3 bytes per LED as R, G, B

Packet Format protocol 3: (simple TPM2.net implementation)
0: 0x9C
1: 0xDA
2: number of databytes (leds * 3) - high byte
3: number of databytes (leds * 3) - low byte
4: fragment number (1-255)
5: number of fragments (1-255)
6..n: 3 bytes per LED as R, G, B
n+1: 0x36
More information to TPM2.net : TPM2.net

This page has been seen 5,780 times.