Open jonasbjurel opened 3 months ago
Do you have any plans to update it to a product that supports static IP settings?
This is all stuff you can do in code already
This is all stuff you can do in code already
Could you just give a hint on how? For instance understand if the addresses where provided as static addresses in the wifi-manager, or if it was provided by the DHCP server?
A small codesnip:
if (networkConfig.staticIp = wifiManager.isStaticIp()) { wifiManager.getStaticIp(&networkConfig.ipAddr); wifiManager.getStaticSn(&networkConfig.ipMask); wifiManager.getStaticGw(&networkConfig.gatewayIpAddr); wifiManager.getStaticDns(&networkConfig.dnsIpAddr); } else { networkConfig.ipAddr = WiFi.localIP(); networkConfig.ipMask = WiFi.subnetMask(); networkConfig.gatewayIpAddr = WiFi.gatewayIP(); networkConfig.dnsIpAddr = WiFi.dnsIP(); }
Static configs are not stored in flash, so user code has to store and recall them. So no need for wm specific wrappers
Static configs are not stored in flash, so user code has to store and recall them. So no need for wm specific wrappers
That is exactly why I want to know where to fetch the config, I.e. using: bool isStaticIp(void); I guess my small additions does not break anything, and I got my code working with these additions, which I failed to without them. BR/J
I am assuming this only works right after you save wifi ?
I am assuming this only works right after you save wifi ?
Correct, after having saved WiFi, I use these method to check if a static address was configured, and if so I fetch the static addresses using these methods, if not static I fetch the DHCP assigned addresses using the normal WiFi methods. BR/Jonas
To be able to find out if the network with static addresses or with DHCP following methods are proposed: