Page 1 of 1

exclude iprange from dhcp

Posted: Sun Oct 28, 2018 1:46 pm
by Sprokkie
Hi,

i have the dhcp server working, works really fine.
The problem i have now is that the dhcp server works on first come first service base.
that means that the ip addresses from different divices change al the time.

The solution would be to hav static ip adresses for other devices and exclude them from the addresspool that the dhcp is using.
Does any one know how to program that ?

this is the code snipper for the accespoint:

Serial.begin(115200);
Serial.println("Configuring access point...");

WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, password);
Serial.println("Wait 100 ms for AP_START...");
delay(100);


Serial.println("Set softAPConfig");
IPAddress Ip(192, 168, 1, 1);
IPAddress NMask(255, 255, 255, 0);
WiFi.softAPConfig(Ip, Ip, NMask);

IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);