Current Lua downloadable firmware will be posted here

User avatar
By MaxItaly
#64581 Hello,
i'm build a simple AP with NODEMCU 2.0.0, work fine but i've 2 questions:
1 - according to the documentation of wifi.setmode(), the ip is 192.168.4.1 with SOFTAP; to change this the wifi.ap.setip() must executed before or after the wifi.setmode() ?
2 - after a power on the wifi load the configuration with wifi.getdefaultmode(); it's possible to disable this function and set the wifi only with wifi.setmode() ?
Thanks,
Max
User avatar
By marcelstoer
#64611
MaxItaly wrote:1 - according to the documentation of wifi.setmode(), the ip is 192.168.4.1 with SOFTAP; to change this the wifi.ap.setip() must executed before or after the wifi.setmode() ?


You always set the mode first.

MaxItaly wrote:2 - after a power on the wifi load the configuration with wifi.getdefaultmode(); it's possible to disable this function and set the wifi only with wifi.setmode() ?


https://nodemcu.readthedocs.io/en/lates ... ifisetmode says

WiFi configuration will be retained until changed even if device is turned off.


This means that you only need to call wifi.setmode() et.al. once. So, in theory it doesn't even need to be part of init.lua.