NaitLee / Cat-Printer

Application supporting Bluetooth thermal “Cat Printers”, for everyone!
GNU General Public License v3.0
334 stars 33 forks source link

Add support for YT01 model #23

Closed williamd1k0 closed 2 years ago

williamd1k0 commented 2 years ago

I bought this model recently and ended up getting a little frustrated because the only way to use it was through a suspicious mobile app. I will be very grateful if you can add support for this model. I can help you with any information, testing and maybe even coding.

Recommended app: (iBleem) https://play.google.com/store/apps/details?id=com.bleem.liugm

Thank you so much for working on this project.

NaitLee commented 2 years ago

I see it's yet another brand. I'm gonna try another app, because it's a) by same vendor, b) looks cleaner ok, still that dirty, c) seems made for world I think it's also machine translated... "also"... I don't think it's a fast process, since it's really different.

NaitLee commented 2 years ago

Hi, you may help me to find the Bluetooth "Characteristics" of YT01. Use nRF Connect, open the printer, find it with "Scanner" and see what's inside.

(the original app has really bad UI logic)

williamd1k0 commented 2 years ago

(the original app has really bad UI logic)

Yeah :sweat_smile:, I've tried this "Fun Print" now and it's actually the same as iBleem with slight differences in the UI.

Screenshot_20220504-021213

Some pics: IMG_20220504_021652 IMG_20220504_021907

Use nRF Connect, open the printer, find it with "Scanner" and see what's inside.

Ok, I will try it out.

williamd1k0 commented 2 years ago
Screenshots ![Screenshot_20220504-024457](https://user-images.githubusercontent.com/10428035/166629116-e8d4c97d-6c51-4246-8cb3-43e23b4dae63.png) ![Screenshot_20220504-024515](https://user-images.githubusercontent.com/10428035/166629121-804ded81-f779-49d3-babc-af259c4b4eb7.png) ![Screenshot_20220504-024532](https://user-images.githubusercontent.com/10428035/166629127-cdcfcadb-205d-49a8-a8d8-a5fdf6f5d6d7.png) ![Screenshot_20220504-024537](https://user-images.githubusercontent.com/10428035/166629135-ddb28272-9b80-4239-8626-f5877b2ebca8.png) ![Screenshot_20220504-025029](https://user-images.githubusercontent.com/10428035/166629176-085215e2-eca1-403e-ba97-64fa49520e26.png) ![Screenshot_20220504-025044](https://user-images.githubusercontent.com/10428035/166629186-a431ea71-cb7b-43d0-a963-b2294c83c959.png) ![Screenshot_20220504-025055](https://user-images.githubusercontent.com/10428035/166629197-0adef066-06cd-43aa-afaf-bfe69791f9c2.png) ![Screenshot_20220504-025101](https://user-images.githubusercontent.com/10428035/166629205-0785b9bd-2d56-4ac9-b145-793ad6fe6417.png) ![Screenshot_20220504-025118](https://user-images.githubusercontent.com/10428035/166629213-2269c930-d93c-4830-866f-07b6de353e15.png) ![Screenshot_20220504-025128](https://user-images.githubusercontent.com/10428035/166629216-e53da928-7c7e-4858-ac3f-31a2a61a4a09.png)
Log 2022-05-04 02_47_13.txt ``` nRF Connect, 2022-05-04 YT01 (33:9F:3E:E3:1F:63) V 02:45:45.750 Connecting to 33:9F:3E:E3:1F:63... D 02:45:45.750 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE) D 02:45:46.935 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED D 02:45:46.974 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2) I 02:45:46.975 Connected to 33:9F:3E:E3:1F:63 D 02:45:46.980 wait(1600ms) V 02:45:48.582 Discovering services... D 02:45:48.582 gatt.discoverServices() D 02:45:48.617 [Callback] Services discovered with status: 0 I 02:45:48.617 Services discovered V 02:45:48.669 Generic Access (0x1800) - Device Name [R W] (0x2A00) Unknown Service (0000ae30-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [WNR] (0000ae01-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [N] (0000ae02-0000-1000-8000-00805f9b34fb)    Client Characteristic Configuration (0x2902) - Unknown Characteristic [WNR] (0000ae03-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [N] (0000ae04-0000-1000-8000-00805f9b34fb)    Client Characteristic Configuration (0x2902) - Unknown Characteristic [I] (0000ae05-0000-1000-8000-00805f9b34fb)    Client Characteristic Configuration (0x2902) - Unknown Characteristic [R W] (0000ae10-0000-1000-8000-00805f9b34fb) Unknown Service (0000ae3a-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [WNR] (0000ae3b-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [N] (0000ae3c-0000-1000-8000-00805f9b34fb)    Client Characteristic Configuration (0x2902) D 02:45:48.670 gatt.setCharacteristicNotification(0000ae02-0000-1000-8000-00805f9b34fb, true) D 02:45:48.673 gatt.setCharacteristicNotification(0000ae04-0000-1000-8000-00805f9b34fb, true) D 02:45:48.677 gatt.setCharacteristicNotification(0000ae05-0000-1000-8000-00805f9b34fb, true) D 02:45:48.681 gatt.setCharacteristicNotification(0000ae3c-0000-1000-8000-00805f9b34fb, true) ```
NaitLee commented 2 years ago

Oh thank you, it's very detailed 😄 Next step for me is to trick the app to send data, dump it & analyze. The tool is also nRF Connect. And I feel these steps are universal and worth to make a tutorial later 🙃

The printer is completely different, maybe including communication "magic data". Let me gather more...

NaitLee commented 2 years ago

Oh, wait, Services/Characteristics UUID needs to be full. Long tap on each entry (and sub-entry) in connected YT01 "Client", on right-top there's copy button. Put them in a text file, and be sure to label corresponding Properties (read, write, notify, etc) It's a repeating process, but maybe worthwhile 😉

NaitLee commented 2 years ago

Some side notes:

In order to really support all YTXX I think we need more people, for sharing & testing. But I have no ability to do them all by myself 😢

I will continue slowly.

EDIT: just now I see the "magic data" is likely to be the same (or very similar) as GBXX models.

williamd1k0 commented 2 years ago

Oh, wait, Services/Characteristics UUID needs to be full. Long tap on each entry (and sub-entry) in connected YT01 "Client", on right-top there's copy button. Put them in a text file, and be sure to label corresponding Properties (read, write, notify, etc) It's a repeating process, but maybe worthwhile :wink:

No problem, I'll do that as soon as possible! (I'm a bit busy right now)

williamd1k0 commented 2 years ago

It's a repeating process, but maybe worthwhile

Thanks to KDE Connect I was able to share the text directly to my PC instead of copying/pasting everything manually :sweat_smile:

Let me know if anything is still missing.

Generic Access:
  UUID: 0x1800
  PRIMARY SERVICE:
    Device Name:
      UUID: 0x2A00
      Properties: READ, WRITE
      Parsed value: YT01
      Raw value: (0x) 59-54-30-31, "YT01"

Unknown Service:
  UUID: 0000ae30-0000-1000-8000-00805f9b34fb
  PRIMARY SERVICE:
    Unknown Service:
      UUID: 0000ae01-0000-1000-8000-00805f9b34fb
      Properties: WRITE NO RESPONSE
    Unknown Service:
      UUID: 0000ae02-0000-1000-8000-00805f9b34fb
      Properties: NOTIFY
    Unknown Service:
      UUID: 0000ae03-0000-1000-8000-00805f9b34fb
      Properties: WRITE NO RESPONSE
    Unknown Service:
      UUID: 0000ae04-0000-1000-8000-00805f9b34fb
      Properties: NOTIFY
    Unknown Service:
      UUID: 0000ae05-0000-1000-8000-00805f9b34fb
      Properties: INDICATE
    Unknown Service:
      UUID: 0000ae10-0000-1000-8000-00805f9b34fb
      Properties: READ, WRITE
      Parsed value: (0x) 00-00-00-00
      Raw value: (0x) 00-00-00-00

Unknown Service:
  UUID: 0000ae3a-0000-1000-8000-00805f9b34fb
  PRIMARY SERVICE:
    Unknown Service:
      UUID: 0000ae3b-0000-1000-8000-00805f9b34fb
      Properties: WRITE NO RESPONSE
    Unknown Service:
      UUID: 0000ae3c-0000-1000-8000-00805f9b34fb
      Properties: NOTIFY
NaitLee commented 2 years ago

I see they are just very alike. Please test if this brute way would work:

Edit: I've made this change in newest commit. You can simply try it by cloning repo.

williamd1k0 commented 2 years ago

It's working!! IMG_20220505_130652

NaitLee commented 2 years ago

Ah great 😄 So next times I should not overlook other models. They have big chance to be the same 😅 But who knows when I will meet a really different one...

Side note: this appearance (printer face) is the newest kind of my local Online store Off-topic: our laptop is very similar

williamd1k0 commented 2 years ago

Off-topic: our laptop is very similar

Hehe, mine is a Lenovo Ideapad S145.

So, I will close the issue now. Thanks again for working on this project, it's really helpful. I will definitely help improve the app (UI, features, i18n etc) in the future, one thing I was looking forward to before buying the printer was this specific project: https://github.com/receiptline/receiptline (I really like to automate things through the command-line :sweat_smile:).

braintapper commented 2 years ago

FWIW, I was able to get my cat printer model (MX05) to work using the YT01 settings.

NaitLee commented 2 years ago

So there are many "unknown but supported" models. That may mean I should put a "Test other devices" feature, with existing settings :)