5 pointsby ChiaraCannolee2 hours ago1 comment
  • ChiaraCannolee2 hours ago
    I recently picked up a small thermal pocket printer for printing labels, stickers, and lists. It's a rebranded DP-L1S; several brands sell variants of the same hardware under different names.

    Fun little device, but the companion app ("Luck Jingle") demands location permissions, a forced internet connection, and a bunch of other stuff that has no business being on a printer that just needs to receive an image over Bluetooth from 30 cm away.

    So I decompiled the APK with JADX, reverse-engineered the BLE protocol, and built something that lets you print directly from your browser or the command line. No app, no account, no cloud. Fully free to use and the entire project is open source.

    Web app (no install, just open in Chrome/Edge/Opera): https://chiaracannolee.github.io/thermal-pocket-printer-basi... GitHub repo: https://github.com/ChiaraCannolee/thermal-pocket-printer-bas...

    What it does - Print images, text, and test patterns - Live preview of what comes out of the printer - Three density levels - Floyd-Steinberg dithering for photos - Invert mode (swap black and white) - Label mode for sticker paper with gap detection - Battery indicator via BLE notifications Optional: Python CLI for automation and batch jobs (pip install bleak Pillow)

    How it works (for the curious) The printer runs on the LuckPrinter SDK, which is used by 159+ printer models. The BLE protocol is an ESC/POS variant: you open service ff00, write to characteristic ff02, listen on ff01, send a few enable commands, then a GS v 0 raster image (1-bit, 384px wide, MSB-first), and feed/stop commands. Full command reference is in PROTOCOL.md. The web version uses 100-byte chunks with 50ms delays because of Web Bluetooth's MTU limits. The Python CLI uses 512-byte chunks with 10ms delays, which is significantly faster.

    Coming soon I'm working on an expanded web version with: - Adjustable label sizes with presets (29×12mm, 40×12mm, 50×30mm, 40×30mm, 48mm round, and custom sizes) - Save and load templates locally in the browser - Drag text directly on the preview for free positioning - Undo/redo - A print preview screen with adjustable: -- Threshold -- Number of prints -- Density override -- Feed after print (extra paper feed in mm)

    The basics in the web-app above work and are stable, so I'm already posting this version. I'll share the expanded version once it's ready.

    Compatibility macOS and Linux. Windows is waiting on better Web Bluetooth support. Other printers in the LuckPrinter family (DP-/LuckP-/MiniPocketPrinter series) will probably also work, possibly with a different print width.

    Based on the same approach as the fichero-printer reverse-engineered web-app, which does the same for the Fichero D11s (different device class, same SDK) https://github.com/0xMH/fichero-printer

    Questions about the protocol, the reverse-engineering process, or adapting this for other LuckPrinter models: ask away :)