Here is my simple test code:
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
char ssid[] = "******";
char pass[] = "*****";
IPAddress local_ip(192, 168, 1, 15);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
#define E131_BUFFER_SIZE 638
unsigned int localPort = 5568;
unsigned char E131Buffer[E131_BUFFER_SIZE];
WiFiUDP udp;
void setup()
{
Serial.begin(250000);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pass); //Connect to Network
WiFi.config(local_ip, gateway, subnet);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
}
udp.begin(localPort);
}
void loop()
{
int packetSize = udp.parsePacket();
if (packetSize)
{
Serial.println(packetSize);
udp.read(E131Buffer, E131_BUFFER_SIZE);
udp.flush();
Serial.println(E131Buffer[114]); //Byte 114 in the packet is the universe number
}
}