2023-10-30 02:03:02 +03:00
2023-10-30 02:03:02 +03:00
2023-10-30 02:03:02 +03:00
2023-03-16 19:46:09 +09:00
2023-10-30 02:03:02 +03:00
2023-03-26 17:36:01 +09:00
2023-10-30 02:03:02 +03:00
2023-10-30 02:03:02 +03:00
2023-10-30 02:03:02 +03:00
2023-10-30 02:03:02 +03:00

niimprint — Experimental Niimbot Printer Client

Fork changelog & differences from original version:

  • Tested on Niimbot B21 and Python 3.11. Niimbot D11 support may be broken!
  • Added transport abstraction: switch between bluetooth and USB (serial)
  • Switched to click CLI library instead of argparse
  • Integrated pyproject.toml and poetry
  • Integrated pre-commit and ruff, re-formatted all files
  • Miscellaneous refactoring / file renaming / etc.

Installation

Recommended method is to use poetry and install with poetry install. However requirements.txt is also provided for convenience. Project is tested on Python 3.11, but should work on other versions.

Usage

$ python niimprint --help

Usage: niimprint [OPTIONS]

Options:
  -m, --model [b21|d11]        Niimbot printer model  [default: b21]
  -c, --conn [usb|bluetooth]   Connection type  [default: usb]
  -a, --addr TEXT              Bluetooth MAC address OR serial device path
  -d, --density INTEGER RANGE  Print density  [default: 5; 1<=x<=5]
  -i, --image PATH             Image path  [required]
  --help                       Show this message and exit.

Examples

B21, USB connection, 30x15 mm (240x120 px) label. On linux, you can try to omit --addr option and let the script to auto-detect the serial port (it will fail if there're multiple available ports). On windows, serial ports will be named like COM1, COM2 etc. (check in device manager).

python niimprint --addr /dev/ttyACM0 --image examples/B21_30x15mm_240x120px.png

B21, bluetooth connection: untested (todo).

D11: completly untested, however original fork supports it. If you have D11 at hand and willing to test, please open an issue!

Image vs Label size

Niimbot B21

According to my observations, B21 has 8 pixels per mm resolution. But there's one catch: printer specs say it supports up to 50mm-wide labels (which sould translate to 50 * 8 = 400 pixels). However trying to print anything larger than 384 pixels resulted in error. My guess it's the actual hardware limit, which is "almost equal" to stated 50 mm.

Niimbot D11

???

S
Description
Niimbot D101 label printer client + Tkinter label designer with emoji (fork of AndBondStyle/niimprint)
Readme MIT
13 MiB
2026-09-21 07:59:05 +00:00
Languages
Python 99.3%
PowerShell 0.7%