mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			58 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
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
 | 
						|
 |