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

Printing multiple copies of a label results in an error #42

Open
saschaludwig opened this issue Jul 30, 2024 · 5 comments
Open

Printing multiple copies of a label results in an error #42

saschaludwig opened this issue Jul 30, 2024 · 5 comments

Comments

@saschaludwig
Copy link

This error occurs, whenever I try printing multiple (for example 10) copies of a label.
Only 5 labels get printed. Then the error occurs:

Traceback (most recent call last):

File "/home/inventree/src/backend/InvenTree/plugin/base/label/label.py", line 36, in print_label
plugin.print_label(**kwargs)

File "/usr/local/lib/python3.11/site-packages/inventree_brother/brother_plugin.py", line 232, in print_label
send(

File "/usr/local/lib/python3.11/site-packages/brother_ql/backends/helpers.py", line 57, in send
printer = BrotherQLBackend(printer_identifier)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/site-packages/brother_ql/backends/network.py", line 50, in __init__
self.s.connect((host, port))

ConnectionRefusedError: [Errno 111] Connection refused

I'm using a QL-720NW, connected via LAN.
It looks like the printer won't accept connections while it is still printing, or some other race condition.
After the error occurs, I can print normally.

@SchrodingersGat
Copy link
Member

@saschaludwig sorry for the delayed response on this one - the solution here would be to send all the copies as a single job to the printer - rather than sending each copy as a separate job.

@saschaludwig
Copy link
Author

saschaludwig commented Nov 29, 2024

@SchrodingersGat how can I send them in a single job? Is there something I can configure or change?
I just can select how many copies:
Image

The problem also exists, if I select multiple items to print:
Image

Or is this something that has to be implemented by a plugin developer?

@SchrodingersGat
Copy link
Member

Is there something I can configure or change?

No, at this stage it's an issue with the implementation. Each printing job is sent separately but they should be collated before sending to the printer. I guess because this is not happening the printer is being overwhelmed

@SchrodingersGat
Copy link
Member

Or is this something that has to be implemented by a plugin developer?

I do not have access to one of these printers currently - would you have any ability to test some code changes on your end?

@saschaludwig
Copy link
Author

saschaludwig commented Dec 5, 2024

I do not have access to one of these printers currently - would you have any ability to test some code changes on your end?

Yes, I would definitely help to try code changes.

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

2 participants