Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some DHCP questions are not answered in documentation. #537

Open
Holgi0811 opened this issue May 18, 2024 · 3 comments
Open

Some DHCP questions are not answered in documentation. #537

Holgi0811 opened this issue May 18, 2024 · 3 comments

Comments

@Holgi0811
Copy link

Hi guys,
I have some dhcp related questions:

  • Is it possible to reset dhcp leases?
  • What is dhcp range, full subnet?
  • Is it possible to use fixed dhcp addresses?
  • Is there a bug in Version V2.2.16? "save dhcp" command is not working. Device is receiving a new ip every day on wake up.

Thank you

@Holgi0811 Holgi0811 changed the title Some DHCP question not answered in documentation. Some DHCP questions are not answered in documentation. May 21, 2024
@hmueller01
Copy link
Contributor

Hi Holgi ;-)

What is dhcp range, full subnet? -> No:

    dhcp_lease.start_ip = config.network_addr;
    ip4_addr4(&dhcp_lease.start_ip) = 2;
    dhcp_lease.end_ip = config.network_addr;
    ip4_addr4(&dhcp_lease.end_ip) = 128;
    wifi_softap_set_dhcps_lease(&dhcp_lease);

Is it possible to use fixed dhcp addresses?
README.md says only by saving the DHCP table.

If you save your DHCP table (save dhcp) ESP comes up with lease time set to 100000 after reboot.
If a device connects, the lease time gets set to 120 = 2h. So after a day it unfortunately gets a new IP.

I plan to open a PR to make the lease time changeable ...

@hmueller01
Copy link
Contributor

hmueller01 commented Feb 3, 2025

From ESP SDK documentation:
bool wifi_softap_set_dhcps_lease_time(uint32 minute)
Set ESP8266 SoftAP DHCP server lease time, 120 minutes by default.
uint32 minute: lease time, uint: minute, range: [1, 2880].

@hmueller01
Copy link
Contributor

See #549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants