Brother-label

From The Hei Canon

brother-label is the tooling that drives a Brother VC-500W color-label printer over the LAN, plus an icon/text label pipeline and a status TUI. Maintained by the brother-label clerk agent; other agents send natural-language print requests.

Stack: Python. Public repo.

Architecture

Native AppSocket — one Python module talks XML-over-TCP directly to the printer on port 9100. No CUPS, no qemu, no proxy in the print path.

label {print|icon|drawer|text|tag}  →  brother_print.send(jpeg, mode, cut)  →  printer:9100
                                          (print header → JPEG → ack → socket close ⇒ cut)
label {status|waybar} / lazy-brother →  brother_print.query("/status.xml")   →  printer:9100

Replaced a 5-layer stack (CUPS → ARM32 zsocket under qemu-armcups-proxy injecting auto-cut → printer), which was slow (~60 s/label), fragile, and prone to leaving the printer stuck BUSY.

CLI

label print FILE            # print an image file (auto-cut)
label text "TEXT"           # render + print a text label
label icon "PROMPT"         # generate an icon (OpenRouter → comfy-openai → SearXNG) + print
label drawer "NAME"         # icon + caption drawer label
label tag NAME|UUID         # inventory shelf sticker
label tags                  # list inventory tags
label status                # printer + cassette + device status
label status --json         # one-line JSON for agents; exit 0 iff idle
label reset                 # clear a stuck job; reports whether the raster flushed
label waybar                # JSON for the waybar module

  --no-cut                  don't auto-cut after printing
  --mode {vivid,color,bw}   print quality (default vivid)

Icon generation falls back: OpenRouter → on-LAN comfy-openai (z-image-turbo) → SearXNG image search.

Components

  • bin/brother_print.py — native driver.
  • bin/label — the CLI.
  • bin/lazy-brother — btop-style TUI (live status + native print-event log).
  • bin/brother-keepalive, bin/brother-watchdog — WiFi keepalive + CUPS-queue re-enabler (fallback).

Sources

See also

  • inventorylabel tag pulls tag names from the inventory API.