Digital Cameras

From ArchWiki
Revision as of 17:44, 23 July 2005 by Mr Green (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Digital Cameras

This document attempts to configure hotplug so that the members of the \"users\" group can access a digital camera over USB. The aim was to keep this document simple and thus special cases are not covered. However, the content of this document is mainly a summary of [1], and people in need of further information may consult this site.

nb: remember to set your camera to ptp-mode(and maybe some cams require mass-storage mode?) The list of cameras that libgphoto2 supports can be found at [2]]. If your camera is not listed, you may still be able to use it with linux if the camera acts as if it were just a USB mass storage. There is another article in this Wiki, [[USB Sticks], that describes this procedure.

Install hotplug and libgphoto2

  1. Verify that you have the necessary packages installed on your system.
 <verbatim>
 # pacman -Q hotplug libgphoto2
 </verbatim>
  1. You may also download gtkam (a frontend to gphoto2 unless you want to learn yet-another-cmd-line-app.
 <verbatim>
 # pacman -S gtkam
 </verbatim>
  1. If pacman complains that one or both of the packages is not installed, you can install them with:
 <verbatim>
 # pacman -S hotplug
 </verbatim>
 and/or
 <verbatim>
 # pacman -S libgphoto2
 </verbatim>

Configuring hotplug

  1. Open a terminal and log in as root
  1. Create or append to usbcam.usermap file by typing
 <verbatim>
 # /usr/lib/libgphoto2/print-usb-usermap >> /etc/hotplug/usb/usbcam.usermap
 </verbatim>
  1. libgphoto2 offers ready-to-use scripts for hotplug. Copy the script for group access to the correct location
 <verbatim>
 # cp /usr/share/libgphoto2/2.1.5/linux-hotplug/usbcam.group /etc/hotplug/usb/usbcam
 </verbatim>
 You may need to change the path to reflect more recent versions of libgphoto2
  1. Open the newly copied file in your favourite text editor, e.g.
 <verbatim>
 # vi /etc/hotplug/usb/usbcam
 </verbatim>
 and change the line
 <verbatim>
 GROUP=camera
 </verbatim>
 to
 <verbatim>
 GROUP=users
 </verbatim>
 Save and close the file.
 Alternatively, you can leave the GROUP set to camera, and add users who should have access to the camera to the camera group on your system. You will also need to create the group.
  1. Make the script executable
 <verbatim>
 # chmod +x /etc/hotplug/usb/usbcam
 </verbatim>

Test your setup

  1. To test your setup, plug in your camera and turn it on. If it was already plugged in before, turn it off and on again.
  1. List the contents of /proc/bus/usb by typing
 <verbatim>
 # ls -lR /proc/bus/usb
 </verbatim>
 There should be at least one device which doesn't say \"root\" twice. On my machine, the output looks like so:
 <verbatim>
 ...
 /proc/bus/usb/004:
 total 0
 -rw-r--r--  1 root root   43 Apr 12 16:05 001
 -rw-r--r--  1 root root   43 Apr 12 16:05 002
 -rw-r--r--  1 root root   59 Apr 12 16:05 003
 -rw-r--r--  1 root root  211 Apr 12 16:05 004
 -rw-rw----  1 root users  57 Apr 12 17:58 007
 ...
 </verbatim>
 Note the last line.

Use your camera in your favourite application

You can now use gphoto2 or a recent version of gthumb to download pictures from your camera. Enjoy!