You are not logged in.

#1 2010-12-21 20:44:58

perseus
Member
Registered: 2007-01-28
Posts: 160

libusb requires write access to USB device nodes [SOLVED]

Hi,

I have used gtkam to upload photos from my camera for some time now - though on an occasional basis because I don't take very many photographs.  On attempting to use it today for the first time in a while I find that I can't do so as a user.

"libusb couldn't open USB device /dev/bus/usb/003/002: Permission denied.
libusb requires write access to USB device nodes."

Can anyone tell me how to fix this please?

Last edited by perseus (2011-01-03 22:46:46)

Offline

#2 2011-01-03 21:08:02

KoS
Member
Registered: 2006-02-02
Posts: 35

Re: libusb requires write access to USB device nodes [SOLVED]

The same problem here. I just tried to import the photos from my Canon camera with shotwell (under fluxbox) and I got the following error:

Unable to fetch previews from the camera:
I/O problem (-7)

Checking with command line, I saw the following problem:

libusb couldn't open USB device /dev/bus/usb/001/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/001/006: Permission denied.
libusb requires write access to USB device nodes.

The permissions are the following:

crw-rw-r-- 1 root root 189, 5 Jan  3 22:02 /dev/bus/usb/001/006

Shouldn't the group belong to "camera" or something else than root??

Last edited by KoS (2011-01-03 21:08:34)

Offline

#3 2011-01-03 21:50:06

KoS
Member
Registered: 2006-02-02
Posts: 35

Re: libusb requires write access to USB device nodes [SOLVED]

I did some additional research and found the udev file for libgphoto2: /lib/udev/rules.d/40-gphoto.rules
I also realized that my camera is not listed in that file:

Bus 001 Device 011: ID 04a9:31f6 Canon, Inc.

I tried to add this device and vendor ID to the list of Canon cameras and restarting udev

ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="31f6", ENV{ID_GPHOTO2}="1", ENV{GPHOTO2_DRIVER}="proprietary", MODE="0660", GROUP="camera"
# killall udevd && udevd -d

Unfortunately this didn't work out.

I also tried to add the following line to that gphoto udev file as suggested by Digital Cameras wiki

PROGRAM="/lib/udev/check-ptp-camera", MODE="0660", GROUP="camera"

Still nothing after restarting udev...

My next try was adding the camera to the HAL fdi file /usr/share/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi and restarting HAL.
This didn't help either.

I'm getting short on clues...

For sure I can access the camera as root but that's not what I want to do.


!! UPDATE !!

I was dumb. PTP cameras are handled separately so I don't need to have the USB IDs in the udev or fdi files.
So the question is why PTP cameras are not handled correctly, why the group for these devices is not "camera"?

Last edited by KoS (2011-01-03 22:19:57)

Offline

#4 2011-01-03 22:23:08

perseus
Member
Registered: 2007-01-28
Posts: 160

Re: libusb requires write access to USB device nodes [SOLVED]

Because nobody had responded to my post, I assumed that my issue affected only me and was due to some quirk in my setup. That may still be true, but I was able to get my camera working again by following the "Permission Issues" section the Arch Digital Camera Wiki (https://wiki.archlinux.org/index.php/Digital_Cameras) - specifically :

If you receive permission issues type this in as well, still as root:

# /usr/lib/libgphoto2/print-camera-list udev-rules mode 0660 version 0.98 group camera > /etc/udev/rules.d/90-libgphoto2.rules

If after following all of these steps you still have access issues, try editing /etc/udev/rules.d/90-libgphoto2.rules and change the PROGRAM= line near the bottom to the following:

PROGRAM="/lib/udev/check-ptp-camera", MODE="0660", GROUP="camera"

I have no idea at all why the problem suddenly arose, or why this fixed it.

Offline

#5 2011-01-03 22:40:29

KoS
Member
Registered: 2006-02-02
Posts: 35

Re: libusb requires write access to USB device nodes [SOLVED]

Wow... this is strange. This solved my issue too!

I thought that creating an udev rule file for version 0.98 would be stupid when the current udev version is 164... so I didn't even try this out. I just recreated the udev rule file for version 164 which didn't help. I even added the mentioned PROGRAM line to the original udev rule file (/lib/udev/rules.d/40-gphoto.rules) without any success. (BTW I didn't need to alter the PROGRAM line after regenerating the rule file for version 0.98)

So thank you very much! This helped!

However I think that this should be a problem with libgphoto2 not generating the original rule file correctly.

Could you change the issue title by adding a [SOLVED] to the beginning?

Last edited by KoS (2011-01-03 22:50:49)

Offline

#6 2011-01-03 22:48:43

perseus
Member
Registered: 2007-01-28
Posts: 160

Re: libusb requires write access to USB device nodes [SOLVED]

Glad it helped.  I should have put the "solved" earlier, but I was very busy at the time.

Offline

#7 2011-01-21 19:29:58

lynix
Member
From: Karlsruhe, Germany
Registered: 2008-04-23
Posts: 230

Re: libusb requires write access to USB device nodes [SOLVED]

Same problem here (no write permission), but the question is different:

Until today I had full write access via libusb without doing anything , but now I get the error mentioned in the topic title. Has there been any recent update that influenced USB access rights?

Offline

#8 2011-01-24 09:51:04

KoS
Member
Registered: 2006-02-02
Posts: 35

Re: libusb requires write access to USB device nodes [SOLVED]

I don't know the exact version of libgphoto2 that broke my access, I only know that it was working during last year and that after updating the system at the end of last year (middle of December) it was broken. I don't update my system very often, only monthly or less frequently so I'm really not sure about the exact date or version.

Last edited by KoS (2011-01-24 09:52:06)

Offline

Board footer

Powered by FluxBB