Chapter 4. API Guides
Station Basic Configuration
API esp_wifi_set_config() can be used to configure the station. The table below describes the fields in detail.
Field Description
ssid This is the SSID of the target AP, to which the station wants to connect to.
pass-
word
Password of the target AP.
scan_methodFor WIFI_FAST_SCAN scan, the scan ends when the first matched AP is found, for
WIFI_ALL_CHANNEL_SCAN, the scan finds all matched APs on all channels. The default scan
is WIFI_FAST_SCAN.
bssid_setIf bssid_set is 0, the station connects to the AP whose SSID is the same as the field “ssid”, while the
field “bssid”is ignored. In all other cases, the station connects to the AP whose SSID is the same as the
“ssid”field, while its BSSID is the same the “bssid”field .
bssid This is valid only when bssid_set is 1; see field “bssid_set”.
chan-
nel
If the channel is 0, the station scans the channel 1 ~ N to search for the target AP; otherwise, the station
starts by scanning the channel whose value is the same as that of the“channel”field, and then scans others
to find the target AP. If you do not know which channel the target AP is running on, set it to 0.
sort_methodThis field is only for WIFI_ALL_CHANNEL_SCAN
If the sort_method is WIFI_CONNECT_AP_BY_SIGNAL, all matched APs are sorted by signal, for AP
with best signal will be connected firstly. E.g. if the station want to connect AP whose ssid is “apxx”,
the scan finds two AP whose ssid equals to “apxx”, the first AP’s signal is -90 dBm, the second AP’s
signal is -30 dBm, the station connects the second AP firstly, it doesn’t connect the first one unless it fails
to connect the second one.
If the sort_method is WIFI_CONNECT_AP_BY_SECURITY, all matched APs are sorted by security.
E.g. if the station wants to connect AP whose ssid is“apxx”, the scan finds two AP whose ssid is“apxx”
, the security of the first found AP is open while the second one is WPA2, the stations connects to the
second AP firstly, it doesn’t connect the second one unless it fails to connect the first one.
thresh-
old
The threshold is used to filter the found AP, if the RSSI or security mode is less than the configured
threshold, the AP will be discard.
If the RSSI set to 0, it means default threshold, the default RSSI threshold is -127 dBm. If the authmode
threshold is set to 0, it means default threshold, the default authmode threshold is open.
Attention: WEP/WPA security modes are deprecated in IEEE 802.11-2016 specifications and are recom-
mended not to be used. These modes can be rejected using authmode threshold by setting threshold as WPA2 by
threshold.authmode as WIFI_AUTH_WPA2_PSK.
AP Basic Configuration
API esp_wifi_set_config() can be used to configure the AP. The table below describes the fields in detail.
Espressif Systems 1533
Submit Document Feedback
Release v4.4