openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601, BL602 and LN882H
https://openbekeniot.github.io/webapp/devicesList.html
1.5k stars 281 forks source link

Fix missing WiFi quality/rssi for ln882h #1090

Closed MaxineMuster closed 9 months ago

MaxineMuster commented 9 months ago

Describe the bug At the moment, rssi is not implemented for LN882H, so GUI for LN882H always shows Wifi RSSI: Excellent (0dBm) No_rssi

Patch I suggest this patch to show the rssi: with_rssi


diff --git a/src/hal/ln882h/hal_wifi_ln882h.c b/src/hal/ln882h/hal_wifi_ln882h.c
index 0bee18f0..d44d32f6 100644
--- a/src/hal/ln882h/hal_wifi_ln882h.c
+++ b/src/hal/ln882h/hal_wifi_ln882h.c
@@ -131,7 +131,9 @@ void HAL_PrintNetworkInfo()
 int HAL_GetWifiStrength()
 {
     alert_log("HAL_GetWifiStrength");
-       return 0;
+    int8_t val;
+    wifi_sta_get_rssi(&val);
+    return val;
 }

 void HAL_WiFi_SetupStatusCallback(void (*cb)(int code))
openshwprojects commented 9 months ago

Thank you, added.