本站改版新增arduino频道
WIFI热点网络创建
import network
ap = network.WLAN(network.AP_IF) # 指定用ap模式
ap.active(True) # 启用wifi前需要先激活接口
ap.config(essid="EUROPA-AP") # 设置热点名称
ap.config(authmode=3, password='1234567890') # 设置认证模式与密码
方法2:
import network
sta_if = network.WLAN(network.STA_IF)
sta_if.active(False)
ap_if = network.WLAN(network.AP_IF)
ap_if.active(True)
ap_if.ifconfig((SERVER_IP, SERVER_SUBNET, SERVER_IP, SERVER_IP))
ap_if.config(essid=SERVER_SSID, authmode=network.AUTH_OPEN)
print('AP active on {}'.format(ap_if.ifconfig()))
Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号
执行时间: 0.0095629692077637 seconds