Bluetooth connection frequently disconnected when printing with zpl (Zebra ZQ620)

Viewed 557

Printer : Zebra ZQ620 Printer (Bluetooth v4.1)

Device : iPhone SE 2nd Gen (iOS14.6 / Bluetooth v5.0)

I recently developed an app to print via ZPL from an iOS device to a Zebra Printer as per the link below. (With ZEBRA Link-OS https://techdocs.zebra.com/link-os/2-13/ios/)

var sam = EAAccessoryManager.shared()
var connectedAccessories = sam.connectedAccessories

The code above retrieves the serial number of the Zebra printer after searching for a paired device.

thePrinterConn = MfiBtPrinterConnection(serialNumber: printerSerialNumber)
var success : Bool = thePrinterConn.open()
printer = try ZebraPrinterFactory.getInstance(thePrinterConn, with: PRINTER_LANGUAGE_ZPL)

After that, the following ZPL code is printed.

let printerStatusInitial = try printer?.getCurrentStatus();

All tasks are always processed by receiving the printer status after opening the printer connection as above.

caught: Error Domain=ZSDK_API_ERROR_DOMAIN Code=7 "Malformed status response - unable to determine printer status" UserInfo={NSLocalizedDescription=Malformed status response - unable to determine printer status}

However, sometimes after printing, the above exception occurs, and the paired printer cannot be found through EAAccessoryManager.shared(). If I look at Setting->Bluetooth, the connection is disconnected and then reconnected.

The strange thing is that an exception occurs in ios devices using Bluetooth 5.0(iPhone SE 2nd Gen, iPhone 11pro, iphone 12Pro), and there is nothing wrong with ios devices using Bluetooth 4.1(iPod touch 6gen, iPod touch 7gen).

What I tried before:

  • Upgrade Link-OS to 6.3 / Downgrade to 6.2
  • Turn off WLAN Mode on printer
  • Turn off BLE(Bluetooth Low Energy and use only Classic mode
  • Try another iOS version (11,12,13,14)
  • insert code like

thePrinterConn.setTimeToWaitForMoreData(ms)
thePrinterConn.setMaxTimeoutForRead(ms)

I have tried to search on zebra dev portal and found same issue but there is no any solution and reply. Please give me advise.

Thank you.

0 Answers
Related