|
|
@ -61,10 +61,11 @@ void WiFiSettingsService::reconfigureWiFiConnection() { |
|
|
|
// disconnect and de-configure wifi and software access point
|
|
|
|
WiFi.disconnect(true); |
|
|
|
|
|
|
|
// configure static ip config for station mode (if set)
|
|
|
|
// configure for static IP
|
|
|
|
if (_staticIPConfig) { |
|
|
|
WiFi.config(_localIP, _gatewayIP, _subnetMask, _dnsIP1, _dnsIP2); |
|
|
|
} else { // else setting dynamic ip config and hostname
|
|
|
|
} else { |
|
|
|
// configure for DHCP
|
|
|
|
#if defined(ESP8266)
|
|
|
|
WiFi.config(INADDR_ANY, INADDR_ANY, INADDR_ANY); |
|
|
|
WiFi.hostname(_hostname); |
|
|
@ -79,7 +80,7 @@ void WiFiSettingsService::reconfigureWiFiConnection() { |
|
|
|
} |
|
|
|
|
|
|
|
void WiFiSettingsService::readIP(JsonObject& root, String key, IPAddress& _ip){ |
|
|
|
if ( !root[key].is<String>() || !_ip.fromString(root[key].as<String>())){ |
|
|
|
if (!root[key].is<String>() || !_ip.fromString(root[key].as<String>())){ |
|
|
|
_ip = INADDR_NONE; |
|
|
|
} |
|
|
|
} |
|
|
|