GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BTLtech1/esp32-label-printer-bridge: Turn a cheap USB label printer into a Wi-Fi printer with an ESP32-S3. Works with ZPL/TSPL thermal printers (Rongta, Rollo, and more).

BranchesTags
Open more actions menu

Latest commit

 

History

85 Commits
85 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
btl-printer
btl-printer
 
 
web
web
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

BTL Print Bridge

Turn a cheap USB label printer into a Wi-Fi printer with a ~$10 ESP32-S3 board.

  • Print from any computer over Wi-Fi. Add the bridge as a normal network printer and keep using your printer's own driver. Every app's Print button works.
  • Works with most cheap USB label printers. The bridge doesn't need to understand your printer. It passes along exactly what your computer's driver sends (ZPL, TSPL, EPL, raster, whatever the printer uses).
  • Stamp item codes onto shipping labels by hand (for sites you haven't set up automatic labels for). Pick a PDF of 4×6 labels on the bridge's page, type a code like G3 for each, print.
  • Print text from the bridge's page. Type a few words, see a preview sized to your label, print. No driver needed (ZPL or TSPL printers).
  • Status light. The board's colour LED shows green = ready, blue = printing, red = no printer, yellow = waiting to save a flier, purple = setup mode.
  • Updates over Wi-Fi. The bridge's page checks for new versions; click Update now, no cables needed.
  • Saved fliers. Save up to 7 fliers to the board and print them with its BOOT button (1 to 7 clicks), no computer needed. Hold the last click for a batch. Extra wired buttons are optional.
  • Optional automatic printing. The bridge can check a web address every few seconds and print any ready-made jobs it finds, for example shipping labels for new orders.

No app, no cloud account, no AI needed. Made by BTL.


What you need

Part Notes
ESP32-S3 dev board with two USB-C ports Search "ESP32-S3 DevKitC N16R8". Must be an S3: the plain ESP32, C3 and C6 can't act as a USB host. N16R8 = 16 MB flash + 8 MB PSRAM.
Adapter from your printer's USB port to USB-C Most label printers have a square USB-B port: use a "USB-B male to USB-C female" adapter plus a USB-C to USB-C cable, or the printer's normal cable plus a "USB-C male to USB-A female" OTG adapter.
USB-A to USB-C cable + any USB-A phone charger Powers the board. A USB-C charger with a C-to-C cable often won't power the COM port (see Troubleshooting).
Your label printer and its power supply The printer must have its own power (the board doesn't power it).

Wiring: printer → adapter → the board's port labeled USB (sometimes "OTG"). Power the board from its other port, labeled COM (sometimes "UART").

Install the firmware (pick one way)

You only do this once. After that, updates happen from the bridge's own page over Wi-Fi.

Way 1, easiest: from your browser (about 2 minutes)

Open https://btltech1.github.io/esp32-label-printer-bridge in Chrome or Edge, plug in the board's COM port, and click Install. Not sure which port is the board? Unplug it and click Install again: the entry that disappears is the board.

Worked? Skip Way 2 and go to Set it up.

Way 2, only if Way 1 doesn't work: Arduino IDE (about 15 minutes)

  1. Install the free Arduino IDE (arduino.cc/en/software).
  2. File → Preferences → Additional boards manager URLs, add: https://espressif.github.io/arduino-esp32/package_esp32_index.json
  3. Tools → Board → Boards Manager, search esp32 by Espressif, install version 3.x.
  4. Open btl-printer/btl-printer.ino from this folder.
  5. Plug the board's COM port into your computer and set Tools:
    • Board: ESP32S3 Dev Module
    • USB CDC On Boot: Disabled
    • USB Mode: Hardware CDC and JTAG
    • Flash Size: 16MB
    • PSRAM: OPI PSRAM
    • Partition Scheme: 16M Flash (3MB APP/9.9MB FATFS) or any scheme with an app of 2 MB or more
    • Port: the COM port that appeared when you plugged in the board
  6. Click Upload (→). If it doesn't start, hold the board's BOOT button while clicking Upload, and let go when you see "Connecting…".
  7. Open Tools → Serial Monitor at 115200 baud to see what the bridge is doing.

Set it up

  1. On first start the bridge creates a Wi-Fi network called BTL-Printer-Setup. Join it with your phone or computer. A setup page should open by itself; if not, go to http://192.168.4.1.
  2. Enter your Wi-Fi name and password (it must be a 2.4 GHz network) and save. The bridge restarts and joins your Wi-Fi.
  3. Open the bridge's page: http://btl-printer-XXXX.local, where XXXX is unique to your board (don't know it? The next step, Add it to your computer, finds it for you; it's also in your router's device list, and in the Arduino Serial Monitor if you used Way 2), or just use its IP address. You'll see whether the printer is connected.
  4. In your router settings, give the bridge a fixed IP address (often called "DHCP reservation") so your computer can always find it.

Find your bridge's page

The bridge has its own page in your browser. It's where you save fliers, see the status and update the bridge.

  • Type its name into your browser's address bar: btl-printer- plus 4 letters/numbers, then .local, for example btl-printer-c854.local. The name never changes.
  • Don't know the name? On the install page, run the Windows line from Step 5: it finds every bridge on your Wi-Fi and opens its page. The bridges are also in your router's device list as btl-printer-….
  • Bookmark it once it's open (Ctrl+D). On a phone, use Share → Add to Home Screen. Each bridge's page is named after it, so two bridges get two different bookmarks.
  • The .local name doesn't open? (some Android phones) Use the number address shown on the page instead, e.g. 192.168.1.50. That one can change if your router restarts.

Add it to your computer

Windows 10/11 (easiest, about 1 minute)

  1. Install your printer's normal driver if you haven't (plug the printer into the PC by USB once, or run the maker's installer).
  2. Right-click the Start button → Terminal (Admin).
  3. Paste this line and press Enter. It finds your bridge on the network by itself: irm https://btltech1.github.io/esp32-label-printer-bridge/windows.txt | iex (The bridge's own page also has a Copy button with a direct version of this line.)
  4. Press Enter to use the driver it found for your printer (or type the number of the right one), press Enter to name it after your printer (or type your own name), set the paper size to your labels, and click OK. A test page prints and the bridge's page opens. It also offers a desktop shortcut to that page (type Y if you want one).

You can read exactly what it does first: open http://<bridge-ip>/windows.ps1 in your browser. It adds a Raw port 9100 and a printer named after your printer, e.g. "PM-241 (Wi-Fi)" (or "Label Printer (Wi-Fi)" if the printer doesn't report a name). It points the printer at the bridge's name (btl-printer-XXXX.local) when your PC can find it, so printing keeps working even if your router gives the bridge a new IP address (otherwise it uses the IP, and you should reserve that IP in your router). Running it again rebuilds that printer from scratch, which also fixes stuck jobs.

More than one printer? Use one bridge per printer. Each bridge has its own name, and running the command once per bridge adds a separate entry for each, without touching the others. The list marks bridges that are already added, and pressing Enter picks a new one.

Windows, by hand Settings → Printers & scanners → Add device → Add manually → "Add a printer using an IP address or hostname" → TCP/IP Device, the bridge's IP, untick "Query the printer" → if asked, Custom → Settings → Raw, port 9100, SNMP off → pick your printer's driver. If an old USB entry for the same printer gives trouble, add a new one rather than changing its port.

macOS System Settings → Printers & Scanners → Add Printer → IP tab. Address = the bridge's IP, Protocol: HP Jetdirect – Socket, then choose your printer's driver.

Tip: in the driver's preferences, set the paper size to your labels (for example 4×6 in / 100×150 mm) and raise the darkness a little if text looks faint.

Automatic printing (optional)

Fill in Print queue URL and Queue token on the bridge's page. Every 5 seconds the bridge asks:

GET  {QUEUE_URL}/next         Authorization: Bearer {TOKEN}
  204 No Content  -> nothing to print
  200 OK          -> body = raw printer data (e.g. a ZPL label), header X-Job-Id: <id>
POST {QUEUE_URL}/ack?id=<id>  Authorization: Bearer {TOKEN}   (sent after the job prints)

Anything that can serve those two URLs works: a Cloudflare Worker, a small server, etc. Jobs must already be in your printer's language. Many shipping-label services (Shippo, EasyPost, ShipStation) can return labels as ZPL, which most 4×6 thermal printers understand. A job that fails to print isn't acknowledged, so it's retried.

No automatic labels yet? Stamp them by hand

Selling on a site that isn't connected to automatic labels? Download that site's labels as a 4×6 PDF and use Stamp & print labels on the bridge's page: pick the PDF, type an item code for each label (or one code for all), click a label to move where the code goes, and press Print labels. Your browser opens the PDF and sends each finished label only to the bridge (POST /label, a PNG picture); nothing goes anywhere else. The free PDF.js reader loads from cdnjs when you pick a file, so that computer needs internet.

Updating

Open the bridge's page. The Firmware box says whether a newer version exists; click Update now and wait about 30 seconds. Your settings and saved fliers are kept. (You can also install btl-print-bridge-update.bin by hand under Update from a file, or re-run the browser installer over USB.)

Replacing a board

Your computers' printers, bookmarks and shortcuts point at a board by its name (for example btl-printer-6b1c.local). A new board has its own name, so it needs the old name to slot in without setting anything up again.

  • The old board still works: set the new board up on your Wi-Fi and update both to firmware 1.20 or newer. Open the old board's page, pick the new board under Copy or back up fliers, and click Move everything to that board. The new board gets all the fliers, the settings (printer language, order queue, buttons) and the old board's name, and restarts as that name. The old board stops taking orders and renames itself (…-old). Move the printer's USB cable to the new board. Then restart each Windows PC once (or restart its Print Spooler service): Windows remembers the old board's address until then, so prints get stuck in the queue.
  • The old board is broken: turn it off. On the new board's page, under Settings, type the old board's name into This board's name and click Save and restart. You'll find the old name in Windows under Printers & scanners → your printer → Printer properties → Ports. If you have a backup file from the old board, Restore backup on the new board puts back the fliers and settings, and offers to take the old board's name for you. Then type the queue token again under Settings (backups never contain it).

Saved fliers

Store up to 7 print jobs on the bridge and print them with the board's BOOT button, no computer needed.

  1. Open the bridge's page (Open my bridge in Step 6 of the install page, or the desktop shortcut if you made one). Under Saved fliers, pick a flier and click Save next print here.
  2. Within 5 minutes, print your flier from your computer to the bridge's printer as usual. The bridge saves it instead of printing it.
  3. Print it with the BOOT button:
    • 1 to 7 quick clicks print Flier 1 to 7 (1 copy).
    • Hold the last click for 2 seconds for that flier's batch (e.g. click, click-and-hold = Flier 2's batch). The batch is 10 copies unless you change it next to the flier on the bridge's page.
    • Press again during a batch to stop it.
    • The bridge's page has a Print button and a Copies box for each flier too.

A flier is saved exactly as your printer's driver made it, so reprint it on the same kind of printer.

Or make a flier straight from a file: under Make a flier from a file on the bridge's page, pick a PDF or a picture (PNG, JPG), set the label size, choose a slot and click Save flier. Each PDF page becomes one label. The file is converted in your browser using the printer language set under Settings, and goes only to the bridge.

Copying fliers to another board: under Copy or back up fliers, tick the fliers you want, pick the board (the list shows which printer each board has) and click Send fliers. Before anything is replaced, it shows what's on that board in those slots.

Move, copy and back up. On the bridge's page:

  • Move to under a flier puts it in a different click slot. If that slot is taken, the two swap.
  • Send all fliers to another board copies every flier, with its name and batch count, to another BTL Print Bridge on the same Wi-Fi. Both boards need firmware 1.11.0 or newer.
  • Download backup saves all fliers to one file on your computer. Restore backup loads that file onto any board, for example after a fresh install.

Copies go into the same click slots and replace what was there.

Optional: your own buttons

Want real buttons? Wire any momentary push button (arcade buttons, big dome buttons, tactile switches, or mechanical keyboard switches in a 3D-printed case) with two wires: one to its pin, one to GND. No resistors needed, and female-to-female jumper wires push onto the board's pins, so no soldering if your buttons have wire leads. Click for copies: 3 clicks = 3 copies (up to 20); the status light flashes white for each click it counts. Hold 2 seconds = batch, press again to stop. (The BOOT button is different: with only one button, its clicks pick the flier.)

By default button 1 prints Flier 1 and so on. Under Extra buttons on the bridge's page you can set any button to print a different flier, reprint the last label, or stop printing. Reprint repeats the last label sent from a computer, the page or the order queue; while a button is set to it, the board keeps that one label in memory until it restarts.

Button Pin
1 GPIO 4
2 GPIO 5
3 GPIO 6
4 GPIO 7
5 GPIO 15
6 GPIO 16
7 GPIO 17

Troubleshooting

Asking for help? Open the bridge's page, scroll to Troubleshooting log, click Copy log and paste it into your message or GitHub issue. It lists what the board did since it last started (printer plugged in, each print job and whether it worked, Wi-Fi drops, why it last restarted). It has no passwords, no Wi-Fi name and nothing from your labels. It clears when the board restarts, so copy it before unplugging.

Problem Fix
Board doesn't light up on the COM/UART port with a USB-C charger (but does on the other port) Many cheap boards lack the resistors USB-C chargers look for on that port. Power it with a USB-A to USB-C cable from an ordinary USB-A charger or computer port instead.
Page says printer not connected Check the printer is on and plugged into the USB port (not COM). If the last event never mentions "USB:", the printer is probably waiting for 5 V: see "5 V on the USB port" below.
Light is red, or the page says stopped responding, with a long cable Try a shorter USB cable between the board and the printer. A long cable (plus an adapter) can connect and then fail on real print jobs.
Printer shows connected but nothing prints after earlier failed attempts Turn the printer off and on, then print again. A print job that was cut off part-way can leave the printer waiting for the rest and refusing new jobs.
Labels print too high or low, with the top or bottom cut off Your printer driver is probably set to continuous paper. In the driver's Printing preferences set the media type to labels with gaps. A flier saved while it was set to continuous keeps that setting inside it, so save that flier again afterwards. From firmware 1.13.0 automatic order labels set this themselves.
Windows can't find the printer Make sure your computer and the bridge are on the same network. Use the IP address instead of the .local name.
Prints blank, garbage, or tiny That's the driver, not the bridge. Use the same driver and settings that work over a USB cable.
Bridge can't join Wi-Fi It needs a 2.4 GHz network. If it fails, it goes back to setup mode (BTL-Printer-Setup).
Windows test page / PDF never prints (job sits in the queue) Usually an old printer entry that used to be on USB. Remove it and add a fresh one. In PowerShell (as Administrator), with your bridge's IP and your driver's exact name: Add-Printer -Name "Label Wi-Fi" -DriverName "YOUR DRIVER NAME" -PortName "192.168.1.137" (create the port first with Add-PrinterPort -Name "192.168.1.137" -PrinterHostAddress "192.168.1.137" if it doesn't exist).
A print job is stuck in the Windows queue ("Printing, Error"), often after swapping boards or the board getting a new address Windows remembers the bridge's old address. Cancel the job (print queue → ⋯ → Cancel all), then restart the PC or the Print Spooler service (Win+R → services.msc → right-click Print Spooler → Restart) and print again.
A second copy of your printer appears, named "… (Copy 1)", and gives error 0x80070709 That's a copy Windows made when the printer was plugged into the PC by USB. Pick your (Wi-Fi) printer instead, and remove the copy in Settings → Printers & scanners. To check which is which: Printer properties → Ports. The Wi-Fi one uses btl-printer-….local or an IP address, the copy uses USB001 or similar.
Orders stopped printing after you replaced the board The order queue settings live on each board. Use Move everything to that board on the old board's page, or Restore backup on the new one, or type the queue URL and token under Settings. Waiting orders print as soon as it's set. See Replacing a board.
Two boards and you can't tell which page is which Each page shows its board's name on the Wi-Fi line (and in the tab title). Unplug one board's power and reload both pages: the one that stops loading is the board you unplugged.
The page stops loading and the buttons do nothing From firmware 1.18.0 the board restarts itself after 3 minutes stuck. Then open Troubleshooting log: the line "Before that restart it was: …" says what it was doing. Paste it into an issue.
ZPL test label prints garbage or nothing Your printer may not speak ZPL. Try the TSPL test button. If neither works, that's fine: network printing uses your printer's own driver, so add the bridge to your computer and print a Windows test page instead.

5 V on the USB port. Many printers won't connect until they see 5 V on the USB cable, and these boards don't send 5 V out of their USB port by default. Symptom: the page says printer not connected and never shows a "USB:" event, even with a good cable. Changing cables or adapters (C-to-C, C-to-A) doesn't help, because none of them add power. Fix: most dual-USB-C ESP32-S3 boards have two tiny pads labeled USB-OTG (sometimes "IN-OUT") near the ports. Briefly touching something metal across them is a quick test: if the printer connects, bridge them permanently with a blob of solder. After that, don't plug the board's USB port into a computer or charger while it's also powered from UART/COM.

No soldering? A conductive pen line across the pads also works. Or use a small 2-in-1 USB-C OTG adapter with a charging port (charger plugged in) between the board and the printer cable. A plain OTG adapter won't help (it adds no power), and USB hubs and docks don't work: the bridge talks only to a printer plugged in directly.

Tested printers

Printer Printer's USB port Needs 5 V from the board? Language Network printing Notes
RONGTA RP421A USB-B no ZPL works Windows 11, "RONGTA RP421A(ZPL 203DPI)" driver, Raw port 9100
PM-2411-BT (PM-241 series) USB-C yes TSPL TSPL test works Bridge the USB-OTG pads or use a powered OTG adapter (see "5 V on the USB port" above)
Rollo X1038 (USB 09C5:0588) USB-B no TSPL, pictures only works Windows 11, Rollo driver. Use a short USB cable: a long one connected but failed to print. Accepts TSPL pictures (BITMAP) only: TSPL text, box and barcode commands print nothing and leave it stuck until it's turned off and on. From firmware 1.12.0 the bridge's TSPL test and order labels are sent as pictures, so they work.

So far, the printer with a USB-C port needed 5 V and the ones with a square USB-B port didn't. That's only three printers, so try yours without the bridge first.

Tried it with another printer? Please add it to this table.

Credits

Made by BTL. I designed and tested this; the code was written with help from AI (Claude).

License

MIT. See LICENSE.

About

Turn a cheap USB label printer into a Wi-Fi printer with an ESP32-S3. Works with ZPL/TSPL thermal printers (Rongta, Rollo, and more).

btlstore.com/guides/wireless-label-printer-bridge/

Topics

arduinoesp32esp32-s3label-printerlabel-printersprint-serverprint-serversthermal-printerthermal-printer-4x6thermal-printer-driverthermal-printersusb-hostzplzpl-printer

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.