9 Replies Latest reply on Jan 19, 2018 12:10 PM by John Colagioia

    KR403 Status from Electron App

    John Colagioia

      I'm currently working on an Electron app for a Kiosk using the KR403 printer.  We have received a requirement to display when the printer is unavailable, there's a paper jam, and paper is low/out.

       

      Looking at some options, Browser Print seemed like the best bet.

       

      After including it on the main page (for testing) with a script tag, I'm able to call BrowserPrint.getLocalDevices() and find the printer, including that it's connected via driver and so forth.  However, if I then call (following the demo code's checkPrinterStatus()) printer.sendThenRead("~HQES", ...) with that object, the response is an empty string.

       

      Any thoughts as to where the disconnect is between the first call and the second?

       

      Thanks!

        • Re: KR403 Status from Electron App
          Manuel Caicedo-Rivera

          Hi John,

           

          Zebra has not tested KR403 against Browser Print. I will recommend internally to include this printer in our test routines for the upcoming releases. However, the usual technical questions to start to debug the issue would be among others; Did you check if the printer has installed the latest version of the printer? If so, what type of browser are you using, and what OS is your computer based?

           

          Thanks, 

          MC

            • Re: KR403 Status from Electron App
              John Colagioia

              Thanks for your response.

               

              This is running from Electron (Webkit from Chrome repackaged as a desktop application, so not an actual web browser) on Windows 7.  I'm don't know what's running on the printer; it's as-shipped with no indication in anything we received about upgrading.

               

              Assuming that Browser Print isn't supported for this case, what options might work?  This application is part of a suite that uses a number of other languages, so this piece doesn't necessarily need to be written in JavaScript as long as it produces the status information.

            • Re: KR403 Status from Electron App
              Manuel Caicedo-Rivera

              John,

               

              Were you able to print something? have you tried to do the same(a test with ~HQES) with standard PC and Zebra Setup utilities, so we can verify that the printer is not the issue? What is the firmware version of the printer?

                • Re: KR403 Status from Electron App
                  John Colagioia

                  Printing works consistently.  The printer properties About page refers to the "Windows driver for ZDesigner KR403, Version 5.1.16.6447."

                   

                  I don't quite see how to run the suggested test.  The closest I can find is the Zebra OPOS Test Application, where I can put ~HQES into the "Print Data" box, but none of the various Print buttons appear to accomplish anything.

                   

                  The test application does show "Paper Near End Warning" (the sensor is hanging off the end of the table), also, so the printer is at least returning that information there.

                    • Re: KR403 Status from Electron App
                      Manuel Caicedo-Rivera

                      John,

                       

                      Ok, so we have access to the printer, and it prints well. The test that I am suggesting is through our tool Zebra Setup Utilities(ZSU), you can download it from the link below

                      Printer Setup Utilities | Zebra

                      Then, you install the app, install the driver for the app in ZSU, and run the following tests. If you type the command ~HI, the printer will give you back the model of the printer, the version of the firmware and the bytes available on memory.

                       

                      Please, let me know what you got.

                      MC

                        • Re: KR403 Status from Electron App
                          John Colagioia

                          Ah, thanks for that reference.

                           

                          So far so good.  ~HI returns:

                           

                          KR403-200dpi,V66.17.11Z,8,3128KB,CUTTER DETECTED

                          And ~HQES returns:

                           

                            PRINTER STATUS                       
                             ERRORS:         0 00000000 00000000 
                             WARNINGS:       1 00000000 00000038 

                          ...with the right-angle delimiter characters at the beginning and end, of course.  They just didn't survive the copy/paste.

                           

                          So, it sounds like Browser Print is where the disconnect is occurring, yes?  "~HI," there, also returns an empty string.

                            • Re: KR403 Status from Electron App
                              John Colagioia

                              Ah-ha!

                              When I called BrowserPrint.getLocalDevices(), I picked the last item, which had the printer name in it.  It looks like the correct solution was actually to pick the device with the connection "usb."  That version responds to "~HQES."

                              So, question as a result of this:  Since the name of that printer is a nonsensical string ("5&de37f6b&0&7"), do we need to assume that there is only one printer or is there some way of distinguishing between printers if multiple are somehow present?

                              (And thanks very much for the help getting me to that point!)

                               

                              Or...maybe not.  The analysis code from the demo only seems to return "Ready to Print," even if the head is up.

                              • Re: KR403 Status from Electron App
                                Manuel Caicedo-Rivera

                                John,

                                 

                                Browser Print has not been tested against Electron, however, I was checking some references about Electron, and it is possible that version we used for our JS library in Browser Print could not compatible with the version of Electron. It will demand more research, I'm sorry not be more useful at this time. You could help us collecting some data from the browser when you send these commands, I hope you can capture some type of exception or errors on JS or HTML that can infer any type of workarounds later. Also, it is important to know that Browser Print uses the 9100 port to establish a communication bridge through USB ports, so if any other app like Skype is using the port, it will block the bi-directional communication with the printer. The recommendation here would be exit the Skype, and re-start Browser Print, then Skype later will look for another port available when it is re-initiated.

                                 

                                Thanks,

                                 

                                MC

                                  • Re: KR403 Status from Electron App
                                    John Colagioia

                                    Digging deeper, it appears that the "Ready to Print" issue was because the format is different than in the Browser Print demo.  That is, where it checks text.charAt(70) (line #102 of DevDemo.js), the output has the number of errors at character 66.

                                     

                                    This will require a bit more work to find the paper statuses, but I believe we can make this work.  Thanks again for your help.