A digital photo camera can be so nice, but if you had to switch to M$Win to view the pictures you might just forget about it completely. A similar problem exists for parallel-port scanners which also are not well-supported by Linux. Of course, you could buy a program like VMware and use M$Win on Linux but a cost-free and Linux-native version would be nicer, wouldn't it?

For digital photo cameras, a solution exists: gphoto. With this program, digital cameras from different companies can be read out via the serial port and a few even via the USB port. The list of all supported modules can be found at . Most of the listed cameras are too old to be sold on the market. The protocol that is used to read out the camera is often similar if not identical compared to the new models. The main research activities of the companies focuses on the hardware of the cameras (resolution, compact size, ... ) and not the software. Before you spend money for a digital camera, you should test to see if the camera works well with gphoto.

How could we test the program gphoto if we did not own a digital camera? We asked different companies for a test camera but only CANON and OLYMPUS supported us. CANON sent us their PowerShot20. OLYMPUS lent us their C-3030ZOOM and C-2100UZ for intensive tests. The two OLYMPUS cameras were not on the list of gphoto (20th of Nov. 2000) but they seem to use the same protocol as the older already-listed cameras.


First you get the latest version of gphoto on your computer. The source code and already-compiled packages for different systems (Mac, M$Win and Linux) and distributions can be downloaded from l . Decompress the source code to the /tmp-directory:

  >> tar zxvf gphoto-0.4.3.tar.gz -C /tmp

Then you change to the created directory and run "make":

  >> cd /tmp/gphoto-0.4.3/
  >> ./configure
  >> ./make

Now you can start gphoto. Therefore you change to the src/ sub-directory and start

  >> ./gphoto

Now you connect the digital photo camera to the serial port of the computer. (In general, the link cable in the camera package has a 9pin serial connector. If your single 9pin connector is used for the mouse and only the 25pin connector remains, you have to buy an adapter first.) In gphoto, you change into the menu Configure -> Select Port-Camera Model and there you choose your camera or an older model.

If you know the serial port address (COM1 through COM4 corresponds to ttyS0 through ttyS3 on Linux), the camera is connected and you can finish the configuration.
Otherwise, you have to repeat the following steps for all serial ports until the camera responds.
By default the serial ports can not be accessed by normal users but only root. However you should use gphoto with your personal account and thus the read and write access has to be weakened by resetting the file permissions.
For the COM1 (corresponds to ttyS0 on Linux) this happens as root with:

  >> chmod a+rw /dev/ttyS0

You now click in the window on the "Save-Button".
If gphoto reports an error (bottom-left in the main window), you try the procedure with a different serial port.

Download of the pictures

Most important is downloading the taken pictures, although gphoto offers other features as well (more about these later).
First you can download the thumbnail from the camera. Therefore, gphoto offers two ways: either you just download the number of the pictures which will be displayed by small empty pictures. Or you download the real thumbnails which you see at the backside of the camera. The first option works faster and is recommended if you know exactly which pictures you want to download.
Downloading pictures with the CANON camera, you have to set the wheel on the camera to a special position which does not allow you to look at the index at the same time, so you always have to download the thumbnail.
The OLYMPUS camera can be set in any mode (except off) and communication between camera and computer is always working.

After you know which pictures are worth a download, you check these and then select Camera -> Download Selected -> Images -> Save to Disk. After specifying the prefix of the file name and the selection of the destination directory, the download starts. The prefix is put at the beginning of the file name and the number of the thumbnail is added behind. Depending on the size and number of pictures you want to download, this can take a while.

The transmission can be followed in the terminal window in which you started gphoto.
The download from the CANON camera was quite problematic in a few cases. The terminal showed quite a few debug messages. In addition, it was not possible to download the largest picture that can be taken by the camera. Gphoto always stopped in the procedure and could not be used any longer. It had to be killed and re-started. A few times even the thumbnails could not be downloaded. A re-start of gphoto solved this problem. This error appeared independently ofthe PC being used.
Maybe CANON should support the developers of gphoto or become involved in the programming of the camera module. As far as I know, no company provides a native Linux driver for their digital cameras. If a company decides to support Linux, the image of the company inside the Linux community will be very much enhanced. As least a link to gphoto placed on the Internet page of the companies, would be a good sign.

Manipulating pictures with gphoto

Gphoto offers the ability to download the pictures without saving them to disk and the pictures can be manipulated within gphoto itself. This makes sense if you have not become familiar with another graphic program.
What must not be missing in any image program is the option to rotate the pictures in steps of 90 degrees. In addition several manipulations like contrast, brightness and colors can be changed. Unfortunately an automatic red-eye reduction is missing.
Gphoto offers all the basic functions of a graphic program.
For small changes it is sufficient, but a professional-level manipulation should be done with Gimp (Homepage: ).

More than saving pictures

The functionality of gphoto does not end with manipulating pictures. Another feature is the use of the digital camera as a webcam. The actual picture can be taken by every click with the mouse or continuously. The slow connection via the serial port allows to you to grab about two pictures per second. Even it is possible to shoot pictures via mouse click. In addition, the camera settings (resolution, brightness) can be set from the PC via gphoto.

The actual use of these features depends, of course, on the connected camera. The CANON camera has to be set to a special setting where no pictures can be taken, thus no photos can be shoot via mouse click. The OLYMPUS camera worked with (nearly) no problems. Just one crazy behavior occurred: If we selected Camera->Live Preview!, then a new window appeared and disappeared (or flashed) on the screen and gphoto crashed. After re-starting gphoto, this function worked correctly and this problem could be reproduced.

gphoto and USB

With the OLYMPUS camera, we were able to test the USB support with the new 2.4.0 kernel. The OLYMPUS C-3030Z was not specifically supported with this kernel, but the USB port recognized the camera. The cameras which are supported via USB are listed at eras.html .
The correct use of USB supported cameras is explained in the following steps

    First you have to build and install a new kernel (2.2.19 or 2.4.x) with USB support. As well, the corresponding /proc device should be activated. It isn't required for the functionality but this will be the only way to see if your camera is connected and supported.
    If the device /dev/tys.. or /dev/usb/ty.. do not exist, they have to be generated:

      >> mknod -m 0660 /dev/usb/dc2xx0 c 180 80
      >> mknod -m 0660 /dev/usb/dc2xx1 c 180 81

    After starting the new kernel and connecting the camera to the USB port, you see if the camera was recognized correctly. To do this, you type:

      >> cat /proc/bus/usb/devices

    There should appear something like:

              T:  Lev=01 Prnt=00 Port=00 Cnt=01 Dev#=  1 Spd=12  MxCh= 0
              D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
              P:  Vendor=040a ProdID=0120 Rev= 1.08
              S:  Manufacturer=Eastman Kodak Company
              S:  Product=KODAK DC240 Zoom Digital Camera
              C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=100mA
              I:  If#= 0 Alt= 0 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=dc2xx
              E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=  0ms
              E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=  0ms

    Behind driver you find the name of the driver which will be used by gphoto. If you find a (none) there your camera is not supported via USB. For all other lucky users, the procedure continues.
    USB is only supported in the latest version of gphoto, thus you should download the latest code from the CVS server. A free beta version gphoto-2.0beta1.tar.gz exists which uses the library libusb. In the following, we briefly describe the installation of the CVS code.
    To do this, you enter in a terminal (Documentation at l):

      >> export

    Then you log in as an anonymous user:

      >> cvs login

    The user name is anonymous, no password is required (press the Enter key). The most current code is obtained by executing

      >> cvs -z3 checkout gphoto

    gphoto can be compiled now, just type:

      >> cd gphoto-x.x.x
      >> ./configure
      >> ./make
      >> ./make install

    Now you can start gphoto and it should recognize the camera automatically. If not, then you choose the correct port using the menu Configure -> Select Port-Camera Model and select the button "other" and enter the correct path to the correct device, e.g. /dev/usb/dc2xx0. From now on, the camera should work as if it were connected to the serial port.

Click here to download the software ==> gPhoto


Post a Comment