MacOS app which allows drag and drop of images to BLE thermal printers

Related tags

Bluetooth Print2BLE
Overview

Print2BLE

Copyright (c) 2021 BitBank Software, Inc.
Written by Larry Bank
[email protected]

Print2BLE
What is it?

This project is a MacOS GUI application to print image files on inexpensive Bluetooth Low Energy thermal printers. It allows you to drag supported image files (e.g. JPEG, PNG, BMP, TIFF, GIF) onto a window, convert them to 1-bpp dithered and then send them to the printer.

Why did you write it?

I've been experimenting with BLE thermal printers on microcontrollers and wanted to explore BLE client (central) programming on MacOS to talk to these same devices. This then morphed into the idea of making a simple drag+drop app to allow printing of images. By sharing this code, hopefully other people will find it a useful resource for info about BLE programming, manipulating images, and communicating with 'unsupported/undocumented' thermal printers.

How to use it?

Upon running the app, you will be presented with a window containing 2 push buttons. The connect button will scan for supported printers and connect to the first one it finds. The status text will update to show that it connected to the named device. Next, drag an image onto the window from the Finder. A preview will display how it will look on paper. If you're satisfied with the results, press the print button.

What printers does it support?

It currently supports the GOOJPRT PT210/MTP-2, MTP-3, 'cat/pig/panda' and PeriPage 304pi A6. As I get info for other printers, I'll add support for them too.

If you find this code useful, please consider becoming a sponsor or sending a donation.

paypal

Comments
  • Spool more paper after printing

    Spool more paper after printing

    Just tried this and it works! Thanks for making this.

    One request would be to have the printer spool more paper after printing so that the bottom of the image is not cut off and there is some whitespace between print jobs. Thanks.

    opened by jauderho 6
  • Can't connect

    Can't connect

    Steps to replicate:

    Power up the printer. The printer is flashing a blue LED. When I run the app (from the binary in the zip file), and click on Connect, nothing happens:

    ScreenFlow

    I am using: Cat thermal printer "MINI Printer", which registers as bluetooth name "MX06" using the official Fun Print iOS app MacBook Pro M1 running MacOS 12.4

    Any advice for fault finding appreciated

    opened by tomhannen 5
  • Fails to build and to start on MacOS 13 Ventura

    Fails to build and to start on MacOS 13 Ventura

    Debug fails with

    2022-11-17 22:08:09.379362+0100 Print2BLE[76575:1578471] *** Assertion failure in _NSTrackingAreaViewHelper *trackingAreaHelper(NSView *)(), winTrackingAreas.m:168 2022-11-17 22:08:09.379625+0100 Print2BLE[76575:1578471] Failed to set (contentViewController) user defined inspected property on (NSWindow): _trackingAreaHelper not allocated yet!

    I am discovering XCode and ObjectiveC and can only report.

    opened by rpilotte 4
  • Create a Wiki Page with sources to buy printers?

    Create a Wiki Page with sources to buy printers?

    Maybe it makes sense to create a link with (affiliate) links to buy a printer so that users can buy them directly from the project and maybe support it?

    opened by plaetzchen 4
  • Consider moving zip file to Releases?

    Consider moving zip file to Releases?

    Thanks for adding the feed button, going to try it out now.

    Rather than commit the binary/zip to the repo, it might be a good idea to have it on the Releases page instead.

    opened by jauderho 3
  • Support for older MacOS versions

    Support for older MacOS versions

    Would it be possible to make this app (or a version of it) compatible with 10.14 (Mojave)? I tried using xcode to export it to other versions but it just gives me errors like these:

    /Applications/peripage/Print2BLE/Print2BLE/ViewController.m:46:5: Expression result unused

    /Applications/peripage/Print2BLE/Print2BLE/MyBLE.m:112:30: Sending 'MyBLE *const __strong' to parameter of incompatible type 'id<CBPeripheralDelegate> _Nullable'

    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeripheral.h:62:63: Passing argument to parameter 'delegate' here

    opened by LordRembo 3
  • MTP-II versus MTP-2

    MTP-II versus MTP-2

    My device (GOOJPRT) announces itself as "MTP-II" instead of "MTP-2" and is thus not picked up by the macOS application.

    Is there anything I missed to select this device?

    opened by uvwxy 3
  • Is it possible to use the protocol in iOS project?

    Is it possible to use the protocol in iOS project?

    From other repositories for Peripage bluetooth projects, they said the Peripage printer use RFCOMM SPP protocol to send and receive data. But this project uses BLE which is totally different.

    1. If Peripage uses BLE for communication between Peripheral and Central, I think it can be used in iOS project?
    2. Will it be possible to support Paperang Printer?
    opened by caichunjian520 2
  • Support for

    Support for "SB200" printer

    Could you add support for the "Jooheli" Brand printer? It identifies as "SB200" over Bluetooth and under Systeminformation it shows the following Informations:

    SB200: Adresse: 00:1D:DF:70:4C:CB Hersteller-ID: 0x0057 Produkt-ID: 0x0005 Firmwareversion: 0.0.7 Minor Type: GenericAudioVideo RSSI: -80 Dienste: 0x800018 < AVRCP A2DP ACL >

    thanks in advance :)

    opened by Madad1996 2
  • Image prints are truncated

    Image prints are truncated

    On a GB03 printer (PR #7) everything appears to be OK, but the prints are too "short" - only about ~20% of the image (vertically) is printed. Unclear whether this is something to do with the height calculation - the preview image shows up correctly in the window after being dropped in.

    opened by andypiper 2
  • Add support for Royal PT-300

    Add support for Royal PT-300

    I have a Royal PT-300 receipt printer, which supports both Classic Bluetooth and BLE. In order to make BLE work, I had to connect to the printer in setup mode and set the printer to "label mode". Once I did that, the printer started broadcasting as Printer_{first 4 hex of MAC address} i.e. Printer_AAAA. I added Printer_ to the list of valid printer names, and I was able to print images from my Mac using your library without any issues, so adding Printer_ to this list should be an easy way to add support for the Royal PT-300.

    One thing I noticed is with larger images, I saw some buffer overrun issues. One image printed with part of it sheared off, and another printed garbled text. This usually happens when the source device's buffer is overwhelmed or when some data is written to the stream but is lost, which results in the printer's ESC/POS commands getting offset. I wonder if there's some issue with the BLE implementation where it's losing bits somewhere, or if this is specific to my printer (and likely a buffering issue)? I don't see the same issue using my library ESCPOS_NET and printing over WiFi to the printer, but the WiFi chip and the BLE chip may have different buffer sizes or something.

    opened by lukevp 1
Owner
Larry Bank
Call me Mr. Optimization. I optimize other people's code for a living.
Larry Bank
BluetoothKit Easily communicate between iOS devices using BLE.

BluetoothKit Easily communicate between iOS devices using BLE. Background Apple mostly did a great job with the CoreBluetooth API, but because it enca

Rasmus Høhndorf Hummelmose 2.1k Jan 8, 2023
RxBluetoothKit is a Bluetooth library that makes interaction with BLE devices much more pleasant.

RxBluetoothKit is a Bluetooth library that makes interaction with BLE devices much more pleasant. It's backed by RxSwift and CoreBluetooth and it prov

Polidea 1.3k Jan 6, 2023
BLE (Bluetooth LE) for U🎁 Bleu is the best in the Bluetooth library.

Bleu Bleu is a Bluetooth library. Bleu is the easiest way to operate CoreBluetooth. Bleu is possible to operate by replacing Bluetooth 's Peripheral a

1amageek 484 Dec 29, 2022
The easiest way to use Bluetooth (BLE )in ios,even bady can use.

The easiest way to use Bluetooth (BLE )in ios,even bady can use.

刘彦玮 4.6k Dec 27, 2022
Swift implementation of Xiaomi's BLE authentication

MiAuth Xiaomi M365/Mi Authentication library written in Swift. Features M365 Authentication Mi Authentication (WIP - Login doesn't work reliably yet)

null 2 Jul 27, 2022
A very simple library to discover and retrieve data from nearby devices (even if the peer app works at background).

Discovery: A simple library to discover and retrieve data from nearby devices. Discovery is a very simple but useful library for discovering nearby de

Ömer Faruk Gül 412 Dec 19, 2022
An app for questioning people to try on different names and pronouns. A winner of the Swift Student Challenge 2022.

DiscoverMe is an app for questioning, trans, nonbinary, and gender-nonconforming people to try on different names and pronouns that better suit their

Joshua Tint 6 Oct 2, 2022
🌍 Nearby earthquake tracking app

Earthquake Tracker Description An application for tracking earthquakes in a radius of 2500 km from the user's location in the last month. Information

Anastasia Bespalova 0 Dec 9, 2021
Nearby earthquake tracking app

Earthquake Tracker Description An application for tracking earthquakes in a radius of 2500 km from the user's location in the last month. Information

Anastasia Bespalova 0 Dec 9, 2021
Artsy Folio, The Partner iPhone / iPad app.

The iPhone and iPad app that brings all the Partners to the yard. Meta State: production Point People: @orta CI : This is a core Artsy Mobile OSS proj

Artsy 4 Dec 23, 2022
MiniVendingMachine - SwiftUI demo Apple Watch app to open a mini vending machine via bluetooth

Mini Vending Machine Use Apple Watch to open vending machine cells. Note: This a

CGH 3 Apr 8, 2022
CombineCoreBluetooth is a library that bridges Apple's CoreBluetooth framework and Apple's Combine framework

CombineCoreBluetooth is a library that bridges Apple's CoreBluetooth framework and Apple's Combine framework, making it possible to subscribe to perform bluetooth operations while subscribing to a publisher of the results of those operations, instead of relying on implementing delegates and manually filtering for the results you need.

Starry 74 Dec 29, 2022
Blocks Based Bluetooth LE Connectivity framework for iOS/watchOS/tvOS/OSX. Quickly configure centrals & peripherals, perform read/write operations, and respond characteristic updates.

ExtendaBLE Introduction ExtendaBLE provides a very flexible syntax for defining centrals and peripherals with ease. Following a blocks based builder a

Anton 94 Nov 29, 2022
AZPeerToPeerConnectivity is a wrapper on top of Apple iOS Multipeer Connectivity framework. It provides an easier way to create and manage sessions. Easy to integrate

AZPeerToPeerConnection Controller Features Multipeer Connectivity Connection via Bluetooth or Wifi No need write all session, browser, services delega

Afroz Zaheer 66 Dec 19, 2022
The official Swift Library for Vital API, HealthKit and Devices

vital-ios The official Swift Library for Vital API, HealthKit and Devices Install We currently support SPM. Documentation Please refer to the official

Vital 17 Dec 22, 2022
The Bluetooth LE library for iOS and Mac. 100% Swift.

iOS-BLE-Library An in-development Bluetooth Low Energy Library by Nordic Semiconductor to interact with the , which is not complicated, but requires w

Nordic Semiconductor 6 Dec 19, 2022
An iOS and macOS app for controlling Klipper-based 3d Printers using Moonraker

Plastic An iOS and macOS app for controlling Klipper-based 3d Printers using Moonraker GIT ALERT The contents of the repository was recently squashed

null 28 Dec 30, 2022
A macOS application displaying the thermal, voltage and current sensor values.

Sensors About A macOS application displaying the thermal, voltage and current sensor values. License Project is released under the terms of the MIT Li

Jean-David Gadina 82 Jan 3, 2023
FlutterNativeDragAndDrop - A package that allows you to add native drag and drop support into your flutter app

native_drag_n_drop A package that allows you to add native drag and drop support

Alex Rabin 21 Dec 21, 2022
This component allows for the transfer of data items between collection views through drag and drop

Drag and Drop Collection Views Written for Swift 4.0, it is an implementation of Dragging and Dropping data across multiple UICollectionViews. Try it

Michael Michailidis 508 Dec 19, 2022