Using wireshark to monitor and compare packets sent to Zebra Printer? - wireshark

I have a odd problem with a Zebra printer that I am using. It is supposed to print at 2 inches per second. I have set this on my control panel (it is set up as a windows printer), as well as setting it under the Zebra PrinterServer.
I use an application called CoLOS to print barcodes off of it during production, but for some reason, it keeps overwriting the 2 inches per second setting under the Zebra Net Print Server to 6 inches per second. Their tech support basically told me it's impossible on their end because it's using windows drivers, but after testing printing other items through other applications with no issue (some of which are through CoLOS itself), nothing else triggers the printer to revert to 6 inches per second except for the only print job that matters.
I have wireshark set up to monitor connections between the server and the printer. I have printed one good print from CoLOS that does not trigger the printer to change it's inches per second setting, and I did one print that I know triggers it (and verified it switched from 2 to 6 after). I have the captures that have the data packets, but I can't interpret them. Would there be a way for me to compare these/turn them into some readable format, so that I can show this to tech support?

I was able to find this which tells me how to interpret the important first few lines of the ASCII text that was sent to the printer. It confirmed for me that the production print job was sending ^PR6, setting the inches per second to 6, overwriting the 2 inches per second I had previously set to the printer.

Related

How to print same document with different printer at the same time

I have a docx document with thousands of pages. I also have 3 printers with same brand and type attached to my PC. I want to print page 1-1000 using printer1, page 1001-2000 using printer2 and page 2001-3000 using printer3. I'm unable to print those pages at the same time. It prints sequentially not simultaneously. I also change Enable printer pooling but no luck so far.

Specifying printer tray via MediaPosition does not honor the paper tray settings

Working with a Konica Minolta, I am sending PostScript commands to it. Most of the time everything works correctly and I am able to switch trays using the MediaPosition command. The printer has 4 trays and the Paper Tray Settings from the printer display are set to "Letterhead", "Letterhead", "Letterhead" and "Plain".
I am successfully switching between trays using this:
<</ManualFeed false /MediaPosition 0>> setpagedevice
One of the ps files creates a job which prints from the from the third tray, the forth tray and then tries print from the first tray. However, at this point the printer freezes and asks you to put "Plain" paper in Tray 1. I am assuming this happens because the last print came from a "Plain" paper tray but I am just guessing. Going from 3 to 4 works but then to 1 does not.
I have tried to use /MediaType (letterhead) but it seems that this command is ignored as it comes along with some settings of Duplex which are incompatible with it:
<</Duplex true /Tumble false>> setpagedevice
Any idea what is actually causing this problem and even more so, how to fix it so the printer continues without freezing and asking to change the tray paper setting?
I cannot see what this has to do with Ghostscript, where is Ghostscript used in the described process ?
Page device parameters are, to some extent, device dependent and are usually treated as requests. For example you can set /Duplex, and the device will generally ignore it if it does not have a duplexer. (ie the request is ignored).
However, certain page device requests can have other effects, these are documented in Section 6.2.7 Unsatisfied Parameter Requests of the 3rd Edition PostScript Language Reference Manual (p446 in my copy).
The interpreter can respond to such an unsatisfied parameter request in a variety
of ways, such as by ignoring it, raising a PostScript error, or displaying a message
on the front panel of the device requesting intervention by the human operator.
Without seeing the exact PostScript program, it's not possible to tell exactly what's going on, but I would guess that the interpreter thinks, for whatever reason, that it cannot satisfy the request for tray 1 because it's MediaType does not match (it wants Plain and you have defined it as Letterhead). It's likely that switching tray the way you are doing changes the current MediaType (or possibly some other parameter but MediaType makes sense). I imagine that initially the MediaType is not present in the dictionary, so you can change to any other tray. When you change the tray, because you've defined the media type on the control panel, it picks up the new MediaType. When you try to switch back the current MediaType doesn't match the MediaType of the tray you are trying to switch to.
Most likely the reason that adding /MediaType (letterhead) doesn't work is because you say you've defined the tray as containing Letterhead. PostScript is case-sensitive so letterhead is not the same as Letterhead.
Or it could be that the paper tray setting simply isn't the same as the MediaType. I'm afraid that this sort of device-dependency is highly specific to each manufacturer, the only people who can probably tell you what you need to send for certain are the printer manufacturers' own engineers.

Report design issues with receipt paper

I have a report in Crystal Reports that runs and works great. However, there is an issue that I am facing. Right now, it runs, prints the patient copy, blank section, and then office copy of a purchase receipt. The problem is this all printers on one sheet of paper to an Epson thermal printer before it cuts. Then we have to tear between the two copies to give the customer theirs and keep ours. What I would like to find out is if there is a way to simulate 2 reports in one. So the out come would be this: prints customer copy, cuts the paper, prints the office copy.
I have attached a screen shot of how it is current set up and wanted to see if anyone had some suggestions on how I could possibly get the result I want without telling it to run 2 reports.
Thanks for any and all help.
Current Report Design
As of me it may not possible. You have to give separate print command to thermal printer. E.g. Pass the parameter as Patient Copy and Print it. again call & print the same report with pass the parameter as Office Copy. Hope by doing this it will solve your problem.

Communicate with and control a printer device via bluetooth or USB

The device is a label printer. It can be connected to via bluetooth and USB. I would imagine it is running some kind of linux, as it has a fairly complex interface/screen, but am not sure. In fact, this is something I would like to determine. But my goal is to get a shell, or some kind of 'meaningful' connection through which I can send commands/data which will trigger print events by the printer without using the manufacturer's software
Connecting to the device in ubuntu via USB creates /dev/usb/lp0. I tried connecting to this using python's serial module, but it couldn't connect to the serial port.
Via bluetooth I was also able to connect, using hcitool scan to get the device's MAC address and then rfcomm to connect (using this approach) . This created /dev/rfcomm0, which I was able to connect to and send data to using python.
Is it feasible to mimic the data normally sent over usb/bluetooth by the manufacturer's software to print without the software? I assume getting this would be possible by 'sniffing' data sent over bluetooth while a normal print command is sent by the manufacturer's software (although I suppose there's no reason it would look intelligible to a human).
If this kind of mimicry is possible, I am wondering whether simply sending the equivalent data over bluetooth, for example, would result in a print event. So far I have no reason to believe that data I send via the bluetooth connection is not being received, but I have yet to get any kind of response (data or physical) from the bluetooth connection.
Any advice/suggestions on how I might achieve my overall goal would be appreciated
This is certainly possible (sorry for the answer 6 years later, but hopefully this will help anyone later in need). I have a similar problem and this is how I solved.
I have a MHT-P80F thermo printer. I figured out in settings that it supports a protocol called TSPL. These are the instructions you need to send to a printer and tell it to do either raw text printing, or even bitmaps.
All you need to do is to construct the correct bytestream (in mostly human-readable ASCII) and send it to /dev/usb/lp0. I have not tested it via bluetooth but I assume it should be similar.
For example, if you want to print out a "Hello World", these instructions will suffice:
CLS
SIZE 80mm,50mm
GAP 5mm,0mm
HOME
TEXT 0,0,"0",0,1,1,"Hello World"
PRINT 1
Each line is separated by a "\n".
Explanations (more could be found by searching TSPL):
CLS Tell the printer to clear all previous staged commands.
SIZE Tell the printer the size of each label (width, height).
GAP Between each label there's 5mm space without paper.
HOME (Re-)locate the paper roll for a new print.
PRINT Start printing of 1 copie(s).
Note these instructions are for the use of discrete labels. For a whole paper roll it might be different. TSPL implementations on different printers may differ, so you might to experiment a bit.
Generally, if you can print a bitmap, then you can print virtually any document (e.g. using PIL in Python or Jimp in Node.js to generate an image beforehand). So here's the most useful BITMAP command:
BITMAP 16,24,40,256,0,<BYTE STREAM>
where
16: the starting (left most) X coordinate for your bitmap
24: the starting (top most) Y coordinate for your bitmap
40: the width of bitmap, in BYTES (see below)
256: the height of bitmap, in DOTS
0: mode of print, 0 being overwritting anything in that region
and <BYTESTREAM> being the binary data(black/white) of this image, from left to right and from top to bottom.
The bitmap width is given in bytes, so each byte represents 8 horizontal continous dots in the image. The highest bit 7 being most left, the lowest bit 0 most right. So if as in example we write 40 in this parameter, the image would be 40x8=320 dots in width.
The bitmap height, on the contray, is given in dots.
Most such thermal printer have a DPI of 203. This is an interesting start point to investigate into: 203/25.4 = 7.99, or rounded as 8. So for the printer, each 8 dots equals 1mm. In the above example, X=16 and Y=24 (both in dots) corresponds to starting location X=2mm and Y=3mm.
And finally, you generally do not need to inverse the color of this image. In BITMAP command, a 1 in a bit means correctly white or non-printed dot, and 0 means the black or heated dot.
I am not sure about bluetooth but for USB printing you can use the cups library (licups) and use the APIs to do the priting. It uses IPP protocol. Usually cups uses a .ppd file specific to the printer (which contains the details about the printer) for installing it. For new language versions such as PCL5, 5e, 6 etc there are generic ppd files that can be used to install any printer that uses the respective language

Slow printing with label printer could be caused by my software?

I have a software that prints labels. It generates many pages with n columns to be printed in a label printer (commonly Argox or Zebra). I use report builder to do so, meaning I send the jobs through the windows driver and not directly to the printer.
I have this one customer that is having a really hard time printing her labels. The printer pauses for 15-20 seconds between one page and another.
I´ve reviewed each and every configuration I could and did not find anything.
To make my problem worse, my customer uses the Bartender software (wich comes with Argox) and when printing there it has not this delay. Bartender uses the windows driver as well.
Well, from the point of view of my client, the problem is with my software, I don´t blame her.
From my point of view I can´t control such a thing (pause between pages) once I am using the driver.
Am I wrong? Is there anything I could do to avoid such a delay?
Important Info
Argox OS 214 TT - PPLA
Drivers updated to the last version (7.2)
Serial Cable being used
Does the report software you use create ZPL output, or a bitmap? You can check this by setting your printer driver to print to a file. If the file is huge, >1MB, it's probably creating a bitmap and that could take a long time to send to the printer.
Bartender would create ZPL if using internal fonts and barcodes, so the output will be tiny and the printer is optimized to print native ZPL. If your software uses fonts not on the printer (Arial, Times new roman, etc), it will send the label down as a graphic instead of using the printer's built in fonts, which would result in a HUGE file even for a small amount of text. Same thing goes for graphics, inlined vs. recalled graphics

Resources