接上一篇帖子
【一起玩esp8266】固件升级成功 - 【MicroPython开源版块】 - 电子工程世界-论坛
https://bbs.eeworld.com.cn/thread-498161-1-1.html
很快两个月了,今天参考【新提醒】
【一起玩ESP8266】修改网络参数解决reconnect问题 - 【MicroPython开源版块】 - 电子工程世界-论坛
https://bbs.eeworld.com.cn/thread-502102-1-1.html
救起了我的py,感谢作者。串口打开一直输出如下信息
CTRL+C中断,右键粘贴,回车执行,一气呵成,毫不墨迹
活了,可以输入了
程序见下,
- import network
- wlan = network.WLAN(network.STA_IF) # create station interface
- wlan.active(True) # activate the interface
- wlan.scan() # scan for access points
- wlan.isconnected() # check if the station is connected to an AP
- wlan.connect('SSID', 'password') # connect to an AP
- wlan.config('mac') # get the interface's MAC adddress
- wlan.ifconfig() # get the interface's IP/netmask/gw/DNS addresses
- ap = network.WLAN(network.AP_IF) # create access-point interface
- ap.active(True) # activate the interface
- ap.config(essid='ESP-AP') # set the ESSID of the access point