The use of the ESP8266 in the world of IoT

User avatar
By wakewatcher
#83836 I'm making (some) progress. I'm using Ken Taylor's forked version of WifiManager and it's working when I let the router supply the IP address.

What I’m trying to do is use WiFi Manager to configure both an 8266 server and one or more 8266 clients. Of course that means that I need to get the clients the IP address of the server and since that can change from power cycle to power cycle I need to force a static IP address. It appears this can be done with…

IPAddress ip(192, 168, 10, 203);
IPAddress gateway(192, 168, 10, 1);
IPAddress subnet(255, 255, 255, 0);
wifiManager.setSTAStaticIPConfig(ip, gateway, subnet);
if (!wifiManager.startConfigPortal(“”)) {code] else {code}

In fact when I insert this into the code it appears to accept it. That is, on the configuration portal the three parameters come up as defaulted in the code. (I can also change them on the portal if I want.) When I click save they also appear in the debug serial stream. However when the WiFi connection is established the IP address is set to one that the router supplies and not the one requested. I must be missing something. Any hints would be greatly appreciated. Thx.