Skip to content

Usb log tools - #3061

Merged
kareltucek merged 2 commits into
masterfrom
usb-log-tools
Oct 8, 2026
Merged

kareltucek merged 2 commits into
masterfrom
usb-log-tools

Conversation

@kareltucek

@kareltucek kareltucek commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Add a script to connect to uhk shell via usb.

kareltucek and others added 2 commits October 1, 2026 10:56
Streams the firmware log to stdout and sends each line of stdin to the device shell, so it
serves both as a log follower and as a console. --exit-on-idle makes it usable from scripts:
send a command, collect its output, exit once the log goes quiet.

The log comes from GetVariable/UsbVariable_ShellBuffer and commands go out as
ExecShellCommand; all device access is serialised through the single poll loop, since stdin
arrives asynchronously. Replaces an unreliable local log.sh, which polled
UsbVariable_StatusBuffer (the macro status buffer) rather than the shell buffer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N5oDHHomxRbhs7jTqA9rgW
Colour is kept when stdout is a terminal and stripped otherwise, overridable with
--color/--no-color. Stripping carries an incomplete escape sequence across reads, since a
sequence can straddle the 62-byte chunk boundary.

Commands now carry their own trailing newline. ShellUartTransport_InjectInput only appends
the submitting newline when the device's StripVt100 flag happens to be set, so without it
the command is echoed but never executed; sending our own works in either mode.

Verified against a UHK 80 right half over USB: log streaming, command execution and clean
--exit-on-idle shutdown all work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N5oDHHomxRbhs7jTqA9rgW
@kareltucek
kareltucek merged commit 0048716 into master Oct 8, 2026
6 checks passed
@kareltucek
kareltucek deleted the usb-log-tools branch October 8, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant