Led Badge
@magistr/led-badgev2026.10.25.10
01README
Drive a 44x11 LED name badge (USB 0416:5020, WCH CH583 "LSLED" / Badge Magic family) from swamp.
Model @magistr/led-badge:
detect— find the badge's HID interface (no write).preview— render text / pixel art to ASCII frames without the device.send— upload up to 8 messages (mode, speed, blink, border, brightness). Replaces what is stored on the badge.
USB I/O uses a small Rust hidapi helper (bin/hid-send) built once with cargo and cached in ~/.cache/swamp-led-badge. Works on macOS and Linux.
02Release Notes
2026.10.25.10
- Repo-wide republish; no functional change.
03Behaviors
@magistr/led-badgev2026.10.25.10extensions/models/led_badge.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| transport? | enum | usb (HID, cable) or ble (Bluetooth LE, badge advertises as LSLED) |
| bleName? | string | BLE advertised name; any device advertising service FEE0 also matches |
| bleScanSeconds? | number | How long to scan for the badge over BLE |
| blePin? | string | 4-digit PIN shown by a badge in BT-PAIRING protection mode, if enabled |
| vendorId? | number | USB vendor id (default 0x0416 = 1046) |
| productId? | number | USB product id (default 0x5020 = 20512) |
fn detect()
Find the badge's 64-byte HID output interface without writing to it.
fn preview(messages: array, brightness?: union)
Render messages to ${WIDTH}x${HEIGHT} ASCII frames
| Argument | Type | Description |
|---|---|---|
| messages | array | |
| brightness? | union | Brightness percent |
fn send(messages: array, brightness?: union)
Upload 1..8 messages to the badge over USB. Replaces
| Argument | Type | Description |
|---|---|---|
| messages | array | |
| brightness? | union | Brightness percent |
Resources
device(infinite)— Detected badge HID interface(s)
preview(infinite)— Rendered frames of messages (not sent)
upload(infinite)— Messages uploaded to the badge
04Previous Versions
2026.10.15.9MIT
2026.10.15.9
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.15.8MIT
2026.10.15.8
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.15.6MIT
2026.10.15.6
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.15.5MIT
2026.10.15.5
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.15.4MIT
2026.10.15.4
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.15.3MIT
2026.10.15.3
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.15.2MIT
2026.10.15.2
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.15.1MIT
2026.10.15.1
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.14.2MIT(was none)
2026.10.14.2
Changed
- Repo-wide maintenance release: version bump to republish the current source. No schema change.
updated binaries
2026.10.05.1
2026.10.05.1
Initial release.
detect,previewandsendfor the 44x11 LED name badge (USB0416:5020, WCH CH583, BLELSLED).- Text (5x7 font plus
:heart::smile::check::cross::arrow:symbols), pixel art, and animations (frames, up to 32 frames). - Two transports through a Rust helper (
bin/hid-send, hidapi + btleplug): USB HID (64-byte reports) and Bluetooth LE (16-byte writes to FEE1, optional 4-digit PIN). Built once withcargo build --lockedand cached;LED_BADGE_HELPERpoints at a prebuilt binary instead. - Uploads above ~2.3 KB are refused: the stock firmware silently ignores them (measured: 2176 bytes plays, 4032 bytes is dropped).
- BLE payloads are padded to 16 bytes, not 64: the badge restarts once it has the announced bytes, so a padding-only trailing write hits a closed link.
05Stats
A
100 / 100
Downloads
15
Archive size
27.0 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned
Repository
https://github.com/umag/swamp-workspace06Platforms
07Labels