November 08, 2024, 08:58:35 AM

Wrong WiFiEvent_t values

Started by MihaMarkic, September 21, 2022, 11:48:08 PM

Previous topic - Next topic

MihaMarkic

Just got my ESP32-PoE-ISO and trying Ethernet connection (oddly through WifiClient if I understand correctly).
Anyway, simple DHCP connection seems working it's just that WiFiEvent_t values I'm getting in WiFi.onEvent callback don't match ones declared in esp_event_legacy.h.
I'm getting values in this order: 18, 20, 22 while SYSTEM_EVENT_ETH_START is defined as 26, SYSTEM_EVENT_ETH_CONNECTED as 28, etc.
I'm using PlatformIO with Arduino framework and #include <ETH.h>

Perhaps it's something obvious?

LubOlimex

Maybe you can test with the default Arduino IDE demo, I can vouch it works since I've tested that one. Such a test would reduce the chances of a software problem (not eliminate it, since it still can be an issue in the network equipment and/or its configuration).

The board is supported in the official Arduino package for ESP32. So, if you haven't already first install the latest official package, follow the advice here:

https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html

Then go to Tools -> Board -> Olimex ESP32-POE-ISO and select it then also select the COM port of the device.

Then load the default example for Ethernet, from File -> Examples -> Ethernet -> ETH_LAN8720. Compile and upload. The demo probes www.google.com, check the "Serial Monitor" for activity.
Technical support and documentation manager at Olimex

MihaMarkic

Duh, mystery solved. I was using wrong enums, i.e. SYSTEM_EVENT_ETH_START instead of ARDUINO_EVENT_ETH_START. Oh well, that's C++ for me. :)