- Tue May 26, 2015 6:16 am
#18486
SDK 1.0.0 (and I assume all subsequent versions) have a function for changing softAP IP. I have no idea in what source file it can be found (I found a reference to it in the Arduino-esp8266 ESP8266WiFi.cpp), but here is how it is used:
Code: Select allstruct ip_info info;
info.ip.addr = static_cast<uint32_t>(local_ip);
info.gw.addr = static_cast<uint32_t>(gateway);
info.netmask.addr = static_cast<uint32_t>(subnet);
wifi_softap_dhcps_stop();
wifi_set_ip_info(SOFTAP_IF, &info);
wifi_softap_dhcps_start();
The key here is
wifi_set_ip_info(SOFTAP_IF, &info). It seems to work for me without any problems, although I've read somewhere (possibly the SDK) that it only executes if in user_init()