This document describes python API's provided for control interface. Please refer test.py to get an idea how to use these API's.
This is used to retrieve the MAC address of ESP's station or softAP interface
mode
:- 1: station
- 2: softAP
String in form of "XX:XX:XX:XX:XX:XX" with MAC address of ESP interface mapping to mode or "failure" string if failed.
This is used to retrieve the ESP32's Wi-Fi mode
- 0: null Mode, Wi-Fi mode not set
- 1: station mode
- 2: softAP mode
- 3: station+softAP mode
- "failure" string: if failed.
This is used to set the ESP32's Wi-Fi mode
mode
:- 0: null Mode, Wi-Fi mode not set
- 1: station mode
- 2: softAP mode
- 3: station+softAP mode
"success" or "failure" string
This is used to set MAC address for ESP's station or softAP interface
mode
:- 1: station mode
- 2: softAP mode
mac
: string in form of "XX:XX:XX:XX:XX:XX"
"success" or "failure" string
- First set wifi mode before setting MAC address for respective station and softAP Interface
- ESP32 station and softAP have different MAC addresses, do not set them to be the same.
- The bit 0 of the first byte of ESP32 MAC address can not be 1. For example, the MAC address can set to be "1a:XX:XX:XX:XX:XX", but can not be "15:XX:XX:XX:XX:XX".
- MAC address will get reset after esp restarts
Set ESP32's power save mode
power_save_mode
:- 1: WIFI_PS_MIN_MODEM Minimum modem power saving. In this mode, station wakes up to receive beacon every DTIM period.
- 2: WIFI_PS_MAX_MODEM Maximum modem power saving. In this mode, interval to receive beacons is determined by the listen_interval parameter in wifi set ap config function
"success" or "failure" string
- ESP32 on boot is configured in WIFI_PS_MIN_MODEM
Get the power save mode of ESP32
- 1: WIFI_PS_MIN_MODEM Minimum modem power saving. In this mode, station wakes up to receive beacon every DTIM period.
- 2: WIFI_PS_MAX_MODEM Maximum modem power saving. In this mode, interval to receive beacons is determined by the listen_interval parameter in wifi set ap config function
ESP32 on boot is configured in WIFI_PS_MIN_MODEM
Set the AP config to which ESP32 station should connect
ssid
: string parameter, ssid of AP, max 32 bytespwd
: string parameter, length of password should be 8~64 bytes ASCIIbssid
: MAC address of AP, To differentiate between APs, In case multiple AP has same ssidis_wpa3_supported
: Status of WPA3 supplicant present on AP- False : Unsupported
- True : Supported
listen_interval
: Listen interval for ESP32 station to receive beacon when WIFI_PS_MAX_MODEM is set. Units: AP beacon intervals. Defaults to 3 if set to 0.
"success" or "failure" string
Get the AP config to which ESP32 station is connected
Successful case : tuple of (ssid,bssid,channel,rssi,encryption_mode)
ssid
: SSID of connected APbssid
: MAC address of connected APchannel
: Channel ID, 1 ~ 10rssi
: RSSI signal strengthencryption_mode
:- 0 : OPEN
- 1 : WEP
- 2 : WPA_PSK
- 3 : WPA2_PSK
- 4 : WPA_WPA2_PSK
- 5 : WPA2_ENTERPRISE
- 6 : WPA3_PSK
- 7 : WPA2_WPA3_PSK
Failure cases
- "not_connected" : In case ESP32 is not connected to any AP
- "failure" string: In case of transport failure
Disconnect the AP to which ESP32 station is connected
"success" or "failure" string
Set the AP config to which ESP32 station should connect
Successful case : List of Aplist class instances(ssid,chnl,rssi,bssid,ecn)
ssid
: SSID of APchannel
: Channel ID, in range of 1 to 10bssid
: MAC address of APrssi
: RSSI signal strengthencryption_mode
:- 0 : OPEN
- 1 : WEP
- 2 : WPA_PSK
- 3 : WPA2_PSK
- 4 : WPA_WPA2_PSK
- 5 : WPA2_ENTERPRISE
- 6 : WPA3_PSK
- 7 : WPA2_WPA3_PSK
Failure case :
- "failure" string
Set the ESP32's softAP config
ssid
: String parameter, ssid of softAPpwd
: String parameter, length of password should be 8~64 bytes ASCIIchnl
: Channel ID, In range of 1 to 11ecn
: Encryption method- 0 : OPEN
- 2 : WPA_PSK
- 3 : WPA2_PSK
- 4 : WPA_WPA2_PSK
max_conn
: Maximum number of stations can connect to ESP32 softAP (should be in range of 1 to 10)ssid_hidden
: softAP should broadcast its SSID or not- 0 : SSID should broadcast
- 1 : SSID should not broadcast
bw
: set bandwidth of ESP32 softAP- 1 : WIFI_BW_HT20
- 2 : WIFI_BW_HT40
"success" or "failure" string
Get the ESP32's softAP config
Success case : returns (ssid,pwd,chnl,ecn,max_conn,ssid_hidden,bw)
ssid
: string parameter, ssid of softAPpwd
: string parameter, length of password should be 8~64 bytes ASCIIchnl
: channel ID, In range of 1 to 11ecn
: Encryption method- 0 : OPEN
- 2 : WPA_PSK
- 3 : WPA2_PSK
- 4 : WPA_WPA2_PSK
max_conn
: Maximum number of stations can connect to ESP32 softAP (will be in range of 1 to 10)ssid_hidden
: softAP should broadcast its SSID or not- 0 : SSID is broadcasted
- 1 : SSID is not broadcasted
bw
: bandwidth of ESP32 softAP- 1 : WIFI_BW_HT20
- 2 : WIFI_BW_HT40
Failure case :
- "failure" string
Stop the ESP32's softAP
"success" or "failure" string
Get the list of connected station to the ESP32 softAP.
success case : list of Stationlist tuple(mac,rssi) Stations credentials::
mac
: MAC address of stationrssi
: RSSI signal strength
failure case:
- "failure" string