Autodetect digital camera

Just a quick note, I have success with auto-detection of my camera. This udev rule does it:

ACTION=="add", SUBSYSTEM=="usb_device", ENV{INTERFACE}="6/1/1", RUN+="/usr/sbin/pupautodetect ptpcamera"

The "6" is bInterfaceClass, which is "Imaging"
The "1" is bInterfaceSubClass, which is "Still Image capture"
The last "1" is bInterfaceProtocol which is "Picture Transfer Protocol"

...all of this is found in /sys.


Posted on 7 Oct 2011, 8:53


Comments:

Posted on 7 Oct 2011, 17:51 by Barryk
Correction
Correction, the above rule should be:

ACTION=="add", SUBSYSTEM=="usb", ENV{INTERFACE}=="6/1/*", RUN+="/usr/sbin/pupautodetect camera"

...note, I changed bInterfaceProtocol to anything. The other two should be enough.



Posted on 7 Oct 2011, 17:56 by BarryK
Digital camera access GUI
I have implemented a simple GUI in Woof, named Pcamera.

It is in the Graphic menu, but also there is auto-detection. As soon as I plugin my camera, Pcamera pops up, I click one button and ROX-Filer opens showing my photos. Brilliant!

Very basic though, relies on the autodetection of the 'gphoto2' utility. It will be interesting to see the success rate.



Posted on 7 Oct 2011, 18:02 by BarryK
Camera files in Woof
New files in rootfs-skeleton are:

/etc/udev/rules.d/88-puppy-autodetect.rules
/usr/sbin/pupautodetect
/usr/sbin/pupcamera



Posted on 7 Oct 2011, 18:03 by BarryK
Also
/usr/share/applications/pcamera.desktop



Posted on 7 Oct 2011, 21:11 by GCMartin
Camera detection
Good vision Barry. PUPs auto-detection maturing into multimedia area. Users will directly benefit from this.

Thanks


Posted on 8 Oct 2011, 6:17 by Dougal
udev
Barry, what you're supposed to do is use /usr/lib/libgphoto2/print-camera-list to create a udev rule that contains the list of all supported cameras and sets a variable (ID_GPHOTO2 or such), which you can later detect with your rule... I've been meaning to contact Richard (rerwin) and see if he has a camera and can fix it, as he has quite a bit of experience with udev.

As for Gtkam, I've always had the problem of it crashing when I try to download the files (which I can get past by right-clicking and selecting "save directory tree")... but it's much simpler that I don't have to play with it and the photos just automatically get downloaded.