12 Replies Latest reply on May 9, 2018 7:23 AM by d5db561e-b68b-46a3-8d17-2960ba4e4d0c

    Unable to open connection with Zebra KR203 using LinkOS/PC.NET

    d5db561e-b68b-46a3-8d17-2960ba4e4d0c

      Hello,

       

      I haven't been able to get the Zebra KR203 to work with the LinkOS/PC.NET SDK to read the printer's status. I'm having issues establishing a connection with the printer.

       

      Let me just start by saying that I can successfully discover the printer by calling:

      UsbDiscoverer.GetZebraUsbPrinters();
      

       

       

      But all the below attempts to connect to the printer failed:

       

      1) Opening a connection with the "DiscoveredPrinter" object throws an exception:

      foreach (DiscoveredUsbPrinter usbPrinter in UsbDiscoverer.GetZebraUsbPrinters())
      {
          var = usbPrinter.GetConnection();
          c.Open(); //throws a "ConnectionException"
      
          //Exception Details:
          //Zebra.Sdk.Comm.ConnectionException: Unable to connect to USB device '\\?\usb#vid_0a5f&pid_00b3#kr203#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}'
          //at Zebra.Sdk.Comm.UsbConnection.OpenPrinter()
          //at Zebra.Sdk.Comm.UsbConnection.Open()
          //at ZebraPrinter.ZebraOfficialSdk.GetPrinterSettings()
      }
      
      

       

      2) Querying the printer status through TCP always returns "IsReadyToPrint" even if it's out of paper or cover is open:

      var c = new TcpConnection("10.70.225.107", TcpConnection.DEFAULT_ZPL_TCP_PORT);
      c.Open();
      var printer = ZebraPrinterFactory.GetInstance(c);
      var printerStatus = printer.GetCurrentStatus();   //always returns "IsReadyToPrint"
      

       

       

      3) Opening a USB_DIRECT connection with the printer throws an exception:

      var connection = ConnectionBuilder.Build("\\\\?\\usb#vid_0a5f&pid_00b3#kr230#...");
      connection.Open(); //throws the below exception
      
      //Exception Details:
      //An unhandled exception of type 'Zebra.Sdk.Comm.ConnectionException' occurred in SdkApi_Desktop.dll
      //Additional information: Unable to connect to USB device '\\?\usb#vid_0a5f&pid_00b3#kr203#...'
      
      

       

       

      4) Opening a USB connection with the printer throws an exception:

      var connection = ConnectionBuilder.Build(@"USB:Zebra KR203");
      connection.Open();     //throws the below exception
      
      //Exception Details:
      //An unhandled exception of type 'Zebra.Sdk.Comm.ConnectionException' occurred in SdkApi_Desktop.dll
      //Additional information: No installed printer named Zebra KR203
      
      
      

       

      5) Attempting to print sample text using ZPL over TCP doesn't print anything (nor it does throw exceptions):

      var connection = new TcpConnection("10.70.225.107", TcpConnection.DEFAULT_ZPL_TCP_PORT);
      connection.Open();
      string zplData = "^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ";
      connection.Write(Encoding.UTF8.GetBytes(zplData)); //does not print any document
      
      

       

       

      Below is how our environment is setup:

      - Printer Model: Zebra KR203

      - Printer Driver: 1.3.510.109

      - LinkOS SDK PC-.NET v.2.13.898

      - Printer installed locally (not a network printer)

      - .NET Version: 4.7

      - OS: Win 7

       

      Any help would be appreciated, thanks.