-
-
Notifications
You must be signed in to change notification settings - Fork 55
Cat Rabbit printer info
In general, cat printer use Little endian notation. It mean:
- 16 bit numbers are written as % 256 first and / 256 then.
- less significant bit is printed on left hand side (bit values 01234567)
Packet structure:
0x51 0x78 CC DD LL LH ....... CRC 0xFF
0x51 0x78 packet header (STX)
CC = mean command
DD = direction 0 - command (send to print) 1 - response (from printer)
LL = data_length lower byte ( length % 256 ; length & 0xFF)
LH = data_length upper byte ( length / 256 ; length >> 8)
data = effective data or command arguments
CRC = CRC 8 checksum of data (not command etc)
0xFF = packet terminator (ETX)
Known commands:
0xA0
Retract Paper - Data: Number of steps to go backward
0xA1
Feed Paper - Data: Number of steps to go forward
0xA2
Draw Bitmap - Line to draw. 0 bit -> don't draw pixel, 1 bit -> draw pixel
0xA3
Request device state - data = 0; device respond with notify with device state (see bellow)
0xA4
Set quality - data 0x31-0x36; for GB01 printer always 0x33, other values work same
0xA5
???
0xA6
control Lattice - Eleven bytes, all constants. One set used before printing, one after. (do not understand the command)
... Start Lattice 0xAA, 0x55, 0x17, 0x38, 0x44, 0x5F, 0x5F, 0x5F, 0x44, 0x38, 0x2C - used at begin of printing
... End Lattice 0xAA, 0x55, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17 - used at end of printing
0xA7
???
0xA8
Get device info - data 0
0xAE
line control - data 0x00 XOn / 0x10 XOff
0xAF
SetEnergy - Data: 1 - 0xFFFF
0xBD
Other Feed Paper - Data: one byte, set to a device-specific "Speed" value before printing and to 0x19 before feeding blank paper
0xBE
Drawing Mode - Data: 1 for Text, 0 for Images (text is not implemented!)
response bytes for 0xA3 - Get Device State
response 1 to 3 bytes
byte 1 bits:
1 - paper sensor (0x01) - paper not found or paper door open
2 - cover (0x02)
3 - head hot (0x04)
4 - low batery (0x08)
8 - BUSY (0x80) - May be in print progress. I don't undestand realtime or not request.
For receiving back response need set callback for notify. (on notification UUID)
bytes 2 and 3 are unknown for me.
Some examples:
0x51 0x78 0xA3 0x01 0x03 0x00 0x00 0x11 0x25 0xB9 0xFF
- normal print - when printer is powered on
0x51 0x78 0xA3 0x01 0x03 0x00 0x00 0x10 0x25 0xAC 0xFF
- normal print - after error
0x51 0x78 0xA3 0x01 0x03 0x00 0x01 0x1B 0x25 0x50 0xFF
- paper door open
0x51 0x78 0xA3 0x01 0x03 0x00 0x01 0x1B 0x25 0x50 0xFF
- no paper
Response for get device info: 0x51 0x78 0xA8 0x01 0x10 0x0 0x23 0x00 0x03 0x31 0x2E 0x31 0x2E 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xA3 FF
As ascii values:
0x23 #
0x00
0x03
0x31 1
0x2E .
0x31 1
0x2E .
0x32 2
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0xA3
0xFF
I see one Service UUID 0xAR30
with 6 Characteristics:
0xAE01
- Write no response - used for printing
0xAE02
- Notify - receive notifications for commands 0xA3 and 0xA8
0xAE03
- Write no response
0xAE04
- Notify
0xAE05
- Indicate
0xAE10
- Read, Write
Unfortunately do not know, what is purpose of last 4.
SoIC chip manufacturer: ZhuHai JieLi trchnology Co, Ltd www.zh-jieli.com https://github.com/orgs/Jieli-Tech/repositories
Thanks to Jindrich Fucik for providing this info. If you have more information, contact him please at