wifiCfg

Use the API in the wifiCfg module to configure the device WiFi connection.

import wifiCfg

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

//Connect to the specified WiFi
wifiCfg.doConnect(ssid, pwd)

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

//WiFi reconnect
wifiCfg.reconnect()

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