1 Reply Latest reply on Nov 24, 2018 7:35 AM by Javier Molina

    Printer itself is hard freezing when two clients connect simultaneously

    David Whitman

      Hello,

       

      We have one ZT410 and one ZD500R printer. We are able to completely lock them up using nothing but normal LinkOS methods on two different client devices.

      By "lock up" and "hard freeze", I mean that the hardware buttons on the printer do not do  anything. The display does not change. The web server no longer serves pages. Trying to connect using LinkOS times out.

      We are using LinkOS v2.14.5198.

       

      To reproduce this, we use two Android devices with the same code (device doesn't matter, can be emulator or real, any type). They both try to open a connection to the printer, print and image, and then close the connection. If this happens process starts roughly within 20 milliseconds of each other, the printer will often lock up.

       

      The code looks like this:

       

      Use NetworkDiscoverer.subnetSearch(handler, ipAddress) to get a DiscoveredPrinter.

      val connection = discoveredPrinter.getConnection()

      connection.open()

      Check if we are now connected. If not, bail (and try to call connection.close()).

      val printer = ZebraPrinterFactory.getLinkOsPrinter(connection)

      if printer.getCurrentStatus().labelsRemainingInBatch > 0, bail and close.

      if printer.getCurrentStatus().numberOfFormatsInReceiveBuffer > 0, bail and close.

      if printer.getCurrentStatus() is paper out, ribbon out, paused, head open, or anything other than ready, then bail and close.

      printer.printImage(ZebraImageAndroid(myBitmap, x = 0, y = 0, width = myBitmap.width, height = myBitmap.height, insideFormat = false)

      Poll using printer.getCurrentStatus() every 250 ms for labelsRemainingInBatch and numberOfFormatsInReceiveBuffer to both be 0.

      Finally, connection.close()

       

      If two Android apps launch these steps "at the same time" (< 20ms), the printer often hard freezes. From what I remember, just calling ZebraPrinterFactory.getLinkOsPrinter(...) at the same time is enough to freeze it.

       

      From my point of view, a client should *never* be able to cause the server, especially an enterprise-type printer, to die.

      Our scenario is that multiple people might try printing labels from the printer and if they press the Print button at the same time, somebody will need to physically restart the printer, which is rather awful.

       

      I have seen this article: ZebraLink SDK intermittent connectivity or connection freezes

      It says that the exact thing we are trying to achieve can be problematic. However, I am unclear on whether the article is saying that the *printer* might freeze, or just that the *clients* might wind up with problems connecting to the printer.

      I'm also not sure if "ZebraLink SDK" and "Zebra LinkOS SDK" are two different names for the same thing. That seems to be the case.

       

      Is this a known issue? Is there any resolution?