def connect():
ap_if = network.WLAN(network.AP_IF)
ap_if.active(True)
if config.USE_AP:
sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
print('connecting to network...')
start_time = time.time()
sta_if.connect(config.SSID, config.PASSWORD)
while not sta_if.isconnected() and time.time() - start_time < 3.0:
pass
print('network config:', sta_if.ifconfig())
print('AP network config:', ap_if.ifconfig())
评论列表
文章目录