I’m having trouble receiving UDP.
I want to identify whether it is a problem with my usage or a problem with the library. Is there a kind person who can support me? I am also updating the firmware of the RTL8720 and sending UDP is working.
best regards.
#include <AtWiFi.h>
#include <WiFiUdp.h>
// WiFi network name and password:
const char* ssid = “SSID”;
const char* pwd = “PASS”;
const int udpPort = 9999;
//The udp library class
WiFiUDP udp;
void setup()
{
// Initilize hardware serial:
Serial.begin(115200);
while(!Serial); // Wait for Serial to be ready
//Connect to the WiFi network
WiFi.disconnect(true);
//Initiate connection
WiFi.begin(ssid, pwd);
Serial.println(“Waiting for WIFI connection…”);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.println(“Connecting to WiFi…”);
}
Serial.println(“WiFi connected”);
Serial.println(WiFi.localIP()); //print LAN IP
// udp recieve start
udp.begin(udpPort);
}
void loop()
{
if (udp.parsePacket())
{
Serial.println(udp.read());
}
//Wait
delay(10);
}