tayfunulu / WiFiManager

WiFi manager for ESP8266 - ESP12 - ESP32 - micropython
MIT License
352 stars 105 forks source link

A Big Error #35

Open ywz978020607 opened 1 year ago

ywz978020607 commented 1 year ago

Don't you test on esp8266? """ def do_connect(ssid, password): wlan_sta.active(True) if wlan_sta.isconnected(): return *True** # not None!!!!!

ywz978020607 commented 1 year ago

最终整理版(可以scan或手动输入均可):History_mpy/Micropython_esp32_8266/mpy_01s_8266_32_手动配网 at master · ywz978020607/History_mpy

ebolisa commented 1 year ago

I believe "None" is used to force the code to go into AP. I've been wrong in the past so...

import wifimgr

wlan = wifimgr.get_connection()

if wlan is None: # <=========

    print("Could not initialize the network connection.")
    while True:
        pass  # you shall not pass :D

# Main Code goes here, wlan is a working network.WLAN(STA_IF) instance.
print("ESP OK")