Now Hiring: Are you a driven and motivated PHP (Laravel) Developer ?

Portable Bluetooth Thermal Printer Goojprt PT-210

3614533079_w640_h640_printer-chekov-rro
News

Portable Bluetooth Thermal Printer Goojprt PT-210

Portable Bluetooth Thermal Printer Goojprt PT-210

Version: PT2D-6004

Interfaces: Bluetooth 4.0 (classic/bluetooth low energy), Mini USB

Print method: Line thermal printer

Dot per line: 384 dots/line

Commands: ESC/POS compatible with order sets

Internal characters: ASCII CH, GB18030

Text/Graphic support: english, russian, ukrainian, figure, symbol, chinese, graph, curve, icon pre-stored, 9 barcodes, QR code, PDF417

We had used this printer in some pet projects. We don’t have a full bluetooth spec so do some research.

1Screenshot_20230414_155927
After power on this printer starts advertising bluetooth packets.

As you can see on the screenshot this device supports bluetooth classic and bluetooth low energy protocols.

Advertising packet contains two services:

UUID = 0x18F0 (000018f0-0000-1000-8000-00805f9b34fb) – its a standard battery service

UUID = e7810a71-73ae-499d-8c15-faa9aef0c3f2 – its a custom service

Connect to printer by bluetooth and discover services:

2Screenshot_20230414_160521
There are 4 services:

uuid=”000018f0-0000-1000-8000-00805f9b34fb” (battery)

uuid=”0000fee7-0000-1000-8000-00805f9b34fb” (Custom UUID of Tencent Holdings Limited)

uuid=”e7810a71-73ae-499d-8c15-faa9aef0c3f2″ (Custom printer service)

uuid=”49535343-fe7d-4ae5-8fa9-9fafd205e455″ (ISSC Proprietary Service, UART ISSC dual mode)

3Screenshot_20230414_160521
and characteristics:
(Battery service)
(Custom UUID of Tencent Holdings Limited)
(ISSC Proprietary Service)
(Custom printer service)
To print a text we try to use characteristic uuid=”bef8d6c9-9c21-4c9e-b632-bd58c1009f9f” but in fact write operation is not available for this characteristic.
4Screenshot_20230420_132418

We able to print a text using another characteristic uuid=”49535343-8841-43f4-a8d4-ecbe34729bb3″ (ISSC Transparent RX)

You could prepare commands manually or use a library. For example:

“com.github.anastaciocintra:escpos-coffee:4.1.0”

To print “CITRUSDEV” you should convert this text into UTF-8 hex bytes (ASCII table) and add LF CR in hex (new line)


//text.toByteArray(Charsets.UTF_8)

val bytes = byteArrayOf(0x43, 0x49, 0x54, 0x52, 0x55, 0x53, 0x44, 0x45, 0x56, 0x0A, 0x0D)

val characteristic: BluetoothGattCharacteristic = bluetoothGatt.getService(serviceUUID).getCharacteristic(characteristicUUID)

characteristic.value = bytes

characteristic.writeType = BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE

bluetoothGatt.writeCharacteristic(characteristic)

img5
You could set different text style, alignment, font size or print image by sending ESC command (0x1B) and params.
img6

Authored by Maksym Baidala.