-
Notifications
You must be signed in to change notification settings - Fork 8
do not reboot during health check #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -783,11 +783,11 @@ void wifi_health_check(void) { | |
|
||
// WiFi is not connected, increment counter | ||
s_wifi_disconnect_counter++; | ||
ESP_LOGW(TAG, "WiFi Health check. Disconnect count: %d/15", s_wifi_disconnect_counter); | ||
ESP_LOGW(TAG, "WiFi Health check. Disconnect count: %d/*", s_wifi_disconnect_counter); | ||
|
||
// Try to reconnect | ||
if (strlen(s_wifi_ssid) > 0) { | ||
ESP_LOGI(TAG, "Attempting to reconnect to WiFi..."); | ||
ESP_LOGI(TAG, "Reconnecting in Health check..."); | ||
esp_err_t err = esp_wifi_connect(); | ||
if (err != ESP_OK) { | ||
ESP_LOGW(TAG, "WiFi reconnect attempt failed: %s", esp_err_to_name(err)); | ||
|
@@ -797,10 +797,10 @@ void wifi_health_check(void) { | |
} | ||
|
||
// If counter reaches threshold, reboot the system | ||
if (s_wifi_disconnect_counter >= 15) { | ||
ESP_LOGE(TAG, "WiFi disconnected for 15 consecutive checks. Rebooting system..."); | ||
// Wait a moment before rebooting | ||
vTaskDelay(pdMS_TO_TICKS(1000)); | ||
esp_restart(); | ||
} | ||
// if (s_wifi_disconnect_counter >= 15) { | ||
// ESP_LOGE(TAG, "WiFi disconnected for 15 consecutive checks. Rebooting system..."); | ||
// // Wait a moment before rebooting | ||
// vTaskDelay(pdMS_TO_TICKS(1000)); | ||
// esp_restart(); | ||
// } | ||
Comment on lines
+800
to
+805
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block of code, which handles system reboot after repeated WiFi disconnections, has been commented out. If the decision to remove this reboot functionality is permanent (as implied by the PR title "do not reboot during health check"), it's recommended to delete this commented-out code. Leaving dead code can reduce readability and long-term maintainability. If there's a possibility this feature might be re-enabled in the future, consider using a compile-time configuration (e.g., a Kconfig option) or a runtime flag instead of commented-out code for better control and clarity. |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log message format
Disconnect count: %d/*
is a bit unconventional and might be unclear to others reading the logs. The/*
seems to indicate that the previous threshold (e.g.,/15
) for rebooting is no longer applicable. It would be more explicit to either remove this part or clarify the meaning for better log readability.