DantSu / ESCPOS-ThermalPrinter-Android

Useful library to help Android developpers to print with (Bluetooth, TCP, USB) ESC/POS thermal printer.
MIT License
1.18k stars 359 forks source link

Printing on Sunmi T1 not working #229

Closed mehdei closed 2 years ago

mehdei commented 2 years ago

Hello, I've the same example that you put it on GitHub ... I'm try to connect to Sunmi T1 built-in printer using Bluetooth ... everything goes well in the code (no exceptions), but I got nothing on the printer I've tried the Sunmi SDK and it works on the same device please may you check that

DantSu commented 2 years ago

https://github.com/DantSu/ESCPOS-ThermalPrinter-Android/issues/223#issue-1063124982 same answer as here

mehdei commented 2 years ago

Thanks for your response, but that's not the issue ... the library already reaches the printer (BluetoothConnection object), and the connect method goes well ... also, the code goes will with (printFormattedTextAndCut) method ... but printer show nothing

DantSu commented 2 years ago

You are sure that BluetoothPrintersConnections.selectFirstPaired() do not return null ?

mehdei commented 2 years ago

Yes, I've checked the debugger again and again ... that what lead me to check with Sunmi library. In your library everything goes fine in the debugger, but nothing on the printer ... your sample project connects to an old Bluetooth Printer I have it, works fine and print out

DantSu commented 2 years ago

On Sumni, do you have a button to active ESC/POS mode ?

DantSu commented 2 years ago

Is this printer compatible with ESC/POS commands ?

mehdei commented 2 years ago

Yes, you can set ESC/POS commands "ON" for the Sunmi device ... It's already "ON", and I've used the Sunmi library to send some text using ESC/POS commands ... Sunmi library it's not a fancy library ... you have to convert the command to an array of bytes then write it via the socket

mehdei commented 2 years ago

The thing that makes me crazy... your library allows me to print on ESC/POS printers via Bluetooth and WIFI very well... and Sunmi library allows me to print on its printer using ESC/POS commands... and I hardly find any difference in the process of connecting to the printer Now I'm trying to build a very simple library to call and send a test text on a Sunmi printer and on an Epson printer

mehdei commented 2 years ago

@iAmAndroidDeveloper thanks for you ... But I can connect to Sunmi printer or any other printer now by my own lib, but I'm try to use this neat library to handle escpos printers in a simple easy way.

iAmAndroidDeveloper commented 2 years ago

@mehdei Ok are you facing any issue now?

mehdei commented 2 years ago

@iAmAndroidDeveloper Yes, I'm try to connect to Sunmi T1 built-in printer using this library via Bluetooth ... everything goes well in the code (no exceptions), but I got nothing on the printer

iAmAndroidDeveloper commented 2 years ago

@mehdei Sunmi have a library for print with inbuilt printer?

mehdei commented 2 years ago

@iAmAndroidDeveloper Yes, it's not a fancy library, but it works and my own library also work with Sunmi built-in printer.

iAmAndroidDeveloper commented 2 years ago

@mehdei then what issue now you facing?

mehdei commented 2 years ago

@iAmAndroidDeveloper Thanks for you, but please try to read before asking, I've told you my issue in the last 23 hours, also it exists at the issue description and title ... you just came and commented with some code and start to ask the same question again and again (what is the issue?), please learn to read