# UDEV & USB camera

## fourhead

I own a Canon PowerShot A80, which does NOT provide a USB storage device to access it, instead I have to use gphoto to use it. I previously had setup gphoto2 and devfs with an usbcam script that I found on gphoto.org that would change perms of the camera device so that regular users can access it. Now that I have switched to udev this doesn't work anymore. I always get an error "Could not claim device". I already tried to modifiy the script so that it would chown the device to myself - to no avail. I also tried all the different usbcam scripts found on gphoto.org but they all don't work. I'm wondering - isn't udev supposed to set perms for devices? There actually has never been any device in /dev that represents the camera - so where is this device? How can I make my camera work again with udev??

Tom

----------

## xsak

Hmm, I have the same problem...

I would also like to know that device I have to  allow access to my user...

Bye,

Akos

----------

## fourhead

This script, saved as /etc/hotplug/usb/usbcam, solved it for me:

```

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]

then

        chmod 0000 "${DEVICE}"

        chown myusername:users "${DEVICE}"

        chmod 0600 "${DEVICE}"

fi

```

Perhaps it helps you, too.

Tom

----------

## xsak

This is perfect, thatnk you!

 :Smile: 

Bye,

Akos

----------

## monicajae

Um, didn't work for me....and I subbed "myusername" with my user name....

M

----------

## pjj

I have the same problem and use ivman not hotplug, any ideas what to do?

----------

## pjj

BUMP

----------

## fourhead

Hmm do you have hotplugging activated in the kernel? I didn't do anything special though, I just found this script on the hp of gphoto, there are also other scrits to allow camera access to a user, a group etc. Perhaps you find a solution there, too.

Tom

----------

## dsd

i'm confused by a contradiction in your original post

 *elektrohirn wrote:*   

> I previously had setup gphoto2 and devfs with an usbcam script that I found on gphoto.org that would change perms of the camera device so that regular users can access it.

 

 *Quote:*   

> There actually has never been any device in /dev that represents the camera - so where is this device?

 

----------

## fourhead

Sorry for this confusion - well there really never has been any device in /dev, I was talking about a camera device more as a physical device, not as a device file. As I said, my camera doesn't act like an external harddisk, you need this PTP thingy to access it. The script I found on gphoto.org just changes the permission of this USB device, but it's not represented by any file in /dev - thats why I got confused because it did work with devfs, but after my change to udev it stopped working.

The script I'm using now is actually a simplified version of the script from gphoto.org - don't know why it works now!

Tom

----------

