pklaus / brother_ql

Python package for the raster language protocol of the Brother QL series label printers (QL-500, QL-550, QL-560, QL-570, QL-700, QL-710W, QL-720NW, QL-800, QL-810W, QL-820NWB, QL-1050, QL-1060N and more).
GNU General Public License v3.0
558 stars 165 forks source link

unable to function on a Pi3B with brother QL-570 #97

Open zacharyjordan23 opened 3 years ago

zacharyjordan23 commented 3 years ago

im getting premission denied when trying to print. and when I run /dev/usb/lp0 , it also says premission denied, even though I have modified premission on the lp0 file to change the owner to me(the current user)

when trying to print : raise USBError(_strerror(ret), ret, _libusb_errno[ret]) usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

when running /dev/usb/lp0 : bash: /dev/usb/lp0: Permission denied

PLEASE HELP/ GIVE ME A RECOMMENDATION OF TROUBLESHOOTING STEPS, IVE TRIED EVERYTHING

kumekay commented 3 years ago

Likely it's something with your udev rules. Try to create a file /etc/udev/rules.d/99-usb.rules with content like:

SUBSYSTEM=="usb", ATTR{idVendor}=="04f9", ATTR{idProduct}=="****", MODE="0666"

where you should replace **** with the actual product id. You may run lsusb to find it, there will be a line like

Bus 005 Device 017: ID 04f9:20c0 Brother Industries, Ltd ...

Then run sudo udevadm trigger or reboot the device to apply new rules.

kumekay commented 3 years ago

A correction to instructions above, they are valid if you are using a printer with pyusb with an address like usb://0x04f9:0x20c0/000G9Z495858 where

You can find these numbers by running lsusb -d 04f9: -v

Bus 003 Device 004: ID 04f9:20c0 Brother Industries, Ltd QL-600
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x04f9 Brother Industries, Ltd
  idProduct          0x20c0
  bcdDevice            1.00
  iManufacturer           1 Brother
  iProduct                2 QL-600
  iSerial                 3 000G9Z495858
  bNumConfigurations      1
kumekay commented 3 years ago

If you want to use device like /dev/usb/lp0 you should add your user to lp group (and then restart the session): sudo usermod -a -G lp your_user