EasyManua.ls Logo

Espressif Systems ESP - Page 149

Default Icon
191 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 4. Software framework
4.10.27 [Scan] What is the maximum number of APs that can be scanned
There is no limit to the maximum number of APs that can be scanned. The number depends on how
many APs are around and con󰝘gurations of the scanning parameters, such as the time spent on each
channel, the longer time spent on each channel the more likely it is to 󰝘nd all the APs.
4.10.28 [Scan] Can I choose to connect the best AP when there are multiple APs with
identical ssid/password during the scan
By default, the scan type is WIFI_FAST_SCAN, which makes the STA always connects the
󰝘rst AP during the scan. If you expect to connect the best AP, please set scan_method to
WIFI_ALL_CHANNEL_SCAN and con󰝘gure sort_method to determine whether to choose the AP
with the strongest RSSI or connect to the most secure AP.
4.10.29 [Scan] How to congure scan_method in the wi_sta_cong_t structure? What
is the dierence between all_channel_scan and fast_scan?
all_channel_scan and fast_scan are used to 󰝘nd the appropriate AP before connecting. The scan_method
is set to fast_scan by default, which is mainly used together with threshold to 󰝘lter APs with weak signal
or encryption.
When fast_scan is set, the STA will stop scanning once it 󰝘nds the 󰝘rst matched AP and then
connect to it, so as to save time for connection.
When all_channel_scan is set, the STA will scan all channels and store four APs with the best
signal or the most secure encryption according to the sorting method con󰝘gured in sort_method.
After the scan is completed, the STA will connect one of the four APs with the best signal or the
most secure encryption.
4.10.30 [LWIP] How to get error code of the socket?
For ESP-IDF v4.0 and later versions: use the value of errno directly to get the error code after the socket API
returns failure.
For previous versions of ESP-IDF v4.0: call getsockopt(sockfd, SOL_SOCKET, SO_ERROR, ) to get the
error code after the socket API returns failure, otherwise you may get wrong error code when multiple sockets
operate simultaneously.
4.10.31 [LWIP] What is the default keep-alive time of TCP?
By default, a TCP keep-alive message will be sent every 75 seconds for 9 times if no TCP message is
received for two consecutive hours. Then, if there is still no message received, the LWIP will disconnect
from the TCP.
The keep-alive time can be con󰝘gured via socket option.
Espressif Systems 132
Submit Document Feedback
Release master

Table of Contents