Skip to content

RSDK-14617 surface the machine's active WiFi SSID in agent logs - #298

Merged
Cheuk (cheukt) merged 2 commits into
mainfrom
claude/RSDK-14617/log-active-ssid
Sep 25, 2026
Merged

Cheuk (cheukt) merged 2 commits into
mainfrom
claude/RSDK-14617/log-active-ssid

Conversation

@viambot

@viambot viambot commented Sep 23, 2026

Copy link
Copy Markdown
Member

What

Surfaces the machine's active WiFi SSID in the agent logs: logged immediately when it changes, and at least every 5 minutes otherwise.

Why

viam-agent already tracks the active SSID live — backgroundLoop calls checkConnections() every ~15s and updates activeSSID — but the value was never written to the logs, so there was no way to reconstruct which network a machine was on from its log history.

How

  • New Subsystem.logActiveSSID() reads netState.ActiveSSID() for the managed wifi interface (HotspotInterface, the only device the agent actively manages) and logs activeSSID + interface. It skips the log only when the SSID is unchanged and the last log was less than activeSSIDLogInterval (5 minutes) ago, so changes are reported on the next background tick and steady state is reported every 5 minutes.
  • Called from backgroundLoop right after checkConnections(), so it observes the freshly refreshed state. The two tracking fields are written exclusively from that goroutine, matching the existing bleLoop field convention, so no extra locking is needed.
  • Uses the existing n.logger, which is already the viam-agent.networking sublogger, so these lines stay hidden unless internal logs are toggled on.
  • An empty activeSSID is logged as-is and means the managed wifi interface isn't connected to anything.

Example line:

active wifi network  {"activeSSID":"TestNetwork","interface":"wlan0"}

Testing

  • Added TestLogActiveSSID covering the initial (disconnected) log, silence while unchanged, immediate log on change, that other interfaces are ignored, re-logging once the interval elapses, and logging a disconnect.
  • go test -race ./... passes. The only failure is the pre-existing utils.TestInitPaths/failure_cannot_create_directory, which fails in this sandbox because it runs as root and so the chmod 0500 the test relies on doesn't block mkdir; it is unrelated to this change.

Key: RSDK-14617

Co-authored by Claude agent for Jira.

backgroundLoop already refreshes activeSSID every ~15s via checkConnections,
but the value was never surfaced. Log it on every change and at least every
5 minutes otherwise, through the existing viam-agent.networking sublogger so
it stays with the rest of the diagnostic networking logs.
@10zingpd
10zingpd requested review from a team and Cheuk (cheukt) and removed request for a team September 23, 2026 20:36
@cheukt Cheuk (cheukt) added the dev-release Build and publish agent binaries with a dev version label Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

@nandini-swami nandini-swami left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cheukt
Cheuk (cheukt) merged commit be45b9f into main Sep 25, 2026
7 checks passed
@cheukt
Cheuk (cheukt) deleted the claude/RSDK-14617/log-active-ssid branch September 25, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-release Build and publish agent binaries with a dev version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants