Cannot receive UDP on Wio Terminal

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);
}

I tested your code out and it was not receiving data from a UDP client I made. I ran Wireshark to see what was going across the Wifi and it seems it was not answering on port 9999.

I changed the port to something else (2377) just as a test and it too was not answering on the port.

The code ‘looks’ ok but I suspect that the WifiUDP library hasn’t been tested.

In the image below 192.168.42.77 is the WIO Terminal.

2 Likes

Currently, the features of UDP are indeed still under development.

1 Like

Thank you for your reply.

I was relieved that I was still testing.
I wondered if I could analyze it myself, but I’ll wait for a while.
If development is over, I’ll test it if you can comment here.
best regards.