No description
- Rust 94.9%
- Shell 5.1%
| src | ||
| systemd | ||
| udev | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| deploy.sh | ||
| DESIGN.md | ||
| README.md | ||
Label Printer Server
A minimal Rust web server that sends text labels to a Munbyn ITPP941 thermal printer over USB.
Features
- Single-page web UI — type text, hit print
- TSPL format for 52mm × 30mm labels
- Direct USB bulk transfer (bypasses kernel driver)
- Cross-compiled ARM64 binary for Raspberry Pi
- Zero dependencies on the remote (single binary + systemd)
Quick Start
Build & Deploy
# Deploy to a remote Pi
./deploy.sh user@<ipv6-address>
# Or set it as an env var
export LABEL_PRINTER_HOST=user@<ipv6-address>
./deploy.sh
Manual Deploy
cross build --release --target aarch64-unknown-linux-gnu
scp target/aarch64-unknown-linux-gnu/release/label-printer-server user@<ipv6>:/home/user/label-printer-server/
ssh user@<ipv6> "sudo systemctl restart label-printer"
Architecture
Browser ──HTTP──► Rust Server (axum) ──USB bulk──► Munbyn ITPP941
(Yggdrasil) :8080 endpoint 0x02
Tech Stack
| Component | Choice |
|---|---|
| Language | Rust (stable) |
| Web framework | axum 0.8 |
| USB printing | rusb 0.9 (libusb) |
| Build | cargo + cross |
| Deploy | systemd service |
API
| Method | Path | Description |
|---|---|---|
| GET | / |
Web page with text box + print button |
| POST | /print |
Submit text for printing (text form field) |
TSPL Notes
The Munbyn ITPP941 uses TSPL (TSC-compatible), not ZPL. ZPL commands are silently ignored.
Generated TSPL format:
SIZE 52 mm,30 mm
GAP 3 mm,0 mm
CLS
TEXT 7,20,"3",0,1,1,"{user_text}"
PRINT 1
Hardware
| Item | Value |
|---|---|
| Printer | Munbyn ITPP941 |
| Vendor ID | 0x09c6 |
| Product ID | 0x0248 |
| Resolution | 203 DPI |
| Label size | 52mm × 30mm |
| USB endpoint | 0x02 (bulk OUT) |
| Instruction set | TSPL (TSC-compatible) |
Project Structure
label-printer-server/
├── src/
│ ├── main.rs # Web server, routes, HTML
│ └── print.rs # ZPL generation + USB bulk transfer
├── systemd/
│ └── label-printer.service
├── udev/
│ └── 99-zebra-printer.rules
├── deploy.sh
├── DESIGN.md
└── Cargo.toml
Future Improvements
- Font size controls
- Label templates
- Print queue
- Printer status detection
- Barcode support
- askama templating