DHCP server on ethernet and netif
Posted: Tue Feb 18, 2020 4:51 pm
How do I enable DHCP server on ethernet and in general step past netif default settings?
I have successfully initialise Ethernet using netif with ESP_NETIF_DEFAULT_ETH(). Everything works fine, I receieve an IP address etc.
I then created my own ESP_NETIF_DHCPS_ETH structure which is as ESP_NETIF_DEFAULT_ETH() but .flags copied from default Wifi settings:
This fails at:
with error:
The documentation is not very clear and I cannot find an example which starts/stops a DHCP server.
Any help appreciated!
Alternatively any DHCP server that will work with the stack.
I have successfully initialise Ethernet using netif with ESP_NETIF_DEFAULT_ETH(). Everything works fine, I receieve an IP address etc.
I then created my own ESP_NETIF_DHCPS_ETH structure which is as ESP_NETIF_DEFAULT_ETH() but .flags copied from default Wifi settings:
Code: Select all
.base.flags = ESP_NETIF_DHCP_SERVER | ESP_NETIF_FLAG_AUTOUP
This fails at:
Code: Select all
ESP_ERROR_CHECK(esp_eth_set_default_handlers(eth_netif))
Code: Select all
ESP_ERROR_CHECK failed: esp_err_t 0x103 (ESP_ERR_INVALID_STATE)
Any help appreciated!
Alternatively any DHCP server that will work with the stack.