Open figbarter opened 3 years ago
I've successfully printed a sticker now.
Solution seems to depend on having the abovementioned udev rules file in place, and rebooting.
After having that rules file I rebooted at first attempt I got
$ python stickers.py printimages /home/user/HOME/Brother/Stickers/1.jpg --printer-model QL-570 --printer-url usb://0x04f9:0x2028 --sticker-count 1
Main printimages PrintImages init PrintImages.start args Namespace(command='printimages') Running PrintImages.start, args: Namespace(dry_run=False, file_extension='jpg', images=['/home/user/HOME/Brother/Stickers/1.jpg'], printer_model='QL-570', printer_url='usb://0x04f9:0x2028', sticker_count='1', sticker_size='regular') args_dict: {'images': ['/home/user/HOME/Brother/Stickers/1.jpg'], 'dry_run': False, 'printer_url': 'usb://0x04f9:0x2028', 'printer_model': 'QL-570', 'file_extension': 'jpg', 'sticker_count': '1', 'sticker_size': 'regular'} printing 1 of 1(0 remaining): /home/user/HOME/Brother/Stickers/1.jpg sh: 1: brother_ql: not found
From this I learned that this must be run again after reboot:
source venvstickers/bin/activate
Successful output:
$ python stickers.py printimages /home/user/HOME/Brother/Stickers/1.jpg --printer-model QL-570 --printer-url usb://0x04f9:0x2028 --sticker-count 1
Main printimages PrintImages init PrintImages.start args Namespace(command='printimages') Running PrintImages.start, args: Namespace(dry_run=False, file_extension='jpg', images=['/home/user/HOME/Brother/Stickers/1.jpg'], printer_model='QL-570', printer_url='usb://0x04f9:0x2028', sticker_count='1', sticker_size='regular') args_dict: {'images': ['/home/user/HOME/Brother/Stickers/1.jpg'], 'dry_run': False, 'printer_url': 'usb://0x04f9:0x2028', 'printer_model': 'QL-570', 'file_extension': 'jpg', 'sticker_count': '1', 'sticker_size': 'regular'} printing 1 of 1(0 remaining): /home/user/HOME/Brother/Stickers/1.jpg deprecation warning: brother_ql.devicedependent is deprecated and will be removed in a future release WARNING:brother_ql.conversion:Need to resize the image... INFO:brother_ql.backends.helpers:Sending instructions to the printer. Total: 104024 bytes. INFO:brother_ql.backends.helpers:Printing was successful. Waiting for the next job.
I'm reopening this issue, because maybe you should include either
Otherwise works great, thank you!
@figbarter So you found a fix to the error? What was it? Perhaps you can show here and then I can add it? Or maybe you can submit a PR?
@sidha
Yes, my solution is in my second post above, namely write a udev rules file and reboot.
Linuxmint 20.1 on a Thinkpad T400
Thank you for this great script.
What's a PR?
@figbarter a PR is a Pull Request where you check in new changes to this code on your your branch and then submit a Pull Request to me to confirm that it will be merged to the main codebase.
So for this you could update the README and submit a PR.
My lsusb:
My error:
$ python stickers.py printimages /home/user/HOME/Brother/Stickers/1.jpg --printer-model QL-570 --printer-url usb://0x04f9:0x2028 --sticker-count 1
Based on info on Errno 13 on Stackexchange (https://stackoverflow.com/questions/50625363/usberror-errno-13-access-denied-insufficient-permissions):
I made this rule file:
with this rule:
using the VendorId from my lsusb output.
So I did that but still have the Errno 13.