Page 1 of 1

DHCPs + eth: keep assign new IP to same board

Posted: Thu Jul 14, 2022 4:36 pm
by newsettler_AI
I've configured one ESP32 as DHCP server and connected via Ethernet it with another ESP32 board.
Problem is when I'm reconnecting eth cable, DHCP server always assign new IP address to the same board:

Code: Select all

(19977) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.1.4
(29980) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.1.5
(47978) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.1.6
Should I somehow release it manually after link lost?

My dhcps config:

Code: Select all

	const esp_netif_inherent_config_t eth_behav_cfg = {
			.get_ip_event = IP_EVENT_ETH_GOT_IP,
			.lost_ip_event = 0,
			.flags = ESP_NETIF_DHCP_SERVER | ESP_NETIF_FLAG_AUTOUP,
			.ip_info = (esp_netif_ip_info_t*)& ext_ip_info,
			.if_key = "ETH_DHCPS",
			.if_desc = "eth",
			.route_prio = 50
	};

	esp_netif_config_t eth_as_dhcps_cfg = {
			.base = &eth_behav_cfg,
			.stack = ESP_NETIF_NETSTACK_DEFAULT_ETH
	};
	esp_netif_t *eth_netif = esp_netif_new(&eth_as_dhcps_cfg);
Or this is normal behavior of DHCP server?.. :?

Re: DHCPs + eth: keep assign new IP to same board

Posted: Thu Jul 21, 2022 2:11 pm
by newsettler_AI
Any advices? :roll: