Cant print on printer Qln420 over network or bluetooth

Hi all i have this devices:

1 Zebra Printer model: qln420   (connection wireless and Bluetooth)

1 Pocket Honeywell, model 60sL0 with Windows Embeed HandHeld 6.5 Classic. (connection wireless and Bluetooth)

my scenario:

20150829_124827.jpg

1) conected the pocket to wireless and can surf on internet (google.com)  (https://www.honeywellaidc.com/CatalogDocuments/7600User%20Guides/DEMOS%20WM%2060%20User%20Guide.pdf)

2) connected the printer via wireless same as described here: https://www.zebra.com/content/dam/zebra/manuals/en-us/networking/mobile-wireless-config-qsg-en.pdf

20150829_123144.jpg

20150829_123148.jpg

20150829_123151.jpg20150829_123155.jpg20150829_123222.jpg20150829_123226.jpg20150829_123228.jpg20150829_123235.jpg20150829_123323.jpg

static ip: 172.16.11.207

i can ping  from my computer to the ip: 172.16.11.207

 

20150829_123346.jpg

i tested these code on C#:

private void button1_Click(object sender, EventArgs e)

        {

            string ipAddress = "172.16.11.207";

            int port = 6101;

            port = 6101;

            // CPCL Command(s)

            string CPCLString = "! 0 200 200 580 ! UTILITIES" + Environment.NewLine + "BARCODE 128 .4 2 10 6 58 12345678" +

                               "FORM" + Environment.NewLine + "PRINT"+ Environment.NewLine;

            try

            {

                // Open connection

                System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient();

                client.Connect(ipAddress, port);

                // Write CPCL String to connection

                System.IO.StreamWriter writer =

            new System.IO.StreamWriter(client.GetStream());

                writer.Write(CPCLString);

                writer.Flush();

                // Close Connection

                writer.Close();

                client.Close();

            }

            catch (Exception ex)

            {

                // Catch Exception

            }

 

        }

 

3) run the program and click on the button, no error, but too not print anything.

 

4) tested too these Java code:

 

cod= "! 0 200 200 210 1\n" +

     "TEXT 4 0 30 40 Hello World\n" +

     "FORM\n" +

     "PRINT";

if (dp.conectarZebra(ip)) {

            System.out.println("Imprimiendo    " + cod);

            dp.sendZebra(cod);

            dp.closeZebra();

            return true;

         } else {

            System.out.println("Error no se conecto a la impresora " + ip);

            //cod = "no se pudo conectar";

}

where:

 

public void sendZebra(String comando)

    throws IOException

  {

    this.outToZebra.writeBytes(comando);

  }

 

  public Boolean conectarZebra(String ip)

  {

    try

    {

      clientSocket2 = new Socket();

      clientSocket2.connect(new InetSocketAddress(ip, 6101), 3000);

      this.outToZebra = new DataOutputStream(clientSocket2.getOutputStream());

      return Boolean.valueOf(clientSocket2.isConnected());

    }

    catch (IOException ex)

    {

      System.out.println("zebra " + ex.toString());

    }

    return Boolean.valueOf(false);

  }

 

the Java Code and C# code no error of compilation no error of syntax.

run the program and click on the button, no error, but too not print anything.

 

also i tested:

 

1) Add new printer on a windows 8 with zebra utilities, added new port, specified the ip and tested from a word document.

20150829_124558.jpg

here send the document to ip zebra Qln420 printer and printed!!!!

20150829_130913.jpg

20150829_130851.jpg

wich i am do wrong..

 

 

2) Other case, i want connect the printer with the pocket pc, but not lucky the honeywell never detect the printer via bluetooth, and cant connect, in both devices i have enabled the bluetooth, why? any advice?

20150829_123323.jpg

 

Other question, why when i open the printer for put labels, close and extract 4 labels?

i loose much labels every time, see the image:

20150829_131247.jpg

i added some photos, and want solve this problem at soon possible.

thanks Thanks

Anonymous (not verified)
Hi Miguel,I ran through your

Hi Miguel,

I ran through your C# code and found it is fine.  From a brief look the Java code looks fine as well.  The issue is actually how you are creating the CPCL strings.  You are very close, but CPCL is very picky about several things, especially ending in carriage returns.  Every line needs to end in a carriage return and line feed for it to work.  You also need to specify a print quantity in CPCL.

Your C# code would look like this:

string CPCLString = "! 0 200 200 580 1" + Environment.NewLine + "! UTILITIES" + Environment.NewLine + "BARCODE 128 4 2 10 6 58 12345678" + Environment.NewLine +

                               "FORM" + Environment.NewLine + "PRINT" + Environment.NewLine;

I recommend you use the following format instead.  You can't guarantee that Environment.NewLine always converts to hex 0x0D 0x0A.  That's the point, it converts to the standard for that OS.  You need to guarantee what is sent is always carriage return & line feed :

string CPCLString = "! 0 200 200 580 1\r\n! UTILITIES\r\nBARCODE 128 4 2 10 6 58 12345678\r\nFORM\r\nPRINT\r\n";

The Java code should be this:

cod= "! 0 200 200 210 1\r\n" +

     "TEXT 4 0 30 40 Hello World\r\n" +

     "FORM\r\n" +

     "PRINT\r\n";

Try this and let me know.

Robin

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Miguel Enriquez
Hi, thanks for answer,

Hi, thanks for answer, sometimes print sometimes not print... not know why, possibly the AP is bad.

i need try print via Bluetooth, you know/have the code for C# and/or Java

Thanks.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Miguel,For Bluetooth, I

Hi Miguel,

For Bluetooth, I highly recommend using the Zebra SDK.  You are using Windows Embeded HandHeld 6.5, so our SDK is in .NET.  You can find it here.  There is sample code and documentation in the download. 

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Miguel Enriquez
Thanks for answer, i check

Thanks for answer, i check the SDK for .net also i need too develop the JAVA code, much code of JAva is specific for android and i want an Java code for a Servlet or Web Programming

Android Java Code: Zebra Technologies - Tap, Scan, and Connect Over TCP/IP and Bluetooth - Zebra Android Link-OS SDK - Java

Checking the status of the printer...

https://km.zebra.com/kb/index?page=content&id=SA337&actp=LIST

but nothing about Servlet,(by moment), thanks.

much thanks.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Miguel, The SDK also has a

Hi Miguel, The SDK also has a PC/Server based library and sample code including a web servlet. It does not have code for Bluetooth though as that is not as common on servers.  Generally the way to handle PC Bluetooth connections is to set up the Bluetooth connection with a virtual serial port and use standard serial port connectivity to read and write over Bluetooth.

Robin

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments