andresperezmelo / print_bluetooth_thermal

Plugin para enviar bytes sin procesar a la impresora solo por ahora para Android
Other
27 stars 35 forks source link

Auto feed paper at every 2 minites #19

Closed YudizAndroidHardik closed 1 year ago

YudizAndroidHardik commented 1 year ago

I am using QSPrinter and facing auto feed paper after every 2 mins

Below are steps for reproducing this issue

  1. Connect Printer
  2. Print one receipt
  3. Do nothing after every 2 minutes it will print blank space automatically

Can anyone help out with this, please?

andresperezmelo commented 1 year ago

Keep in mind that the print codes are sent by the package esc_pos_utlis_plus it may be that it is sending some type of code that causes it to leave a space at the end, you can try another similar package to see if the problem persists on that printer

YudizAndroidHardik commented 1 year ago

@andresperezmelo Thank you for your response,

Yes agree with you, codes are sent by another package but I am assuming that this is an issue with the connection and I have facing this issue on this device only, other printers are working as expected

The reason for assuming this is that when I pass the command to print another package that comes into the process, the rest things are managed by our lib

It I let it be connected for 1 hour it will auto print 1-2 lines at every 2-3 mins.

Diving in the issue and trying to solve this

andresperezmelo commented 1 year ago

As you say, it works for other printers, each printer manufacturer manages the services offered by Bluetooth, it may be how it manages the codes that are sent to the printer, it may also be that the Bluetooth device offers a special service to connect, in The package uses the generic service to send data, in IOS two services are used, the generic and another service, your case would be a unique case of your device, to emulate the problem here you would have to have the same Bluetooth printer, which you could understand I can't buy that many printers, I have managed 3 58 mm printers and one 80 mm printer and I don't have that problem.

I don't know if your problem is Android or IOS, I think it must be Android, another option is to send the printer reset code after each print.

The packet uses the bytes to reset ASCII 27 64 10

In dart you can send yourself codes to reset it

List<int> reset2 = [27, 64, 10];
await PrintBluetoothThermal.writeBytes(bytes)

other codes I could try

It may be helpful to reset the printer in case it does not recognize a correct code, which may probably be your problem.