karawin / Ka-Radio32

esp32 version of Ka-Radio (https://github.com/karawin/Ka-Radio) by jp Cocatrix
525 stars 155 forks source link

Choose the ssid with best rssi when connecting to the network #212

Closed menuet88 closed 3 years ago

menuet88 commented 3 years ago

I think this could be helpful if there are few networks with the same ssid but on different channels and rssi. For example when you walk with your radio around the house with few access points. Now the Ka-Radio32 trying to connect last connected ap even when the signal is very week.

So my suggestion is to change wifi_config in app_main.c at line 535 from:

wifi_config_t wifi_config = {
.sta = {
    .bssid_set = 0,
    },
};

to:

wifi_config_t wifi_config = {
.sta = {
    .bssid_set = 0,
    .scan_method = WIFI_ALL_CHANNEL_SCAN,
    .sort_method = WIFI_CONNECT_AP_BY_SIGNAL,
       },
};

Of course this will slow down the connecting procedure, but I think the 2 seconds doesn't do big difference.

Best regards, Menuet88

karawin commented 3 years ago

Ok, I will test it. Thanks

karawin commented 3 years ago

ok, in the next release.

menuet88 commented 3 years ago

Great, thank you for accepting this.