NodeMCU keeps IP address after switched off?
Posted: Fri Apr 08, 2016 3:52 am
Hi, I noticed a curious thing. When I disconnect my NodeMCU ESP12 development board from power and after a while connect it again, the ESP12 will connect to my WiFi network with the same IP without a single line of code executed. There is no init.lua file, so there is nothing to execute.
I do not need to execute wifi.setmode() and wifi.sta.config() commands, the network connection is up automatically, with the correct credentials. And the wifi.sta.status() function returns 5 (STATION_GOT_IP).
So, is this a new feature? Should I check if the network is active already before I issue a wifi.setmode() and wifi.sta.config() command?
The ESP device on my development board (from Doit) is an ESP-12E. I flashed it with nodeMCU:
I do not need to execute wifi.setmode() and wifi.sta.config() commands, the network connection is up automatically, with the correct credentials. And the wifi.sta.status() function returns 5 (STATION_GOT_IP).
So, is this a new feature? Should I check if the network is active already before I issue a wifi.setmode() and wifi.sta.config() command?
The ESP device on my development board (from Doit) is an ESP-12E. I flashed it with nodeMCU:
Code: Select all
NodeMCU custom build by frightanic.com
branch: master
commit: c8037568571edb5c568c2f8231e4f8ce0683b883
SSL: false
modules: bit,file,gpio,i2c,net,node,pwm,spi,tmr,uart,wifi
build built on: 2016-03-16 12:38
powered by Lua 5.1.4 on SDK 1.4.0