Hello,
I have and esp32 with softAP and another esp32 WiFi client connecting with each other. My problem is that with default settings after 2 hours they disconnect because of the DHCP ip lease time.
1) I can change the lease time on softAP, what is the maximum time i can define?
2) Can the client send something to the softAP to tell everything is ok, or reset the lease time to avoid the client disconnection?
Thank you.
DHCP ip lease renewal
-
- Posts: 198
- Joined: Sun Jun 23, 2024 6:18 pm
Re: DHCP ip lease renewal
The softAPConfig() function in the ESP32 Arduino core lets you set the lease time. The maximum lease time is typically defined in seconds, with a practical limit of UINT32_MAX seconds (about 49 days). You can set it using:
Set lease_time_in_seconds to the maximum value if you want a very long lease. However, using such a large value may lead to unintended behavior if the ESP32 experiences a reset or disconnection.
Code: Select all
WiFi.softAPConfig(local_ip, gateway, subnet);
WiFi.softAPConfig(lease_start_ip, lease_end_ip, lease_time_in_seconds);
Re: DHCP ip lease renewal
Thank you,
that solved my 1) point.
Any idea on the 2)?
that solved my 1) point.
Any idea on the 2)?
Who is online
Users browsing this forum: Bryght-Richard, ESP_Roland and 168 guests