qzind / qz-print

Archive for legacy qz-print versions (1.8, 1.9). See https://github.com/qzind/tray for modern versions.
Other
141 stars 101 forks source link

Access denied when attempting to claim usb device in Ubuntu #181

Closed klabarge closed 8 years ago

klabarge commented 8 years ago

I am unable to claim my USB scale (Stamps.com Model 510) on Ubuntu 14.04.

I receive as "Access denied" error:

Error: USB error 3: Can't open device Bus 001 Device 013: ID 1446:6a73: Access denied (insufficient permissions)
tresf commented 8 years ago

@klabarge/@lite1979 can you see if this gets you anywhere? http://ubuntuforums.org/showthread.php?t=901891&p=5678358#post5678358

To quote the article:

Basically, when a device is sort of a non-standard device (this is a little hard for me to explain), in particular not a usb file system, the mount rules in /etc/udev/rules.d/40-basic-permissions.rules apply. Now, be aware that the syntax changed going from 7.10 to 8.04, and right now I can't recall the pre-8.04 syntax. To fix my problem, I created a file called 41-cvs-permissions.rules - just be sure the number is above 40 and doesn't conflict with an existing file. Note that I created this file while running as root, so be sure to match it's permissions to those of the 40-basic-permissions.rules file.

My file contains the following - hopefully you'll now see the correlation of the numbers:

# USB devices (usbfs replacement)
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",SYSFS{idVendor}=="0dca" , SYSFS{idProduct}=="0027", MODE="0666"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",SYSFS{idVendor}=="167b" , SYSFS{idProduct}=="0101", MODE="0666"

Please note that the second usb_device is for another set of CVS cameras have. The idea is to make it either world accessable as I did with MODE="0666", or to set a group id or other such thing.

If you follow my previous post of the lsusb and this file, you will see I'm dealing with the usb device of major id (vendor) of "0dca" and minor id (product) of "0027". It just was by coincidence that it was the first in my lsusb list. These particular devices for me never come up with a name.

If you need more help with this way let me know. Also, please post back if this solves your problem as it may be of use to others.

-Dave (anewguy)

Basically it contains (albeit dated) instructions for registering the VendorID and ProductID with user permissions.

Once we have a handle on how to register these devices, we can do something similar to what we'll need for Mac where we add them to a list of known vendors/devices and register that list at install time.

I realize this may not be ideal, so I'm open to other ideas.

klabarge commented 8 years ago

I tried following the above steps with no success.

I did not have the file 40-basic-permissions.rules (also tried 41-cvs-permissions.rules and43) in that directory so I tried creating it with the contents:

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",SYSFS{idVendor}=="1446" , SYSFS{idProduct}=="6a73", MODE="0666"

There also rules in /lib/udev/rules.d, but it is to my understanding that the files in /etc/udev/rules.d will override the files in that directory given a higher number.

I will look to see if there is a different syntax or way to do this.

tresf commented 8 years ago

@klabarge should be fixed via 15e6ea0, 1bef6c1.

Can you clone my fork, build, install and let me know if it fixes it?

git clone -b 2.0 https://github.com/tresf/qz-print

These changes won't be merged until #180 (Apple USB) is addressed as well.

-Tres

klabarge commented 8 years ago

Those changes worked :+1:

I am now able to claim my USB scale and read values off of it.

tresf commented 8 years ago

:+1:

tresf commented 8 years ago

Closed via #182