You are not logged in.

#1 2005-12-07 21:21:13

depi
Member
From: EU - Slovakia
Registered: 2005-12-07
Posts: 39
Website

Canon digicam, don't work, permissions....without hotplug :)

Hi ppl.

I'm fighting with my Canon S1 IS digicam, which supports only PTP mode. I would like to get it work without hotplug, just with hwdetect, but I have no idea how to do it. When I'm trying to connect to it with digicam it says: failed to connect. I was trying gThumb too, and it says that it has'nt had permissions. And when I try to detect my camera with gphoto2 I have no problem, but when I try to download some files as normal user then I get:

*** Error ***              
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') *** 

and when I try to do the same as root then I get:

*** Error ***              
lock keys failed.
*** Error (-114: 'OS error in camera communication') ***

Any suggestions? It must working, this camera works me very well under Slackware.

Offline

#2 2005-12-08 15:00:21

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Canon digicam, don't work, permissions....without hotplug :)

Normally hotplug script sets the permissions for canon PTP mode cams. I don't know what you did to your scripts but you can use my way of setting canon camera using pure udev rules only (it's much easier than it sounds ;-)):

Full description:
http://bbs.archlinux.org/viewtopic.php?t=13870
http://bbs.archlinux.org/viewtopic.php?t=10188

Quick fix:
As root create /etc/udev/rules.d/010.udev.rules and put these rules inside (there are 3 lines below - watch out for line wrapping when you'll be copy-pasting them):

ACTION=="add", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="309c", RUN+="/bin/chmod o-rwx $env{DEVICE}" 
ACTION=="add", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="309c", RUN+="/bin/chgrp users $env{DEVICE}" 
ACTION=="add", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="309c", RUN+="/bin/chmod g+rw $env{DEVICE}", OPTIONS="last_rule" 

The rules do exactly the same thing which is done by hotplug script. The important thing is "idProduct". I've found the valules for your cam on this webpage (next to your model name). If it's wrong you should find the good one yourself using this command:

udevinfo -p /sys/class/usb_host/usb1/device/usb1/1-1/1-1.4 -a

The numbers at the end of the line depend on the usb port where your camera is plugged in. You have to find them yourself (just browse the dir and try the comand on all of them). There may be two idProduct values for your cam. Choose the one that is for PTP mode (the other is for "normal" mode which should work with digikam and gphoto2 too but you have to change the setup in your camera first. I'd recommend staying with PTP mode). You can also change the group in the second line from "users" to anything you like (assuming you have this group and your user is assigned to it).

EDIT: After doing it all run (as root) udevstart and replug your cam. It should became instantly available through digikam.

Offline

#3 2005-12-08 17:14:09

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Canon digicam, don't work, permissions....without hotplug :)

Does lsusb show id numbers? or are they something else ?

my 2c


Mr Green

Offline

#4 2005-12-08 18:32:02

depi
Member
From: EU - Slovakia
Registered: 2005-12-07
Posts: 39
Website

Re: Canon digicam, don't work, permissions....without hotplug :)

lanrat wrote:

Normally hotplug script sets the permissions for canon PTP mode cams. I don't know what you did to your scripts but you can use my way of setting canon camera using pure udev rules only (it's much easier than it sounds ;-)):

Full description:
http://bbs.archlinux.org/viewtopic.php?t=13870
http://bbs.archlinux.org/viewtopic.php?t=10188

Quick fix:
As root create /etc/udev/rules.d/010.udev.rules and put these rules inside (there are 3 lines below - watch out for line wrapping when you'll be copy-pasting them):

ACTION=="add", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="309c", RUN+="/bin/chmod o-rwx $env{DEVICE}" 
ACTION=="add", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="309c", RUN+="/bin/chgrp users $env{DEVICE}" 
ACTION=="add", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="309c", RUN+="/bin/chmod g+rw $env{DEVICE}", OPTIONS="last_rule" 

The rules do exactly the same thing which is done by hotplug script. The important thing is "idProduct". I've found the valules for your cam on this webpage (next to your model name). If it's wrong you should find the good one yourself using this command:

udevinfo -p /sys/class/usb_host/usb1/device/usb1/1-1/1-1.4 -a

The numbers at the end of the line depend on the usb port where your camera is plugged in. You have to find them yourself (just browse the dir and try the comand on all of them). There may be two idProduct values for your cam. Choose the one that is for PTP mode (the other is for "normal" mode which should work with digikam and gphoto2 too but you have to change the setup in your camera first. I'd recommend staying with PTP mode). You can also change the group in the second line from "users" to anything you like (assuming you have this group and your user is assigned to it).

EDIT: After doing it all run (as root) udevstart and replug your cam. It should became instantly available through digikam.

Lanrat tha'ts great! It works like a charm! Thank you very much again! I don't think that it is so easy smile

Offline

#5 2005-12-09 10:02:11

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Canon digicam, don't work, permissions....without hotplug :)

Mr Green wrote:

Does lsusb show id numbers? or are they something else ?

my 2c

Ah yes, I forgot about this tool. The numbers after ID are idVendor:idProduct. Tnx for reminding. I was using bare tools for too long :-)

Offline

#6 2005-12-09 14:12:38

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Canon digicam, don't work, permissions....without hotplug :)

np

I never took must notice of them till I read this thread ;-)


Mr Green

Offline

#7 2005-12-27 18:07:47

woogie
Member
From: Ottawa, ON
Registered: 2005-04-01
Posts: 45

Re: Canon digicam, don't work, permissions....without hotplug :)

Great! I just got a new digital camera at Christmas, and was wondering how I'd adjust the permissions gPhoto2 needed without using hotplug. This worked perfectly for my Sony DSC-S40, many thanks smile

Offline

#8 2006-01-03 17:05:13

Daren
Member
From: Notts, UK
Registered: 2006-01-02
Posts: 73

Re: Canon digicam, don't work, permissions....without hotplug :)

Hi,

I'm trying this as I'm having the same prob with a Canon G3.

I've added the rules, restarted udev, but all I'm getting in the error log is:

udevd[9871]: add_to_rules: invalid rule 'ACTION'

continuously.

It's probably something utterly daft, but any ideas?

Thanks

Offline

#9 2006-01-03 17:18:03

tpowa
Developer
From: Lauingen , Germany
Registered: 2004-04-05
Posts: 2,323

Re: Canon digicam, don't work, permissions....without hotplug :)

udev 079 in combination with libgphoto from testing should work.
i think we move in udev and the orhter stuff to current today

Offline

#10 2006-01-03 17:22:21

Daren
Member
From: Notts, UK
Registered: 2006-01-02
Posts: 73

Re: Canon digicam, don't work, permissions....without hotplug :)

Thanks

I can be patient   smile

I'll do a sync tomorrow and see how it fares

Offline

#11 2006-01-04 18:49:48

Daren
Member
From: Notts, UK
Registered: 2006-01-02
Posts: 73

Re: Canon digicam, don't work, permissions....without hotplug :)

Works perfectly now.

Excellent job   big_smile

Offline

#12 2006-07-20 15:26:19

kozaki
Member
From: London >. < Paris
Registered: 2005-06-13
Posts: 671
Website

Re: Canon digicam, don't work, permissions....without hotplug :)

lanrat wrote:

Normally hotplug script sets the permissions for canon PTP mode cams. I don't know what you did to your scripts but you can use my way of setting canon camera using pure udev rules only (it's much easier than it sounds ;-)):

Full description:
http://bbs.archlinux.org/viewtopic.php?t=13870
http://bbs.archlinux.org/viewtopic.php?t=10188

(...)

The rules do exactly the same thing which is done by hotplug script. The important thing is "idProduct". I've found the valules for your cam on this webpage (next to your model name). If it's wrong you should find the good one yourself using this command:

udevinfo -p /sys/class/usb_host/usb1/device/usb1/1-1/1-1.4 -a

The numbers at the end of the line depend on the usb port where your camera is plugged in. You have to find them yourself (just browse the dir and try the comand on all of them). There may be two idProduct values for your cam. Choose the one that is for PTP mode (the other is for "normal" mode which should work with digikam and gphoto2 too but you have to change the setup in your camera first. I'd recommend staying with PTP mode). You can also change the group in the second line from "users" to anything you like (assuming you have this group and your user is assigned to it).

EDIT: After doing it all run (as root) udevstart and replug your cam. It should became instantly available through digikam.

Lanrat > Could you please detail how to find the appropriate rules for a digital camera that is not (yet) liste on http://www.teaser.fr/~hfiguiere/linux/digicam.html ?

Also I found /sys/class/usb a bit different now : Here how it looks in this location :

cat /sys/class/usb_host/usb_host
usb_host1/ usb_host2/ usb_host3/ usb_host4

Also when I plug the Canon Powershot A 430 (PTP) with the USB cable, here is what dmesg and lsusb shows :

ohci_hcd 0000:00:13.2: wakeup
usb 3-2: new full speed USB device using ohci_hcd and address 17
usb 3-2: configuration #1 chosen from 1 choice
usb 3-2: USB disconnect, address 17

Bus 003 Device 011: ID 04a9:30f8 Canon, Inc

digikam-0.8.1-2 does not recognize the camera (at least as a user ; as root will shows the pictures in the camera but won't be able to transfer them)
Latest digikam-svn won't even start (avahi protocol or whatsoever)
gphoto2-2.1.6 didn't help neither, as for the moment it shows (launched by user not root) :

0.080382 gphoto2-camera(2): Loading '/usr/lib/gphoto2/2.1.6/libgphoto2_ptp2.so'...
0.080514 gphoto2-port(2): Opening USB port...
0.080562 gphoto2-port(0): Could not query kernel driver of device.
0.080579 gphoto2-port(0): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
0.080614 context(0): An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.

*** Error ***             
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***


Seeded last month: Arch 50 gig, derivatives 1 gig
Desktop @3.3GHz 8 gig RAM, linux-ck
laptop #1 Atom 2 gig RAM, Arch linux stock i686 (6H w/ 6yrs old battery smile) #2: ARM Tegra K1, 4 gig RAM, ChrOS
Atom Z520 2 gig RAM, OMV (Debian 7) kernel 3.16 bpo on SDHC | PGP Key: 0xFF0157D9

Offline

#13 2006-07-21 19:27:36

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Canon digicam, don't work, permissions....without hotplug :)

First make sure the camera is in PTP mode (somewhere in the setup). My other canon cam has also normal mode and the numbers in the udev rules are different.

Second - your user must be in the camera group.

lsusb gives you everything you need - the numbers after ID are idVendor (04a9) and idProduct (30f8).

To test if it will work create /etc/udev/rules.d/00.gphoto.udev.rules and put this line inside:

SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="30f8", GROUP:="camera"

restart udev with /etc/start_udev (as root) and plug in your camera.

You should now be able to access the camera as the user from digikam. I'm assuming you're using standard and updated arch packages of course.

If all of this works you should put an official request for support for your cam here (I think) so next time your cam will be supported out of the box.

If it doesn't work, well, it must be the fault of digikam version :-)

Offline

Board footer

Powered by FluxBB