Skip to main content

Peripage A6 F622: Direct printing via Bluetooth

This scripts enables printing on the Peripage A6 F622. We aim mostly at Linux here, but due to the use of Python this script should be portable to any environment supported by PyBluez

Introduction

The Peripage A6 F622 is an inexpensive portable thermo printer. It provides both Bluetooth and USB connectivity. Unlike most other thermo printers it does not seem to support ESC/POS or any other standardized printer control language.

So far, the Peripage A6 F622 can be only controlled using a proprietary app (iOS / Anndroid). There is also a driver for Windows with many limitations, most notably the need of defining a page size before printing; this is a huge limitation, as the Peripage prints on continuous form paper.

The script provided here was built based on an analysis of captured Bluetooth traffic between the printer and an Android device. The Peripage A6 uses the serial profile (BTSPP) and RFCOMM.

Essentially, the script takes an input images, scales it to the printers native X resolution of 384 pixels, and then sends it to the printer.

Please note: This script is mostly a proof of concept. Printing stuff works mostly fine. However, don't expect a polished Python3 library here. Kudos go out to bitrate16 for turning this hack into a proper Python3 library, ppa6!

What is currently working?

  • Printing Images (JPG, PNG,...)
  • Printing SVG files
  • Direct printing of QR codes
  • Manipulation of Brightness / Contrast (via Image)
  • Toggle Paper feeding

Prerequisites

  • Python 3 and PIP
  • Peripage A6 printer (obviously)

Install dependencies

This script requires the following dependencies:

  • Pybluez (Bluetooth connectivity)
  • Pillow (Image handling)
  • argparse (Argument parser)
  • tqdm (Progress bar)
  • qrcode (qr code generation)
  • cairosvg (svg rendering)

You can simply install all requirements using PIP:

pip install -r requirements.txt

The next step is to identify the Bluetooth MAC address of your printer. On Linux, this can be easily done using hcitool:

elias@luna:~$ hcitool scan
Scanning ...
B5:5B:13:08:F6:22	PeriPage_F622
elias@luna:~$

Printing Images

Once you know the BT MAC address, printing is straightforward

./ppa6-print.py -i [IMAGE FILE] [BT MAC ADDRESS]

You can use all common raster image formats for printing (PNG, JPG, GIF...)

Example

./ppa6-print.py -i image.jpg B5:5B:13:08:F6:22

Printing SVG files

Similarly, printing SVG files is straightforward. Internally, the image is first rasterized using cairosvg.

Example

./ppa6-print.py --svg myvectorimage.svg B5:5B:13:08:F6:22

Printing QR Codes

For the sake of convenience, the script allows QR codes to be generated and printed directly in one go. Simply pass in in the content for the QR code using the -qroption.

Example

./ppa6-print.py -qr "http://www.weingaertner.org" B5:5B:13:08:F6:22

Manipulating brightness and contrast for printing

In many cases, the print quality dramatically improves if the brightness or the contrast of the image is adjusted. This can be done using the -b and -b parameters.

Example The example reduces the contrast using a factor of 0.75 and increases the brightness using a factor of 1.5.

./ppa6-print.py -c 0.75 -b 1.5 -i image.jpg  B5:5B:13:08:F6:22

Disabling feeding

The script feeds some extra paper after printing to ease cutting. This can be disabled using the -nf parameter.

Example

# no paper feeding
./ppa6-print.py -nf- i image.jpg B5:5B:13:08:F6:22

Status and future work

This script is a proof of concept. The goal was simply to make printing work. There are a lot of unknowns yet with regard to the actual printer communication. Help and PRs are welcome!

Todo:

  • Printer scanning & auto-detection
  • Text print

Metadata

Release files for pa6e 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pa6e 0.0.6
File Size Uploaded Provenance Actions
pa6e-0.0.6.tar.gz 6.1 MB Without provenance Details for pa6e-0.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pa6e 0.0.6
File Interpreter ABI Platform Actions
pa6e-0.0.6-py3-none-any.whl Python 3 none any Details for pa6e-0.0.6-py3-none-any.whl

Total release size: 6.1 MB

Release files / pa6e-0.0.6.tar.gz

Download URL pa6e-0.0.6.tar.gz
Size 6.1 MB
Tags Source
SHA-256 checksum
How to use checksums
07d33dea87fc0643bc31a69d4d73b52c7b65f78602855c1d6429ad025395431f
BLAKE2b-256 checksum
How to use checksums
ae80dd951f558f866e8d00e7b6ee087bd41172e1e4465337c4f764cc8f56b5b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.30

Release files / pa6e-0.0.6-py3-none-any.whl

Download URL pa6e-0.0.6-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92e6f7b97409baf974c0bf6ee252cde035009aad44da566eaeaa6b077f94ee66
BLAKE2b-256 checksum
How to use checksums
0da0cf4c8561c69d17d61ef97633d55eba6281d87b88ff399f154ec8fabf7aae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.30

Security for pa6e 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page