wifiCfg

Use the API in the wifiCfg module to configure the device Wi-Fi connection.

import wifiCfg

//Automatically connect to the saved Wi-Fi, the screen displays the connection UI
wifiCfg.autoConnect(lcdShow=True)

//Connect to the specified Wi-Fi
wifiCfg.doConnect(ssid, pwd)

//Connect to the specified Wi-Fi and specify the connection timeout period
wifiCfg.connect(ssid, pwd, timeout, block=False)

//Wi-Fi reconnect
wifiCfg.reconnect()

//Is it connected
print(wifiCfg.wlan_sta.isconnected())
On This Page