Here is the code on the ESP. I am using Arduino IDE 1.6.4 and the ESP plugin. I am using an FTDI to USB chip to upload.
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
char ssid[] = "SSID";
char pass[] = "PASSWORD";
#define E131_BUFFER_SIZE 638
#define PACKET_BEGIN 0x10
#define START_CODE 0
unsigned int localPort = 5568;
unsigned char E131Buffer[E131_BUFFER_SIZE];
boolean NewPacket = false;
WiFiUDP udp;
void setup()
{
Serial.begin(115200);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
}
udp.begin(localPort);
}
void loop()
{
int packetSize = udp.parsePacket(); //parse packet
if(packetSize)
{
udp.read(E131Buffer,E131_BUFFER_SIZE); //read packet into buffer
NewPacket = true;
}
if(E131Buffer[1] == PACKET_BEGIN && E131Buffer[125] == START_CODE && NewPacket == true) //quick check to see if packet is E1.31
{
for(int i = 126; i < E131_BUFFER_SIZE; i++)
{
Serial.write(E131Buffer[i]); //write channel values 1-512 bytes 126-637 in packet
}
NewPacket = false;
}
} //end loop