v1.3.0 — Niimbot M2-H + automatic model identification
Adds the Niimbot M2-H and makes the driver identify the connected printer automatically. Validated on real hardware (B1, B1 Pro, M2-H).
Added
- Niimbot M2-H (
b1task, 300 dpi, model id 4608) — validated end-to-end. Uses the b1 command sequence with fast unacked writes (B1-Pro-class). - Automatic model identification — on connect the driver reads the model id (
PrinterInfo 0x40[08]) + protocol version (PrinterStatusData 0xA5) and picks the right task/flow-control, even though B1/B1 Pro/M2-H share a BLE name. Exposed asNiimbot.printer;Niimbot.identify(model)returns it without printing;Niimbot.disconnect()swaps printers. - Per-model flow control — only the 203 dpi B1 paces its writes; the 300 dpi B1 Pro and M2-H burst.
- Live demo on GitHub Pages,
package.json(zero-dep, npm-ready), README badges + supported-printer table.
Fixed
- M2-H printed at ~30 s/page because it exposes the
writeproperty and fell into slow write-with-response; theb1path now always prefers fast/paced unacked writes (niim.blue's approach).
Validated printers
| Model | task | dpi | id |
|---|---|---|---|
| Niimbot B1 | b1 |
203 | 4096 |
| Niimbot B1 Pro | v4 |
300 | 4097 |
| Niimbot M2-H | b1 |
300 | 4608 |
The only residual slowness is a full random-noise page at 300 dpi (BLE throughput limit) — not a real-label scenario. See docs/protocol-v4.md.
🤖 Generated with Claude Code