Skip to main content

MCUscope

MCUscope is a hardware debug bridge for embedded targets. It lets both humans and AI agents (such as Claude Code) talk to an STM32 (or any) microcontroller over a serial link: send CAN/I2C/SPI/GPIO/ADC commands, stream and query timestamped debug output, and plot realtime data in the browser.

A single daemon (mcuscoped) owns the serial port, timestamps every line into SQLite, and serves a local REST + WebSocket API and a web UI on 127.0.0.1:8765. The mcu CLI is a thin client over that API and is the primary interface for both the human and the agent.

This package (mcuscope) is the host side. The portable C firmware "monitor" module that runs on the target, a hardware-free simulator, and the full specification live in the project repository.

![MCUscope web UI](https://raw.githubusercontent.com/dwatman/mcuscope/main/docs/img/webui.png)

Install

Requires Python 3.11 or newer.

uv tool install mcuscope        # or: pipx install mcuscope

This exposes three console scripts on your PATH: mcuscoped (the daemon), mcu (the CLI), and mcu-sim (the hardware-free simulator).

To reach a real serial port, one OS-specific step:

  • Linux: your user must be in the dialout group: sudo usermod -aG dialout $USER, then log out and back in. Without it, opening /dev/ttyACM0 fails with permission denied.
  • Windows 10/11: most USB-serial adapters and ST-Link VCPs work with the in-box driver; some need the vendor driver (CP210x, CH340, FTDI).

Neither is needed for the quickstart below, which runs with no hardware attached.

Quickstart

No hardware needed to try it:

mcuscoped --sim --open            # daemon + built-in simulator; opens the web UI

The web UI at http://127.0.0.1:8765/ui/ shows the live terminal, CAN table, and realtime plots. The Plots panel also renders a Digital/Enum view (logic-analyser bit traces and labelled enum/state bands) sharing the same time base and cursor as the analog charts.

With real hardware, start the daemon first (it owns the port and captures everything), then attach the port - from the UI's + Attach dialog, or the CLI:

mcuscoped                                              # serves the API + web UI on :8765
# in another terminal (or use `mcu daemon start` to background the daemon):
mcu devices                                            # find the port name
mcu attach /dev/ttyACM0 --baud 115200 --alias board    # Linux
mcu attach COM7 --baud 115200 --alias board            # Windows

mcu status                        # daemon + port health
mcu cmd ping                      # -> monitor 1 <project>  (port-layer name, not the alias)
mcu cmd 'i2c scan'                # -> 48 50
mcu tail -f                       # follow live capture

Every command takes --json for a single machine-readable object and returns meaningful exit codes (0 success/match, 1 error or bad usage, 2 timeout, 3 daemon unreachable). Run mcu ai-guide for a compact, agent-oriented cheat sheet.

The simulator also runs standalone (mcu-sim, prints e.g. socket://127.0.0.1:9900); attach it like any device: mcu attach socket://127.0.0.1:9900 --alias sim.

What your firmware has to send

Nothing, to start with. Any line-based printf output is captured, timestamped, filtered and searchable as-is, so MCUscope is useful as a better serial terminal with no firmware changes at all. The only rule is that debug lines must not begin with < or !, which are reserved for the monitor protocol.

Two extra line formats get you realtime plots and timeline markers, with no library and no float printf:

printf("!p %lu temp=%d.%02d rpm=%d\n", tick_ms, whole, frac, rpm);
printf("!m @%lu calibration start\n", tick_ms);   // marker; the @tick is optional

!p <tick> <name>=<value> ..., values integer, fixed-point or scientific notation. Each name becomes a plot channel. Adding the portable C monitor module is only needed when you want the host to send commands to the firmware, or want decoded CAN and typed digital/enum streams. See What your firmware has to send.

Documentation

Full quickstart, configuration reference, protocol/API specification, and firmware integration guide are in the project repository.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcuscope-0.2.0.tar.gz (473.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcuscope-0.2.0-py3-none-any.whl (286.8 kB view details)

Uploaded Python 3

File details

Details for the file mcuscope-0.2.0.tar.gz.

File metadata

  • Download URL: mcuscope-0.2.0.tar.gz
  • Upload date:
  • Size: 473.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mcuscope-0.2.0.tar.gz
Algorithm Hash digest
SHA256 87716d94b3b1326892bdd0ad50de7723fc2874e57cc4db71f1b27b5ca8ee499f
MD5 a5e4fd3446d9c542f10a55e1b2b410ab
BLAKE2b-256 1fc2534a891933a4fbf0570be48374b56737e553742b0ed86ef97c72f735f4e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcuscope-0.2.0.tar.gz:

Publisher: release.yml on dwatman/mcuscope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcuscope-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mcuscope-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 286.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mcuscope-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7c2f978427e8d439438dddacd10ef6f959aaa5fecbe57fdd28f6d718bfacb9f
MD5 1c3de952f313ec032a4ef0cf9864dde2
BLAKE2b-256 f78812104e9d274639048b98b2db49dd09190c096559a6e94c549e83c01bd9cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcuscope-0.2.0-py3-none-any.whl:

Publisher: release.yml on dwatman/mcuscope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page