NodeMCU
Lua:SDK 1.5.4.1上的5.1.4
问题:
我使用下面的代码,在我的家用路由器(华为和LG)上,连接的设备上没有列出NodeMCU。
DHCP的IP地址是正确的。我可以从同一网络中的其他PC ping到NodeMCU,但它没有显示在Routers Connected Devices列表中。
-----------------------------------------------
--- Set Variables ---
-----------------------------------------------
--- WIFI CONFIGURATION ---
WIFI_SSID = "ssidname"
WIFI_PASSWORD = "passwd"
--WIFI_SIGNAL_MODE = wifi.PHYMODE_N
--- IP CONFIG (Leave blank to use DHCP) ---
ESP8266_IP="0.0.0.0"
ESP8266_NETMASK="0.0.0.0"
ESP8266_GATEWAY="0.0.0.0"
-----------------------------------------------
--- Connect to the wifi network ---
wifi.setmode(wifi.STATION)
wifi.sta.setmac(wifi.sta.getmac())
wifi.sta.config(WIFI_SSID, WIFI_PASSWORD, 1)
wifi.sta.sethostname("MYNODE")
--if ESP8266_IP ~= "" then
-- wifi.sta.setip({ip=ESP8266_IP,netmask=ESP8266_NETMASK,gateway=ESP8266_GATEWAY})
--end
-----------------------------------------------
--- Check the IP Address ---
print(wifi.sta.getip())
print(wifi.sta.gethostname())