Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By TJF
#75172 Hi all
sometimes my ESP-03's use a DHCP address in spite of the fact that I set a fixed one in the config.
Here is what I do:

WiFi.mode(WIFI_STA);
delay(100);
if(!factory){
WiFi.config(ip, gateway, subnet);
delay(10);
}
WiFi.begin(ssid, pass);


(The delays are just for experimentation... )
I know, the examples show the "begin" before the "config". But what is the logic behind this?
I thought it is more logical to define the config BEFORE starting to connect to an AP.
Is that the Problem? Or what can be the reason for this intermittent use of a DHCP address instead of the configure fixed IP?
Thank you and
best regards
Thomas