mirror of
https://github.com/meshtastic/firmware.git
synced 2026-11-06 22:34:13 -05:00
CommandSensor ran its commands from getMetrics(), on the main loop that also drives the radio. Each expired sensor could stall the loop for up to its 2 s timeout, and on Windows, where popen() has no timeout, a command that never exits froze the node. - A worker thread re-runs each command every 30 s and stores the result. getMetrics() only reads the latest results under a mutex, so it never waits on a command. - The worker never calls LOG_* (portduino's log buffer is not thread-safe). It records why a read failed, and getMetrics() logs each new result on the main thread, as NativeDiscovery does. - execCommand() returns an ExecResult instead of logging. exec() logs timeouts and start failures for its main-thread callers (HostMetrics). - The sensor copies its config at init and joins the worker on destruction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011C7D9dE4aUYBrGdpPyHs25