site  contact  subhomenews

Autodetect digital camera

October 07, 2011 — BarryK
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.


Username: Barryk
Correction, the above rule should be: [i]ACTION=="add", SUBSYSTEM=="usb", ENV{INTERFACE}=="6/1/*", RUN+="/usr/sbin/pupautodetect camera"[/i] ...note, I changed bInterfaceProtocol to anything. The other two should be enough.

Digital camera access GUI
Username: BarryK
"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.

Camera files in Woof
Username: BarryK
"New files in rootfs-skeleton are: /etc/udev/rules.d/88-puppy-autodetect.rules /usr/sbin/pupautodetect /usr/sbin/pupcamera

Username: BarryK

Camera detection
Username: GCMartin
"Good vision Barry. PUPs auto-detection maturing into multimedia area. Users will directly benefit from this. Thanks

Username: Dougal
"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.

Tags: wary