Projects

NiimCtl

Last updated: Oct. 20, 2025, 9:58 p.m.

I recently bought a NiimBot B1 printer on Aliexpress based on the assumption that it must be easy to use. There were mentions of an Android app (I have an Android device so that's a good backup) and some promising looking things on GitHub. I'd sort of assumed that these things were cheap and popular because they were really easy to build into your workflow for whatever labeling project you had in mind. In the end it turned out not so easy.

An example label printed with niimctl.py

Label Example: An example label printed with niimctl.py

First I tried NiimPrintX, this looked promising. It had a GUI but also a CLI tool and it was just Python. I struggled a bit with the install, it appears to be typical modern Python in that it needs a virtual environment and dozens of dependencies installed and a different version of Python than what you have installed. I did eventually get it installed and tried various forks which variously:

I did start trying to debug this but found I got bogged down in the structure of the code and all its various dependencies.

After that I found the excellent documentation at NIIMBOT Community Wiki and started on implementing my own tool based on this documentation. After a fairly short coding session I had something which reliably printed a blank label every time I ran it.

Next I tried niim.blue a web based UI for the printer which uses WebSerial to talk directly from the browser to the printer. I'd initially avoided this solution, I wanted to be able to print my label designs from Inkscape and I don't normally use Chrome. After the usual faff of getting the snap of Chromium to talk to serial ports and resetting the printer a couple of times I got niim.blue to work. This proved the printer could be made to work and there was definitely something up with my code. Another interesting thing it offered was a dump of all the packets sent to and received from the printer. Press F12 while in the niim.blue application and you can see the packets in the log. That quickly showed I had to wait for a couple of mystery messages after sending the bitmap data before sending the "end page" command and suddenly my labels were no longer blank.

I've wrapped up what I've created and pushed to GitHub. I can now use two commands to export an Inkscape SVG as a PNG and then send that PNG to the printer. This gets me to where I wanted to be for a component sorting exercise and opens up options for printing QR codes and barcodes made with Inkscape's generate tools.

Section:
Projects
Tags:
Python,
Reverse Engineering,
Labeling

Comments

Posting comments is not currently possible. If you want to discuss this article you can reach me on twitter or via email.


Contact

Email: nathan@nathandumont.com

Mastodon: @hairymnstr@mastodon.social