Esp32-PoE receive UDP example?

Started by Jimbo181, August 28, 2023, 04:11:47 PM

Previous topic - Next topic

Jimbo181

Hi. Is there a working example of receiving UDP packets over the Ethernet (not WiFi) on the ESP32-PoE?

My requirements :
Host a web server for config.
Receive and transmit UDP.

I've got my project working with WiFi, but only using DHCP.
If I try and use static ip on the Ethernet port, it works but the UDP.listen no longer functions.
Many thanks,

mihaiadrian

#1
Do you comunicate via UDP in the local network or outside ?  Because if it is outside, you need also gateway setup ( and maybe this is why it worked with dhcp but not with static ip )

I am sorry, I am not using udp, but TCP and with DHCP ( but do transmit outside my network and works ) but maybe it helps:

# mandatory defines before including headers to have cable network working on esp32 poe iso
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12

#include <ETH.h>
#include <Ethernet.h>

  ETH.begin();             
  WiFiClient client;
  result = client.connect(IP, PORT);
  if ( result == 1 )
  {
    client.print("I am connected");
  }