michaelrsweet / lprint

A Label Printer Application
https://www.msweet.org/lprint
Apache License 2.0
227 stars 31 forks source link

macOS package doesn't start/load LPrint server automatically #48

Closed adamwolf closed 2 years ago

adamwolf commented 2 years ago

I'm running lprint 1.1.0, installed via the pkg here on github.

I can run lprint devices and see the printer, but I can't add the printer.

Any ideas?

❯ sw_vers
ProductName:    macOS
ProductVersion: 12.1
BuildVersion:   21C52

~
❯ lprint devices
snmp://amandas-printer
usb://Zebra%20/LP2844%20?serial=42J112901277

~ took 4s
❯ lprint add -d zebra -v 'usb://Zebra%20/LP2844%20?serial=42J112901277' -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

~
❯ lprint add -d zebra -v usb://Zebra%20/LP2844%20?serial=42J112901277 -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

~
❯ sudo lprint add -d zebra -v usb://Zebra%20/LP2844%20?serial=42J112901277 -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

~
❯ sudo lprint add -d zebra -v 'usb://Zebra%20/LP2844%20?serial=42J112901277' -m epl2_4inch-203dpi-dt
lprint: Unable to start server: Bad file descriptor

~
❯ lprint drivers
lprint: statefile='/Users/wolf/.lprint.conf'
E [2022-01-01T19:37:50.935Z] [Device] Unable to claim USB interface: Access denied (insufficient permissions)
dymo_lm-400 "DYMO LabelMANAGER 400" "MFG:DYMO;MDL:LabelMANAGER 400 ;"
dymo_lm-450 "DYMO LabelMANAGER 450" "MFG:DYMO;MDL:LabelMANAGER 450 ;"
dymo_lm-pc "DYMO LabelMANAGER PC" "MFG:DYMO;MDL:LabelMANAGER PC ;"
dymo_lm-pc-ii "DYMO LabelMANAGER PC II" "MFG:DYMO;MDL:LabelMANAGER PC II ;"
dymo_lm-pnp "DYMO LabelMANAGER PNP" "MFG:DYMO;MDL:LabelMANAGER PNP ;"
dymo_lp-350 "DYMO LabelPOINT 350" "MFG:DYMO;MDL:LabelPOINT 350 ;"
dymo_lw-300 "DYMO LabelWriter 300" "MFG:DYMO;MDL:LabelWriter 300;"
dymo_lw-310 "DYMO LabelWriter 310" "MFG:DYMO;MDL:LabelWriter 310;"
dymo_lw-315 "DYMO LabelWriter 315" "MFG:DYMO;MDL:LabelWriter 315;"
dymo_lw-320 "DYMO LabelWriter 320" "MFG:DYMO;MDL:LabelWriter 320;"
dymo_lw-330 "DYMO LabelWriter 330" "MFG:DYMO;MDL:LabelWriter 330;"
dymo_lw-330-turbo "DYMO LabelWriter 330 Turbo" "MFG:DYMO;MDL:LabelWriter 330 Turbo;"
dymo_lw-400 "DYMO LabelWriter 400" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-400-turbo "DYMO LabelWriter 400 Turbo" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450 "DYMO LabelWriter 450" "MFG:DYMO;MDL:LabelWriter 450;"
dymo_lw-450-duo-label "DYMO LabelWriter 450 DUO Label" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-duo-tape "DYMO LabelWriter 450 DUO Tape" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-turbo "DYMO LabelWriter 450 Turbo" "MFG:DYMO;MDL:LabelWriter 450 Turbo;"
dymo_lw-450-twin-turbo "DYMO LabelWriter 450 Twin Turbo" "MFG:DYMO;MDL:LabelWriter 450 Twin Turbo;"
dymo_lw-4xl "DYMO LabelWriter 4XL" "MFG:DYMO;MDL:LabelWriter 4XL;"
dymo_lw-duo-label "DYMO LabelWriter DUO Label" "MFG:DYMO;MDL:LabelWriter DUO Label;"
dymo_lw-duo-tape "DYMO LabelWriter DUO Tape" "MFG:DYMO;MDL:LabelWriter DUO Tape;"
dymo_lw-duo-tape-128 "DYMO LabelWriter DUO Tape 128" "MFG:DYMO;MDL:LabelWriter DUO Tape 128;"
dymo_lw-se450 "DYMO LabelWriter SE450" "MFG:DYMO;MDL:LabelWriter SE450;"
epl2_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
epl2_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
epl2_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
epl2_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
epl2_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" "COMMAND SET:EPL;"
epl2_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
epl2_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
epl2_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
zpl_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
zpl_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
zpl_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-600dpi-tt "Zebra ZPL 2-inch/600dpi/Thermal-Transfer" ""
zpl_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" ""
zpl_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
zpl_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
zpl_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_4inch-600dpi-tt "Zebra ZPL 4-inch/600dpi/Thermal-Transfer" ""

~
❯ sudo lprint drivers
lprint: statefile='/Users/wolf/.lprint.conf'
E [2022-01-01T19:37:58.347Z] [Device] Unable to claim USB interface: Access denied (insufficient permissions)
dymo_lm-400 "DYMO LabelMANAGER 400" "MFG:DYMO;MDL:LabelMANAGER 400 ;"
dymo_lm-450 "DYMO LabelMANAGER 450" "MFG:DYMO;MDL:LabelMANAGER 450 ;"
dymo_lm-pc "DYMO LabelMANAGER PC" "MFG:DYMO;MDL:LabelMANAGER PC ;"
dymo_lm-pc-ii "DYMO LabelMANAGER PC II" "MFG:DYMO;MDL:LabelMANAGER PC II ;"
dymo_lm-pnp "DYMO LabelMANAGER PNP" "MFG:DYMO;MDL:LabelMANAGER PNP ;"
dymo_lp-350 "DYMO LabelPOINT 350" "MFG:DYMO;MDL:LabelPOINT 350 ;"
dymo_lw-300 "DYMO LabelWriter 300" "MFG:DYMO;MDL:LabelWriter 300;"
dymo_lw-310 "DYMO LabelWriter 310" "MFG:DYMO;MDL:LabelWriter 310;"
dymo_lw-315 "DYMO LabelWriter 315" "MFG:DYMO;MDL:LabelWriter 315;"
dymo_lw-320 "DYMO LabelWriter 320" "MFG:DYMO;MDL:LabelWriter 320;"
dymo_lw-330 "DYMO LabelWriter 330" "MFG:DYMO;MDL:LabelWriter 330;"
dymo_lw-330-turbo "DYMO LabelWriter 330 Turbo" "MFG:DYMO;MDL:LabelWriter 330 Turbo;"
dymo_lw-400 "DYMO LabelWriter 400" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-400-turbo "DYMO LabelWriter 400 Turbo" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450 "DYMO LabelWriter 450" "MFG:DYMO;MDL:LabelWriter 450;"
dymo_lw-450-duo-label "DYMO LabelWriter 450 DUO Label" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-duo-tape "DYMO LabelWriter 450 DUO Tape" "MFG:DYMO;MDL:LabelWriter ;"
dymo_lw-450-turbo "DYMO LabelWriter 450 Turbo" "MFG:DYMO;MDL:LabelWriter 450 Turbo;"
dymo_lw-450-twin-turbo "DYMO LabelWriter 450 Twin Turbo" "MFG:DYMO;MDL:LabelWriter 450 Twin Turbo;"
dymo_lw-4xl "DYMO LabelWriter 4XL" "MFG:DYMO;MDL:LabelWriter 4XL;"
dymo_lw-duo-label "DYMO LabelWriter DUO Label" "MFG:DYMO;MDL:LabelWriter DUO Label;"
dymo_lw-duo-tape "DYMO LabelWriter DUO Tape" "MFG:DYMO;MDL:LabelWriter DUO Tape;"
dymo_lw-duo-tape-128 "DYMO LabelWriter DUO Tape 128" "MFG:DYMO;MDL:LabelWriter DUO Tape 128;"
dymo_lw-se450 "DYMO LabelWriter SE450" "MFG:DYMO;MDL:LabelWriter SE450;"
epl2_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
epl2_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
epl2_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
epl2_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
epl2_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" "COMMAND SET:EPL;"
epl2_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
epl2_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
epl2_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-203dpi-dt "Zebra ZPL 2-inch/203dpi/Direct-Thermal" ""
zpl_2inch-203dpi-tt "Zebra ZPL 2-inch/203dpi/Thermal-Transfer" ""
zpl_2inch-300dpi-dt "Zebra ZPL 2-inch/300dpi/Direct-Thermal" ""
zpl_2inch-300dpi-tt "Zebra ZPL 2-inch/300dpi/Thermal-Transfer" ""
zpl_2inch-600dpi-tt "Zebra ZPL 2-inch/600dpi/Thermal-Transfer" ""
zpl_4inch-203dpi-dt "Zebra ZPL 4-inch/203dpi/Direct-Thermal" ""
zpl_4inch-203dpi-tt "Zebra ZPL 4-inch/203dpi/Thermal-Transfer" ""
zpl_4inch-300dpi-dt "Zebra ZPL 4-inch/300dpi/Direct-Thermal" ""
zpl_4inch-300dpi-tt "Zebra ZPL 4-inch/300dpi/Thermal-Transfer" ""
zpl_4inch-600dpi-tt "Zebra ZPL 4-inch/600dpi/Thermal-Transfer" ""
jrperk commented 2 years ago

Have you considered making sure pyusb is loaded? Check out https://www.geeksforgeeks.org/how-to-install-pyusb-on-macos/ It got me past some of these issues on my linux machine.

michaelrsweet commented 2 years ago

@jrperk pyusb isn't involved here at all - LPrint uses the libusb C API.

@adamwolf What happens if you start the server via launchd, e.g.:

sudo launchctl load -w /Library/LaunchDaemons/org.msweet.lprint.plist
adamwolf commented 2 years ago

That was exactly the issue. Once I started the server, I was able to add the printer and print.

On Mon, Jan 3, 2022 at 11:07 AM Michael R Sweet @.***> wrote:

@jrperk https://github.com/jrperk pyusb isn't involved here at all - LPrint uses the libusb C API.

@adamwolf https://github.com/adamwolf What happens if you start the server via launchd, e.g.:

sudo launchctl load -w /Library/LaunchDaemons/org.msweet.lprint.plist

— Reply to this email directly, view it on GitHub https://github.com/michaelrsweet/lprint/issues/48#issuecomment-1004230240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIWYP26O4AIOTYJFUNQ2TUUHJV7ANCNFSM5LCZMDOA . You are receiving this because you were mentioned.Message ID: @.***>

michaelrsweet commented 2 years ago

@adamwolf Great! I'm going to leave this bug open to fix this packaging issue.

michaelrsweet commented 2 years ago

[master 6a99fcc] Fix macOS package to start LPrint server (Issue #48)