Page 1 of 1

Using WiFi + Ethernet with indepedent DHCP Client + Server

Posted: Wed Dec 20, 2023 8:39 am
by ChrisInMunich
What I'm trying to do: Build a device with both Ethernet and WLAN where I can independently configure Ethernet and WLAN to either DHCP Client or Server.

The problem: Arduino's ETH.h doesn't allow us to enable the DHCP Server. I've tried to make calls directly to ESP-IDF but am running into state errors and other crashes. Note: I've never used ESP-IDF so have relied on snippets I find online without an understanding of ESP-IDF or how Arduino interacts with it.

Questions:
1. How can I set up DHCP Server on ETH.h from within the Arduino framework, even if I have to make calls directly to ESP-IDF?
2. Is the underlying network stack capable of tying DHCP server only to ETH? (i.e. so DHCP Server answers DHCP requests on ETH but not WLAN)
3. Any other advice? Is a particular PHY better for this application in terms of ESP-IDF support? So far I've been using ENC2870 (WT32-ETH01), and will soon try DM9051NP (ETH01-EVO), and also have some W5500 dev boards kicking around.

In hindsight, I probably should have used ESP-IDF alone instead of Arduino, but I'm deep in it now and am trying to get to MVP without starting from scratch with a pure ESP-IDF project.

Re: Using WiFi + Ethernet with indepedent DHCP Client + Server

Posted: Wed Dec 20, 2023 6:06 pm
by lbernstone
https://github.com/espressif/esp-idf/is ... -559530841
You can use IDF commands in Arduino, but arduino-esp32 simply was not designed with this capability. You could modify the arduino code to provide the appropriate flags and then you should be able to use it as a DHCPd.