Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

just print the first time by usb #34

Open
palanganero opened this issue Nov 3, 2020 · 6 comments
Open

just print the first time by usb #34

palanganero opened this issue Nov 3, 2020 · 6 comments

Comments

@palanganero
Copy link

it only prints the first time when prints by usb . When i run the program for second time it does not print (i have to reboot the printer). It seems to be a problem with the usb because by ehternet prints ok.

@fblondiau
Copy link

fblondiau commented Nov 23, 2020

Same problem here... it does not seem related to this product : any attempt to access the printer only works once (then, needs to turn off/on printer again). If someone has an idea...

@klirichek
Copy link
Owner

cups filter is no way related to the method CUPS uses to access printer itself.
It just reads from stdin and writes to stdout. CUPS then direct stdout stream to real hardware some way.
So, it just deals nothing with usb or any other connection, it just prints to standard output stream

@palanganero
Copy link
Author

hello fblondiau, i discover that it was only the fist 23 characters which does not print. So if you try printing a first line with 23 white characters it will work.

@Irdroid
Copy link

Irdroid commented Aug 13, 2021

it only prints the first time when prints by usb . When i run the program for second time it does not print (i have to reboot the printer). It seems to be a problem with the usb because by ehternet prints ok.

I have the same problem with the ZJ5890K , it prints once and then when i try a second print the paper just moves a little and it halts the printer. Then a printer reset is needed.

This problem was not present with the previous batches that we purchased, but it seems that the manufacturer released a new firmware (in february 2021) which we found out it is causing the issue.

The issue seems not related to the rastertozj filter, it is rather related to the usb backend and libusb.

You can checkout the gist below for more information:

https://gist.github.com/Irdroid/09017dea81b9397bca2d71542633d21c

@Irdroid
Copy link

Irdroid commented Aug 13, 2021

hello fblondiau, i discover that it was only the fist 23 characters which does not print. So if you try printing a first line with 23 white characters it will work.

Can you share your code for printing the first line with 23 white characters?

@Irdroid
Copy link

Irdroid commented Aug 14, 2021

it only prints the first time when prints by usb . When i run the program for second time it does not print (i have to reboot the printer). It seems to be a problem with the usb because by ehternet prints ok.


I have just identified why it is doing so. It has nothing to do with the rastertozj cups filter, it has to do with the usb backend and the org.cups.usb.quirks where special parameters are defined for different printer models. This file is loaded and parsed by the usb backend each time the printer prints

For the USB printer that I am using I have defined the following at the last line of the cups usb quirks file (org.cups.usb-quirks):

0416:5011 unidir soft-reset

0416:5011 is the USB printer VID ( Vendor ID) and PID (product ID) ( I am using POS5890K) but I think most of the Zijiang USB printerd have this VID / PID

These printers have one endpoint for configuration and one endpoint for writing data. If the above is not defined , the printer reports bidirectional and it will either stall or
not work at all.

The second parameter will instruct libusb to issue a soft reset affer each print job on the usb bus for this device.
So these definitions in org.cups.usb-quirks are important if you want a stable printing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants