Can someone try to compile this minimized example and send a package to the ESP to see if this is a general bug or just mine. obviously SSID and password needs to be set
#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
// WIFI
const char* ssid = "SSID";
const char* pass = "PASSWORD";
int status = WL_IDLE_STATUS;
unsigned int localPort = 2390;
byte packetBuffer[512];
WiFiUDP Udp;
char* recv;
void setup()
{
Serial.begin(115200);
while (!Serial)
{
}
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pass);
int tries=0;
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
tries++;
}
Serial.println();
IPAddress ip = WiFi.localIP();
Udp.begin(localPort);
Serial.print("Udp server started: ");
Serial.println(ip);
Serial.println(localPort);
}
void loop()
{
int packetSize = Udp.parsePacket();
if (packetSize)
{
int len = Udp.read(packetBuffer, 255);
if (len > 0)
{
for (int i=1;i<=len;i++)
{
recv = recv + packetBuffer[i-1];
Serial.print(recv);
}
}
}
}