cd /news/artificial-intelligence/show-hn-making-a-label-printer-work-… · home topics artificial-intelligence article
[ARTICLE · art-42587] src=stefan.schueller.net ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Show HN: Making a label printer work under Linux using agentic AI

A developer used agentic AI to decompile a Chinese label printer's Android app and create a Go script that prints PDFs via Bluetooth on Linux, after struggling with poor print quality under CUPS. The project, built with Kilocode and Gemini 3 Pro, also produced a web UI for Chrome that supports paper size selection and test patterns.

read4 min views1 publishedJun 28, 2026
Show HN: Making a label printer work under Linux using agentic AI
Image: source

Intruduction

A while ago I purchased this “cheap” Chinese label printer which can print different sized labels like these. Sadly, when I set it up under Linux, although somewhat supported, the print results were bad, while the same printer produced decent prints in Windows or via the Android app. I could not get better prints with CUPS no matter what I tried. I also tried to set some default paper sizes, but it was a huge pain.

Until recently I would send a PDF of the labels I wanted to print to my phone and use the app to print via Bluetooth. Alternatively, I would use a Windows VM to print via USB.

I thought there had to be a better way. So here is what I did.

Decompiling the android app

The android app works very well via Bluetooth and requires no setup. Perhaps I can get better prints via Bluetooth than via USB under Linux. I could then also place my printer further away from my PC.

So I extracted the APK from my phone using APK Extractor. https://play.google.com/store/apps/details?id=braveheart.apps.apkextract&hl=en

I then decompiled it using Jadx online and download those files.

Initially, my plan was to go through the code and figure out what Bluetooth characteristics I needed to use and what to send. This can get tedious fast and take a lot of time.

However I was feeling lazy and did not want to spend my day off deciphering decompiled code.

Kilocode to the rescue

I decided to give it a try using Kilocode. Maybe an agentic AI has an easier time deciphering a decompiled APK than I do, and I recently set up a lot of new models in LiteLLM to work with my Kilocode setup.

Go Version

I placed the extracted APK in a new project and told the agent that I wanted to to use the code to generate a go version. Why go? I have had a lot of good results with go vs python when using deepseek.

Using the code in com.print.label_v66/sources/com/print/label/bluetooth and the other folders. Write me a go script that can print a PDF via bluetooth on a Linux PC in the "desktop" folder. I also need to be able to set the paper size for the label to be printed. The printer's bluetooth ID is DD:0D:30:02:63:42

Initially, I tried using DeepSeek Coder, which usually provides good results for dirt cheap, but I wasn’t getting anywhere. Although it would connect to the printer, it was not working. Something was off, but I did not know what. Most likely, some initialization was missing.

Before trying to debug it myself, I decided to first switch to Gemini 3 Pro. Although initially it also did not work, I was able to work with it until the printer responded.

Sadly, Gemini is slow and a lot of the time I get overload errors but eventually I got a go app that worked and I could call from the command line.

go run print_label.go \
--bluetooth \
--printer-id DD:0D:30:02:63:42 \
--tspl \
--paper-size 100 \
--paper-height 150 \
--pdf Labels-Sample.pdf \
--margin-x 5

After a few more back-and-forths with the agent, I had all the features I wanted working.

Web Version

Once I had a working Go app, I asked the agent to make a new folder and build a web-only version for Chrome (not all browsers support Bluetooth). This worked in the first iteration.

I now have a web UI where I can upload a PDF, convert it, and select from the options the printer offers. I can also print a test pattern to align the print, which the regular app or driver cannot do.

If you have a similar printer, I would be curious to know if it also works with yours.

You can download what the AI produced here (minus the decompiled APK, for reasons…). I haven’t reviewed the code, so there may be some oddities and dead ends…

ESP32-S3 Version

I couldn’t let this project go so I ended up building a custom PCB and writing an ESP32 version that runs the entire thing standalone. It even gets its power from the printer and is a drop-in replacement for the existing bluetooth module, although at the moment it lacks the bluetooth functionality.

Additionally, it has an LCD that helps with the setup of the WiFi and displays the IP as well as the current status.

You can find the code and PCB here: https://github.com/sschueller/XPrinter-ESP32-S3

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @kilocode 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-making-a-lab…] indexed:0 read:4min 2026-06-28 ·