esp32-c6 does not connected to strongest ssid in Multi AP environment

grooves
Posts: 16
Joined: Fri Aug 25, 2017 2:51 pm

esp32-c6 does not connected to strongest ssid in Multi AP environment

Postby grooves » Wed May 14, 2025 12:57 pm

Hi folk,

I have a strange problem to connect to ssid with strongest rssi when the same ssid is visible with different rssi's or/and different channels, like this:

I (3170) scan: SSID MY Wifi
I (3170) scan: RSSI -67
I (3180) scan: BSSID 84:39:8f:fe:86:db
I (3180) scan: Authmode WIFI_AUTH_WPA2_PSK
I (3180) scan: Pairwise Cipher WIFI_CIPHER_TYPE_CCMP
I (3190) scan: Group Cipher WIFI_CIPHER_TYPE_CCMP
I (3190) scan: Channel 11

I (3270) scan: SSID MY Wifi
I (3270) scan: RSSI -77
I (3280) scan: BSSID 84:39:8f:32:cc:9b
I (3280) scan: Authmode WIFI_AUTH_WPA2_PSK
I (3280) scan: Pairwise Cipher WIFI_CIPHER_TYPE_CCMP
I (3290) scan: Group Cipher WIFI_CIPHER_TYPE_CCMP
I (3290) scan: Channel 6

I (3540) scan: SSID MY Wifi
I (3550) scan: RSSI -79
I (3550) scan: BSSID 84:39:8f:fa:ae:bb
I (3550) scan: Authmode WIFI_AUTH_WPA2_PSK
I (3560) scan: Pairwise Cipher WIFI_CIPHER_TYPE_CCMP
I (3560) scan: Group Cipher WIFI_CIPHER_TYPE_CCMP
I (3570) scan: Channel 11

via forced bssid_set = 1 and given bssid I can connect always to 84:39:8f:32:cc:9b and 84:39:8f:fa:ae:bb,
but never to 84:39:8f:fe:86:db, which is the strongest AP.
I use simple esp-idf example: wifi getting_started station, modified with bssid stuff.

I get error reason: 2 toggling with 205, extend log shows something wrong with authorization

I (52214) wifi:(connect)dot11_authmode:0x3, pairwise_cipher:0x3, group_cipher:0x3
I (52214) wifi:state: init -> auth (0xb0)
I (53224) wifi:state: auth -> init (0x200)
I (53234) wifi:new:<11,0>, old:<11,0>, ap:<255,255>, sta:<11,0>, prof:1, snd_ch_cfg:0x0

any hints ?

Thanks,
Mike

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: esp32-c6 does not connected to strongest ssid in Multi AP environment

Postby nopnop2002 » Fri May 16, 2025 3:07 am

What happens if you change ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD to something other than WIFI_AUTH_WPA2_PSK?
You can change this in menuconfig.

Code: Select all

#if CONFIG_ESP_WIFI_AUTH_OPEN
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_OPEN
#elif CONFIG_ESP_WIFI_AUTH_WEP
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WEP
#elif CONFIG_ESP_WIFI_AUTH_WPA_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA_PSK
#elif CONFIG_ESP_WIFI_AUTH_WPA2_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA2_PSK
#elif CONFIG_ESP_WIFI_AUTH_WPA_WPA2_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA_WPA2_PSK
#elif CONFIG_ESP_WIFI_AUTH_WPA3_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA3_PSK
#elif CONFIG_ESP_WIFI_AUTH_WPA2_WPA3_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA2_WPA3_PSK
#elif CONFIG_ESP_WIFI_AUTH_WAPI_PSK
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WAPI_PSK
#endif

grooves
Posts: 16
Joined: Fri Aug 25, 2017 2:51 pm

Re: esp32-c6 does not connected to strongest ssid in Multi AP environment

Postby grooves » Mon May 19, 2025 9:57 am

Hello,

I tried all combinations,
no changes :(

Regards,
Mike

grooves
Posts: 16
Joined: Fri Aug 25, 2017 2:51 pm

Re: esp32-c6 does not connected to strongest ssid in Multi AP environment

Postby grooves » Mon May 19, 2025 2:21 pm

I disabled password at AP,
and set wifi_config to:

wifi_config_t wifi_config = {
.sta = {
.ssid = "MY Wifi",
.password = "",
.threshold.authmode = WIFI_AUTH_OPEN,
.bssid_set = 0,
},
};

get the same error:

wifi:new:<6,0>, old:<9,0>, ap:<255,255>, sta:<6,0>, prof:1, snd_ch_cfg:0x0
I (59210) wifi:state: init -> auth (0xb0)
I (60230) wifi:state: auth -> init (0x200)
I (60240) wifi:new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1, snd_ch_cfg:0x0
I (60240) wifi station: WIFI_EVENT_STA_DISCONNECTED: reason: 2

pretty weird, because there is no authorization anymore

Cheers,
Mike

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: esp32-c6 does not connected to strongest ssid in Multi AP environment

Postby nopnop2002 » Mon May 19, 2025 10:41 pm

What happens if You turn off these two WiFi routers?


I (3180) scan: BSSID 84:39:8f:fe:86:db

I (3280) scan: BSSID 84:39:8f:32:cc:9b

If multiple WiFi routers are transmitting signals in a small space, interference can occur.

I have three Wi-Fi routers in my room, each with a different SSID.
When I add a fourth one with a different SSID it is not recognized.

grooves
Posts: 16
Joined: Fri Aug 25, 2017 2:51 pm

Re: esp32-c6 does not connected to strongest ssid in Multi AP environment

Postby grooves » Tue May 20, 2025 12:00 pm

the APs are not under our control, it is an external IT company,

but I could fix it by adding one line before esp wifi start:

...
ESP_ERROR_CHECK(esp_wifi_config_11b_rate(WIFI_IF_STA, true));
ESP_ERROR_CHECK(esp_wifi_start());
...

my theorie is:
APs do not support old 11B protocol anymore, but ESP32 starts with it and wants to negociate password in that mode.

the line above disables 11B protocol in ESP32, and connection starts immediatly

Cheers,
Mike

Who is online

Users browsing this forum: Amazon [Bot], Baidu [Spider], ChatGPT-User, PerplexityBot, PetalBot, Qwantbot and 7 guests