@h2loop/oscilloscope
v0.1.0
Published
Hydron plugin: drive any SCPI oscilloscope over LAN (Tektronix/Keysight/Rigol/generic) — discover, configure, measure, capture waveforms and screenshots.
Readme
@h2loop/oscilloscope
A Hydron plugin. Test it locally:
hydron plugin validate .
hydron plugin add . --local # registers in the gitignored .hydron/plugins.local.jsonSkills
scpi-oscilloscope
Drives any SCPI oscilloscope over the LAN — discover, connect, configure
channels / acquisition / trigger, run-stop-single, measure, capture waveforms
and screenshots — through per-vendor profiles (tek / keysight / rigol /
generic) auto-detected from *IDN?.
skills/scpi-oscilloscope/
├── SKILL.md # skill entry point (frontmatter + overview)
├── requirements.txt # Python deps (tm_devices, PyVISA, pyvisa-py)
├── scope_screenshot.png # bench-unit reference capture
├── tools/ # scope_cli.py + session/profile/config/discover
│ └── scope_tools.schema.json
├── reference/ # scpi-core · measurements-and-capture · cli
└── diagnostics/ # bring-up probes, fake scope server, selftestOne-time host setup (Python 3, Windows / macOS / Linux):
python3 -m pip install -r skills/scpi-oscilloscope/requirements.txtConnection settings are never hardcoded — flags → SCOPE_* env → persisted
config → prompt, written only after the scope answers *IDN?.
S=skills/scpi-oscilloscope
python3 $S/tools/scope_cli.py discover # list SCPI instruments
python3 $S/tools/scope_cli.py setup --ip 192.168.1.10 # test + persist (+ profile)
python3 $S/tools/scope_cli.py status # read-only snapshot
python3 $S/tools/scope_cli.py batch --ops '[{"tool":"measure","args":{"type":"PK2PK","source":"CH1"}}]'Every invocation prints one JSON object (status, error_code, tool,
result, esr); exit 0 = ok, 1 = error. Prompts/progress go to stderr;
tm_devices may log to stdout ahead of the JSON — parse from the first {.
For any task with more than ~2 scope operations, use batch — one socket
connection for the whole sequence. Full docs: skills/scpi-oscilloscope/SKILL.md.
No scope on hand? python3 skills/scpi-oscilloscope/diagnostics/selftest.py
spins up a loopback fake scope and exercises the whole CLI/contract surface
(exit 0 = good) — the same check CI should run.
Layout
.
├── .hydron-plugin/plugin.json # manifest: engines.hydron range
├── .github/workflows/publish.yml# publishes to npm on every push to main
├── skills/scpi-oscilloscope/ # the scpi-oscilloscope skill (see above)
├── package.json # npm metadata + files allowlist
├── .npmignore
└── README.mdPublishing
Every push to main publishes automatically (.github/workflows/publish.yml)
once an NPM_TOKEN Actions secret is set — see the workflow file for details.
Versioning is commit-driven (Conventional Commits): feat: → minor, feat!:/
BREAKING CHANGE → major, anything else → patch, applied on top of whatever
is already published on npm.
