You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Heyho,
I'm using the example code with added debug prints on the ESP32-POE Rev G Board
My console ouput is:
starting Ethernet
ETH Any other event 18
ETH Any other event 20
ETH Any other event 22
I'm connected to a Router with DHCP but I'm not using POE right now as I'm using the serial console via USB for debugging purposes to avoid damaging my Computer. The device is powered by my computers USB 3 connector
I'm using VsCode + PlatformIO extension as IDE and upload and monitor to flash the device and connect to the Serial Interface
it's notable that the gateway and dns server are not the same in our network, could it be I need to set those parameters manually?
Did maybe anything relevant to this change between Rev.B and G I didn't notice?
do I explicitly need to use POE in this example?
My code is attached below
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
#define ETH_PHY_POWER 12
#include <ETH.h>
static bool eth_connected = false;
void WiFiEvent(WiFiEvent_t event)
{
switch (event) {
case SYSTEM_EVENT_ETH_START:
Serial.println("ETH Started");
//set eth hostname here
ETH.setHostname("esp32-ethernet");
break;
case SYSTEM_EVENT_ETH_CONNECTED:
Serial.println("ETH Connected");
break;
case SYSTEM_EVENT_ETH_GOT_IP:
Serial.print("ETH MAC: ");
Serial.print(ETH.macAddress());
Serial.print(", IPv4: ");
Serial.print(ETH.localIP());
if (ETH.fullDuplex()) {
Serial.print(", FULL_DUPLEX");
}
Serial.print(", ");
Serial.print(ETH.linkSpeed());
Serial.println("Mbps");
eth_connected = true;
break;
case SYSTEM_EVENT_ETH_DISCONNECTED:
Serial.println("ETH Disconnected");
eth_connected = false;
break;
case SYSTEM_EVENT_ETH_STOP:
Serial.println("ETH Stopped");
eth_connected = false;
break;
default:
Serial.printf("ETH Any other event %u \n", event);
break;
}
}
void testClient(const char * host, uint16_t port)
{
Serial.print("\nconnecting to ");
Serial.println(host);
WiFiClient client;
if (!client.connect(host, port)) {
Serial.println("connection failed");
return;
}
client.printf("GET / HTTP/1.1\r\nHost: %s\r\n\r\n", host);
while (client.connected() && !client.available());
while (client.available()) {
Serial.write(client.read());
}
Serial.println("closing connection\n");
client.stop();
}
void setup()
{
Serial.begin(115200);
delay(10000);
Serial.println("\n starting Ethernet");
WiFi.onEvent(WiFiEvent);
ETH.begin();
}
void loop()
{
if (eth_connected) {
testClient("google.com", 80);
}
delay(10000);
}
Thank You for any suggestions
The text was updated successfully, but these errors were encountered:
Heyho,
I'm using the example code with added debug prints on the ESP32-POE Rev G Board
My console ouput is:
starting Ethernet
ETH Any other event 18
ETH Any other event 20
ETH Any other event 22
I'm connected to a Router with DHCP but I'm not using POE right now as I'm using the serial console via USB for debugging purposes to avoid damaging my Computer. The device is powered by my computers USB 3 connector
I'm using VsCode + PlatformIO extension as IDE and upload and monitor to flash the device and connect to the Serial Interface
it's notable that the gateway and dns server are not the same in our network, could it be I need to set those parameters manually?
Did maybe anything relevant to this change between Rev.B and G I didn't notice?
do I explicitly need to use POE in this example?
My code is attached below
Thank You for any suggestions
The text was updated successfully, but these errors were encountered: