Thermal_Printer icon indicating copy to clipboard operation
Thermal_Printer copied to clipboard

Support dodocool printers

Open cqx931 opened this issue 3 years ago • 8 comments

I am trying to get my dodocool printer to work with the library. Could you please add it to the library? Name: starpany200, Address: dc:0d:30:97:8c:83, manufacturer data: 0000dc0d30978c83, serviceUUID: e7810a71-73ae-499d-8c15-faa9aef0c3f2

characteristic UUID bef8d6c9-9c21-4c9e-b632-bd58c1009f9f

cqx931 avatar Dec 05 '21 07:12 cqx931

I tried to add the printer myself here: https://github.com/cqx931/Thermal_Printer/commit/8c9232ae5b976cd83a8cad720e33f0d09b98b26e So far I can get the connection established but it doesn't print anything. Is there anything I missed or got it wrong? Any kind of hint or help would be much appreciated!

cqx931 avatar Dec 05 '21 10:12 cqx931

If it uses the standard "ESC" command set, then you should not create a new type of printer. Add the name, but reuse the MTP2 printer type. Test to see that it works like a "normal" printer with the NRF Connect app on your phone. Write a short string of hex and terminate it with a CR; that should produce print output if you're using the correct service/characteristic.

bitbank2 avatar Dec 05 '21 18:12 bitbank2

Thank you for the reply!

Could you give me an example hex string that I can try? I'm not very familiar with hex and ESC/POS command set and I'm afraid that I might tried the wrong commands. So far I tried to send some random utf-8 string or the line feed command "0A" in hex directly using an BLE Scanner app but I didn't see any response. I also tried it with other services I see under the device but no luck so far.

WechatIMG54

cqx931 avatar Dec 06 '21 11:12 cqx931

Try using the 0x18f0 service and see if there's a write-only characteristic within it. Send the hex string: 0x41 0x42 0x43 0x0D

This should print "ABC" and advance the page 1 line

bitbank2 avatar Dec 06 '21 12:12 bitbank2

I tried it and still nothing happened. Maybe the model does not support the ESC/POS command set. I will try again with another model tomorrow.

Thank you for your help and the amazing library!

cqx931 avatar Dec 06 '21 12:12 cqx931

Try the other service UUID too. The characteristic you want will have Write, but not Notify.

bitbank2 avatar Dec 06 '21 13:12 bitbank2

So today I tried it with Phomemo T02 and the library works with esp32! However, I still can't get it working with the app with the above command even with this model, which gives me hope that my other printer could potentially work with the library...

Do you have an app suggestion one should use? I'm trying to understand what else I could potentially messed up here.

This is what I tried with T02:

WechatIMG56

cqx931 avatar Dec 07 '21 13:12 cqx931

So today I tried it with Phomemo T02 and the library works with esp32! However, I still can't get it working with the app with the above command even with this model, which gives me hope that my other printer could potentially work with the library...

Do you have an app suggestion one should use? I'm trying to understand what else I could potentially messed up here.

This is what I tried with T02:

WechatIMG56

@cqx931 I have a similar printer (Phomemo M02S). I tried different things. It can connect, but doesn't print correctly. Do you mind if you share what you did on your T02? I'm using ESP32 as well. Thank you so much!

raychmond avatar Jan 05 '22 19:01 raychmond