top | item 42785154

(no title)

namero999 | 1 year ago

Funny, just today I finished reversing a similar toy printer, the "bear" printer, not the "cat" one, and writing a driver/library for it in Rust just for the sake of finally learning a bit of it.

Looking at the code you shared, it seems like the cat has quite a different protocol than the bear. The opcodes seem different, and there seems to be some sort of crc happening that is completely absent in the bear. So I doubt my code will work without major adjustments.

In case you missed it, the first link you shared also has a "test unknown printer", so maybe yours is just a minor hardware iteration but might work nonetheless!

discuss

order

mrtksn|1 year ago

I managed to get it going through inspecting the bluetooth packages, now building my app for it. Couldn't get the correct image output yet but it appears to be simple, just have to send the image line by line

namero999|1 year ago

Most likely the logic is at least similar. Yes, line by line, each line is encoded in bytes where each bit is a pixel. I had to "invert" the image as the printer will print the "white" pixels (those with a value >0).

The printer has an internal buffer so you can send multiple lines at the same time, but on the bear this starts to break down after 200 lines or so (consider that the bear has a higher 300 dpi resolution, so 576 pixel per line). Also pay attention to overheating, I put 1 or 2 seconds of pause every 400 lines just in case.