py-brotherlabel is a Python package to control Brother P-Touch label printers in raster printing mode. Intended to use on a Raspberry Pi board.
- PT-P900
- PT-P900W
- PT-P950NW
-
Connect the printer to the Raspberry Pi via USB cable and turn on the pritner.
-
Run command
lsusb
. The device ID will be listed along with the company name Brother.
Bus 001 Device 004: ID 04f9:2086 Brother Industries, Ltd
- See
example_usb.py
. Pass the device ID toUSBBackend
constructor.
When pyusb shows the error usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
,
see https://www.raspberrypi.org/forums/viewtopic.php?t=186839
Example rule /etc/udev/rules.d/50-usb-perms.rules
for PT-P900/P900W/P950NW:
SUBSYSTEM=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="2083", GROUP="plugdev", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="2085", GROUP="plugdev", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="2086", GROUP="plugdev", MODE="0666"
sudo udevadm control --reload; sudo udevadm trigger