diff --git a/doc/esp8266wifi/station-class.rst b/doc/esp8266wifi/station-class.rst index 2569e217eb..08469d8e10 100644 --- a/doc/esp8266wifi/station-class.rst +++ b/doc/esp8266wifi/station-class.rst @@ -131,7 +131,9 @@ For Arduino networking API compatibility, the ESP8266WiFi library supports IPv4- WiFi.config(local_ip, dns, gateway) (discouraged, insufficiently accurate, for Arduino API portability) WiFi.config(local_ip, dns, gateway, subnet) -Versions where some of ``dns``, ``gateway`` and ``subnet`` parameters are not specified use a default value. Default ``subnet`` is 255.255.255.0. Default ``gateway`` and ``dns`` are derived from ``local_ip`` by changing the last number to 1 (discouraged). To return to DHCP you can use ``WiFi.config(INADDR_NONE);``. +Versions where some of ``dns``, ``gateway`` and ``subnet`` parameters are not specified use a default value. Default ``subnet`` is 255.255.255.0. Default ``gateway`` and ``dns`` are derived from ``local_ip`` by changing the last number to 1 (It is discouraged to use these default values as they may not apply to every network configuration). + +To return to DHCP you can use ``WiFi.config(INADDR_NONE);``. **Warning: The default values for dns, gateway and subnet may not match your router's settings.** Also please note, that ``config(local_ip, gateway)`` is not supported and ``WiFi.config(local_ip, gateway, subnet)`` doesn't set the DNS server IP. diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h index 12faa3dc18..ad1b655a55 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h @@ -49,7 +49,7 @@ class ESP8266WiFiSTAClass: public LwipIntf { // two and one parameter version. 2nd parameter is DNS like in Arduino // IPv4 only - [[deprecated("It is discouraged to use this 1 or 2 parameters network configuration legacy function config(ip[,dns]) because it is insufficiently accurate")]] + [[deprecated("It is discouraged to use this 1 or 2 parameters network configuration legacy function config(ip[,dns]) as chosen defaults may not match the local network configuration")]] bool config(IPAddress local_ip, IPAddress dns = INADDR_ANY); bool setDNS(IPAddress dns1, IPAddress dns2 = INADDR_ANY);