From fb98ce800a175f0b8052b4e888de87d6a9c29e40 Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Thu, 4 Dec 2025 21:51:16 +0100 Subject: [PATCH] Add network speed check for future use --- firmware/esp32/main/wifi.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/firmware/esp32/main/wifi.cpp b/firmware/esp32/main/wifi.cpp index d9e8aa6..5e7c5f5 100644 --- a/firmware/esp32/main/wifi.cpp +++ b/firmware/esp32/main/wifi.cpp @@ -8,7 +8,7 @@ #include "main.hpp" #include "wifi-credentials.h" -#define WIFI_TIMEOUT_MS 4500 +#define WIFI_TIMEOUT_MS 1500 static const char* TAG = "WIFI"; @@ -77,6 +77,13 @@ void wifiTask(void *pvParameters) { ESP_ERROR_CHECK(esp_task_wdt_add(NULL)); for(;;) { + wifi_ap_record_t ap; + if (esp_wifi_sta_get_ap_info(&ap) == ESP_OK) { + ESP_LOGV(TAG, "RSSI: %d", ap.rssi); + } + + //TODO: manage data send rate if with slow network + ESP_ERROR_CHECK(esp_task_wdt_reset()); ESP_LOGV(TAG, "Task reset"); vTaskDelay(pdMS_TO_TICKS(WIFI_TIMEOUT_MS));