Micropython学习交流群 学习QQ群:786510434 提供多种固件下载和学习交流。
Micropython-扇贝物联 QQ群:31324057 扇贝物联是一个让你与智能设备沟通更方便的物联网云平台
Micropython学习交流群 学习QQ群:468985481 学习交流ESP8266、ESP32、ESP8285、wifi模块开发交流、物联网。
Micropython老哥俩的IT农场分享QQ群:929132891 为喜欢科创制作的小白们分享一些自制的计算机软硬件免费公益课程,由两位多年从事IT研发的中年大叔发起。
boot.py
import time import machine import micropython import network import esp esp.osdebug(None) import gc gc.collect() machine.freq(80000000) # imposto la frequenza della CPU a 80MHz, la più bassa reduce_WiFi_power = True # if LOLIN C3 Mini is used ssid = ['SSID1', 'NBWIFI', 'SSID3'] # add more if you want password = ['PASS1', 'z7758521', 'PASS3'] # add more if you want rosso = machine.Pin(12, machine.Pin.OUT) station = network.WLAN(network.STA_IF) station.active(True) station.config(txpower=8.5) connesso = False count2 = 0 connected_ssid = None connected_pw = None while not connesso: if count2 > 0: rosso.value(1) for w in range(len(ssid)): if not connesso: station.disconnect() station.connect(ssid[w], password[w]) print(ssid[w]) print(password[w]) count = 0 while not station.isconnected(): count = count + 1 if count>50: break time.sleep(.1) if station.isconnected(): connected_ssid = ssid[w] connected_pw = password[w] connesso = True rosso.value(0) break count2 = count2 + 1 print('\n连接成功"' + connected_ssid + '" with IP address',station.ifconfig()[0],'\n') station.active(False) time.sleep(0.1)
Copyright © 2014 ESP56.com All Rights Reserved
执行时间: 0.0082709789276123 seconds