ESP-8266 WiFi.config(ip, gateway, subnet);

I am testing the HelloServer that came with the ESP-8266 package.

With the original file, I get an [IP Address:] and everything appears to work.

hello from esp8266!

When I add [WiFi.config(ip, gateway, subnet);] before or after [Wifi.Begin(ssid, password);]

The message states [IP Address:] but it does not connect:

This site can’t be reached took too long to respond.

Anybody seen this type of behavior ?


Mine always go (unless perhaps you connected to two different routers?)

Seems weird you'd have 2 vastly different IPs for the same device. Only thing I'd think would change would be the last segment '.50'.

But if that is what your router is saying in the Client List?


WiFi.config() allows you to configure a static IP address as well as change the DNS, gateway, and subnet addresses on the WiFi shield.

Unlike WiFi.begin() which automatically configures the WiFi shield to use DHCP, WiFi.config() allows you to manually set the network address of the shield.

Calling WiFi.config() before WiFi.begin() forces begin() to configure the WiFi shield with the network addresses specified in config().

You can call WiFi.config() after WiFi.begin(), but the shield will initialize with begin() in the default DHCP mode. Once the config() method is called, it will change the network address as requested.

There seems to be something else going on, as the static IP does not work to talk with the ESP-8266.