From 18c36a13529801d6ace018d759d02fd6ddb8ac80 Mon Sep 17 00:00:00 2001 From: "Deomid \"rojer\" Ryabkov" Date: Sun, 5 Dec 2021 01:38:04 +0000 Subject: [PATCH] Fix roaming RSSI check We shouldn't be checking new AP against the roaming threshold, it's sufficient if it's significantly better than our current AP. As reported by the user" ``` Best AP is not much better (RSSI -85 vs -96) ``` We should defintiely hop over to -85 when we are at -96 currently. --- src/mgos_wifi_sta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mgos_wifi_sta.c b/src/mgos_wifi_sta.c index d91a348..d3c5825 100644 --- a/src/mgos_wifi_sta.c +++ b/src/mgos_wifi_sta.c @@ -556,8 +556,7 @@ static void mgos_wifi_sta_run(int wifi_ev, void *ev_data, bool timeout) { } else if (s_cur_entry != NULL && memcmp(s_cur_entry->bssid, ape->bssid, sizeof(ape->bssid)) == 0) { LOG(LL_INFO, ("Current AP is best AP")); - } else if (ape->rssi <= mgos_sys_config_get_wifi_sta_roam_rssi_thr() || - (ape->rssi - MGOS_WIFI_STA_ROAM_RSSI_HYST) < cur_rssi) { + } else if (ape->rssi - MGOS_WIFI_STA_ROAM_RSSI_HYST < cur_rssi) { LOG(LL_INFO, ("Best AP is not much better (RSSI %d vs %d)", ape->rssi, cur_rssi)); } else {