Skip to content

Python library to control mini thermal printers connected to devices like the BeagleBone

Notifications You must be signed in to change notification settings

csik/py-thermal-printer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Thermal Printer Library

Thermal printing library that controls the "micro panel thermal printer" sold in shops like Adafruit and Sparkfun (e.g. http://www.adafruit.com/products/597). Mostly ported from Ladyada's Arduino library (https://github.com/adafruit/Adafruit-Thermal-Printer-Library) to run on BeagleBone and Raspberry Pi.

Currently handles printing image data and text, but the rest of the built-in functionality like barcodes are trivial to port to Python when needed.

If on BeagleBone or similar device, remember to set the mux settings or change the UART you are using. To enable the defaults for example:

# MUX SETTINGS (Ängström 2012.05 on BeagleBone) 
echo 1 > /sys/kernel/debug/omap_mux/spi0_sclk
echo 1 > /sys/kernel/debug/omap_mux/spi0_d0 

If on a Raspberry Pi and using the GPIO UART pins, remember to use a level shifter between the printer (5V) and the RPi (3V3).

For more detailed step-by-step instructions see this tutorial.

UART can be changed by passing the device path to the constructor: p = printer.ThermalPrinter(serialport="/dev/ttyUSB0")

Thanks to Matt Richardson for the initial pointers on controlling the device via Python.

Author: Lauri Kainulainen / White Sheep Isobar (whitesheep.fi) Contributors: Jonathan Harlap

(Licensed under the MIT license)

About

Python library to control mini thermal printers connected to devices like the BeagleBone

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published