Skip to content

About

Linux full-screen TUI for ZLG USBCANFD-200U CAN/CAN FD adapters: live monitoring, transmit, saved frames, bus timing, x86-64/ARM64 packages and Raspberry Pi support. Built with DeepSeek v4.1 Flash + Codex.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ZLG CAN Studio

English | 中文

A modern full-screen Linux terminal interface for ZLG USBCANFD adapters, built directly on ZLG's official user-space libusbcanfd.so. No SocketCAN, Wine or QEMU is required.

The project is optimized for the USBCANFD-200U and supports both x86-64 and ARM64 Linux, including 64-bit Raspberry Pi OS.

Features

  • Full-screen TUI with a dark theme, sidebar, inspector, status bar and live throughput charts.
  • CAN 2.0, CAN FD and CAN FD with BRS ("CANFD accelerated").
  • Device discovery, board information, dual FIFO receive, transmit, periodic transmit, bus statistics and logs.
  • Human-editable saved-frame presets with live file reload.
  • Command palette (Ctrl-P), help overlay (?), mouse clicks and wheel support.
  • Architecture-specific release packages for x86-64 and ARM64.
  • The original BIOS-style TUI is still available as zlg-tui-v1.

Requirements

  • Linux x86-64 or ARM64.
  • Python 3.9 or newer.
  • libusb-1.0-0, libudev1, libstdc++6 and a UTF-8 terminal with 256 colors.
  • A ZLG USBCANFD adapter and permission to access its USB device node.

The release packages include the correct architecture-specific libusbcanfd.so. The source checkout selects the library from vendor/x86_64/ or vendor/aarch64/.

Quick Start

From a source checkout:

git clone <repository-url>
cd zlg-can-studio
./zlg-tui

From a release tarball:

tar -xzf zlg-can-studio-<version>-linux-x86_64.tar.gz
cd zlg-can-studio-<version>-linux-x86_64
./zlg-tui

Use --mode listen for passive monitoring:

./zlg-tui --mode listen

Defaults are channel 0, normal mode, 500 kbit/s arbitration, 2 Mbit/s CAN FD data phase, 80 MHz controller clock and the internal 120 Ω termination enabled.

Install to PATH

Install for the current user under ~/.local:

./install.sh

This installs the application under ~/.local/lib/zlg-can-studio and creates ~/.local/bin/zlg-tui and ~/.local/bin/zlg-tui-v1.

Install system-wide under /usr/local and install the udev rule:

sudo ./install.sh --system

Custom prefix:

./install.sh --prefix /opt/zlg-can-studio

For a system installation, user presets are stored in ~/.config/zlg-can-studio/presets.json.

Pages

Key Page Purpose
F1 Overview Device, bus, traffic and health dashboard
F2 Monitor Live CAN/CAN FD frames, filtering, export and details
F3 Transmit Frame composer and saved-frame panel
F4 Bus Channel, bit rate, clock, mode and timing configuration
F5 Statistics Throughput, frame mix and bus health
F6 Logs Runtime actions and errors

Global keys:

Key Function
F1-F6 / Tab Switch pages
Ctrl-P or : Searchable command palette
? Help
F10 / q Quit and release the device

Saved Frames

Frame presets live in config/presets.json or, for a system installation, in the user config directory. The file can be edited externally and is reloaded automatically.

The repository tracks an empty template at config/presets.example.json. config/presets.json is local user data and is ignored by Git.

On the Transmit page, press Tab to move between the composer and SAVED FRAMES.

Key Action
Enter / S Send the selected preset immediately
P Start periodic transmission with the selected preset
L Load the selected preset into the composer
A Save the current composer frame; same name overwrites
D Delete the selected preset (Y confirms)
R Reload the preset file from disk

Use a custom file with:

./zlg-tui --presets /path/to/my_frames.json

If the bus is quiet, press Enter on an empty Monitor page or W to send the neutral probe frame. The default probe is 0x7FE, classic CAN, eight zero bytes, without BRS. It is intentionally not a sleep/wake or application frame.

Hardware Notes

  • Channel 0 is the default and is the only channel connected in the tested setup.
  • Enable the internal 120 Ω termination when required by the bus layout.
  • The tested USBCANFD-200U reports hardware 0x0301, firmware 0x0245, and uses an 80 MHz CAN controller clock.
  • The ARM64 release uses ZLG's 1.0.12 library; the x86-64 release uses 1.0.15. Validate CAN FD timing on the target Raspberry Pi before production use.

Project Layout

src/                 Python application, device layer and CLI tools
config/              Empty preset template; local presets are ignored
include/             ZLG VCI header
udev/                USB permission rule
vendor/              x86-64 and ARM64 ZLG libraries
packaging/           Raspberry Pi installation helpers
.github/workflows/   Release build workflow
zlg-tui              Default launcher
zlg-tui-v1           Original BIOS-style launcher
install.sh           User/system installer
README.md            English documentation
README_zh.md         Chinese documentation
AGENTS.md            Canonical repository instructions for coding agents
CLAUDE.md, GEMINI.md, CONVENTIONS.md, .github/copilot-instructions.md
                     Symlinks to AGENTS.md for other agent harnesses

Release Packages

Pushing a release-v* tag triggers the release workflow. For example, release-v2.4 produces version 2.4. The draft GitHub Release contains:

  • zlg-can-studio-<version>-linux-x86_64.tar.gz
  • zlg-can-studio-<version>-linux-aarch64.tar.gz
  • SHA256SUMS

Create and push a release tag with:

git tag -a release-v2.4 -m "ZLG CAN Studio 2.4"
git push origin release-v2.4

Existing v1 through v2.3 tags do not trigger this workflow.

GitHub also provides the automatically generated source archives. The workflow can be run manually from the Actions page when a tag is not desired; manual runs produce Actions artifacts only.

References

Official manuals and SDK archives are not included in this repository.

License

Copyright (c) 2026 Alan Lyu.

Project source code is licensed under the MIT License.

libusbcanfd.so is a third-party ZLG binary and is not covered by the MIT license. Its use and redistribution are subject to ZLG's SDK terms. See vendor/README.md or THIRD_PARTY.md in a release package.

About

Linux full-screen TUI for ZLG USBCANFD-200U CAN/CAN FD adapters: live monitoring, transmit, saved frames, bus timing, x86-64/ARM64 packages and Raspberry Pi support. Built with DeepSeek v4.1 Flash + Codex.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages