Skip to content

[Feature Request] DHCP IP address reservation support #7304

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

Closed
2 tasks done
tloki opened this issue May 15, 2020 · 2 comments
Closed
2 tasks done

[Feature Request] DHCP IP address reservation support #7304

tloki opened this issue May 15, 2020 · 2 comments

Comments

@tloki
Copy link

tloki commented May 15, 2020

Basic Infos

  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have searched the issue tracker for a similar issue.

Feature Description

I think it would be usefull to have option of DHCP IP address reservations. One could make sure client (one or more of them) uses strict IP address without setting up static address on the clients themselves. This would require knowledge of devices MAC address, which shouldn't be very hard even if it is not printed on device itself - just connect to example sketch like here

[MCVE] - how it might look like

#include <Arduino.h>
#include <ESP8266WiFi.h>

const char* ssid = "wifi_ssid";
const char* password = "wifi_pass";

IPAddress staticIP(10,0,3,1);
IPAddress gateway(10,0,3,1);
IPAddress subnet(255,255,255,0);

// set up of our reserved client
uint8_t importantClientMAC[6] = [0x5e, 0xcf, 0x7f, 0x8b, 0x10, 0x13];
IPAddress importantClientIP(10,0,3,14);

void setup() {
  Serial.begin(115200);
  WiFi.softAPConfig(staticIP, gateway, subnet);
  
  // an example of how it might work
  WiFi.addReservedIP(importantClientMAC , importantClientIP);

  WiFi.softAP(ssid, pass);
}

void loop() {
}

This has many use cases - for example when your IoT device does not support static IP address setup and you want to be able to connect to it without fiddling around (just set it up to automatically connect to ESP AP)

@tloki tloki changed the title DHCP IP address reservation support [Feature Request] DHCP IP address reservation support May 15, 2020
@d-a-v
Copy link
Collaborator

d-a-v commented May 15, 2020

This is already provided in #5594.
Further work on DHCP server can happen when #6680 is merged.

@tloki
Copy link
Author

tloki commented May 15, 2020

As far as I can tell, you cannot specify address (easily) - but yeah, this does indeed help use case I described. Closing.

@tloki tloki closed this as completed May 15, 2020
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