【发布时间】:2016-06-14 01:24:27
【问题描述】:
我需要 ESP8266 的网关地址。我得到了我的 esp8266 的 IP 地址、掩码和网关地址,但我只需要网关地址。
如何单独获取网关地址?
我在nodeMCU 固件中使用了wifi.sta.getip() 函数。
【问题讨论】:
-
感谢您的帮助
-
ip, netmask, gateway = wifi.sta.getip()
我需要 ESP8266 的网关地址。我得到了我的 esp8266 的 IP 地址、掩码和网关地址,但我只需要网关地址。
如何单独获取网关地址?
我在nodeMCU 固件中使用了wifi.sta.getip() 函数。
【问题讨论】:
ip, netmask, gateway = wifi.sta.getip()
相关文档加示例在http://nodemcu.readthedocs.org/en/dev/en/modules/wifi/#wifistagetip
ip, netmask, gateway = wifi.sta.getip()
print(gateway)
【讨论】: