How to reset the bluetooth connection

// Expert user has replied.
d daniel Ppe 2 years 11 months ago
290 4 0

I have a problem,
When printing for the first time with zpl does it with no problem, but when it reprints no, it is as if I lost the Bluetooth connection, I have tried using the ConnectionReestablisher class, but I have not been able to use the zebra SDK.
I have this Singleton in Java:
 
public static Connection getInstance(String mac){
   if (printerConnection == null){
   printerConnection = new BluetoothConnection(mac);  try {
   printerConnection.open();   } catch (ConnectionException e) {
  e.printStackTrace();   Log.e(Properties.TAG, "The connection was not established because " +
   "the printer is turned off or is not a compatible device!",e);  return null;   }
  }
 
   return printerConnection;}
 
 
If you could help me, thank you!

Please register or login to post a reply

4 Replies

M Manuel Caicedo-Rivera

Daniel,

There are several possibilities of how you are getting this behavior with the printer.

1.)Time out of the printer or mobile computer, and/or Bluetooth is too short.
2.)As Zebra best practices, we recommend that you should open communication with the printer, verify status of the printer before to send the print job, transmit or send the file or print job to the printer, then you should close the port. It is possible that you are not re-opening the communication, or closing the communication in each cycle of transmission.
3.)Battery does not have enough energy.

If you want to know more about our Zebra's best practices for printing apps, please, review the link below.
Zebra Technologies - Best Practices in Creating a Printing Application for Zebra Printers

Please, let me know if this information was useful.

MC

d daniel Ppe

I have been testing and it prints me maximum 4 tickets, without closing the Bluetooth connection, but when sending the 5 ticket, send me the following Exception:

com.zebra.sdk.comm.ConnectionException: Could not connect to device:  is not a valid Bluetooth address
                                                               at com.zebra.sdk.comm.ConnectionA.open(Unknown Source)
                                                               at com.zebra.sdk.comm.BluetoothConnection.open(Unknown Source)

1. The battery is 100%

M Manuel Caicedo-Rivera

Hi Daniel,

Please, could you share with us the printer that you are using with your application and the version of the firmware.

Thanks,

MC

d daniel Ppe

I'm using iMZ320
Firmware V73.19.15Z

CONTACT
Can’t find what you’re looking for?