fix(sensing-server): detect ESP32 offline after 5s timeout#300
Merged
Conversation
The source field was set to "esp32" on the first UDP frame but never reverted when frames stopped arriving. This caused the UI to show "Real hardware connected" indefinitely after powering off all nodes. Changes: - Add last_esp32_frame timestamp to AppStateInner - Add effective_source() method with 5-second timeout - Source becomes "esp32:offline" when no frames received within 5s - Health endpoint shows "degraded" instead of "healthy" when offline - All 6 status/health/info API endpoints use effective_source() Fixes #297 Co-Authored-By: claude-flow <ruv@ruv.net>
This was referenced Mar 24, 2026
Open
Open
Help Ruvnet! Detection Window showing the same thing regardless of position and people in room.
#249
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
last_esp32_frametimestamp; after 5 seconds without a UDP frame, source changes from"esp32"to"esp32:offline""degraded"when ESP32 goes offlineeffective_source()Fixes #297
What was wrong
The
sourcefield was set to"esp32"on the first received UDP frame but never reverted. Powering off all ESP32 nodes left the UI permanently showing "Real hardware connected."Test plan
cargo check -p wifi-densepose-sensing-server --no-default-features— compiles clean/api/v1/healthshows"source": "esp32"/api/v1/healthshows"source": "esp32:offline", hardware status"degraded""esp32"immediately🤖 Generated with claude-flow