class documentation
Class to manage WiFi functionality on a MicroPython device.
| Method | __init__ |
Initialize the WiFiUART instance. |
| Method | connect |
Connect to a Wi-Fi network. |
| Method | connect |
Initiate an asynchronous connection to a Wi-Fi network. |
| Method | disconnect |
Disconnect from the current Wi-Fi network. |
| Method | is |
Check if the device is currently connected to a Wi-Fi network. |
| Method | ping |
Check for pong response |
| Method | reset |
Reset the Wi-Fi module. |
| Method | scan |
Scan for available Wi-Fi networks. |
| Method | status |
Get the current Wi-Fi status. |
| Instance Variable | error |
The last error message encountered during WiFi operations. |
| Instance Variable | timeout |
The timeout for UART receiving |
| Instance Variable | uart |
The UART object for communication with the WiFi module. |
| Property | device |
Get the current device IP address. |
| Property | last |
Get the last error message encountered during WiFi operations. |
| Property | mac |
Get the current device MAC address. |
| Property | state |
Get the current WiFi state. |
| Method | __send |
Send a command to the UART and wait for a response. |
Initialize the WiFiUART instance.
| Parameters | |
| uart | The UART object for communication with the WiFi module. |
timeoutint | The timeout for UART receiving in milliseconds. Defaults to 5000. |
Connect to a Wi-Fi network.
| Parameters | |
ssid:str | SSID of the Wi-Fi network. |
password:str | Password for the Wi-Fi network. Defaults to "". |
stabool | True for station mode (STA_IF), False for access point mode (AP_IF). Defaults to True. |
| Returns | |
bool | True if the connection succeeded, False otherwise. |
Initiate an asynchronous connection to a Wi-Fi network.
| Parameters | |
ssid:str | SSID of the Wi-Fi network. |
password:str | Password for the Wi-Fi network. Defaults to "". |
stabool | True for station mode (STA_IF), False for access point mode (AP_IF). Defaults to True. |
| Returns | |
bool | True if the command to initiate the connection was sent successfully, False otherwise. |
Check if the device is currently connected to a Wi-Fi network.
| Returns | |
bool | True if connected, False otherwise. |
Get the current Wi-Fi status.
| Returns | |
int | The current Wi-Fi status as one of the WIFI_STATE_* constants. |