diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp index a1da8a87..cd4886e9 100644 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ b/libraries/WiFi/src/WiFiSTA.cpp @@ -283,8 +283,9 @@ bool WiFiSTAClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subne } tcpip_adapter_ip_info_t info; + log_d("STA IP uint32_t: %u.%u.%u.%u\n", local_ip[0], local_ip[1], local_ip[2], local_ip[3]); - if(local_ip != (uint32_t)0x00000000){ + if(local_ip != (uint32_t)0x00000000 && local_ip != INADDR_NONE){ info.ip.addr = static_cast(local_ip); info.gw.addr = static_cast(gateway); info.netmask.addr = static_cast(subnet); @@ -320,13 +321,13 @@ bool WiFiSTAClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subne ip_addr_t d; d.type = IPADDR_TYPE_V4; - if(dns1 != (uint32_t)0x00000000) { + if(dns1 != (uint32_t)0x00000000 && dns1 != INADDR_NONE) { // Set DNS1-Server d.u_addr.ip4.addr = static_cast(dns1); dns_setserver(0, &d); } - if(dns2 != (uint32_t)0x00000000) { + if(dns2 != (uint32_t)0x00000000 && dns2 != INADDR_NONE) { // Set DNS2-Server d.u_addr.ip4.addr = static_cast(dns2); dns_setserver(1, &d);