3. Communicating With the DC-Series Cameras

The below sections are specific to camera models and/or groups of camera models. A particular camera model may be listed in more than one section as it may be supported by more than one method. One method may be easier than another and a specific method may meet your needs better. Select the method used carefully and read all the options before choosing one, it could save a lot of time later on.

If a PC-Card reader is available, or a laptop computer with one built in, following the Compact Flash PC Card Adapter/PCMCIA-ATA Storage Card should be generic enough to work on almost all Kodak DC-Series Cameras and many non-Kodak digital cameras. Be aware that there are adapters for almost all memory devices used in digital cameras to another more common technology. Floppy Disk adapters for smart memory cards may work for cameras that use smart memory cards. These methods also tend to offer fast data transfer rates and are the preferred method of many.

Although something may not be mentioned as to working with a particular piece of software don't assume that means the camera does not work with the software package. Often a camera works with the protocols other digital cameras use and past methods will work. If one finds a method works that is not mentioned in the HOWTO don't neglect to send in the information to this documents author, David Burley.

3.1. DC40, DC50, DC120, DC200, DC210

All of these cameras provide mechanisms for data transfer via standard RS232 serial port. This section is tailored to those who wish to use their digital camera with the kdpci application. The following steps are untested, however there is no reason for them to not work. If one finds that the steps do or do not work please send a report to David Burley so that the status may be noted here.

3.1.1. Serial Camera Control

Additional notes regarding transfer of data from these cameras using RS232 serial support will be added in a future version of this HOWTO. All GNU/Linux distributions should be configured in such a way with a default install that serial communications with the camera should not require any kernel configuration at all. See the kdcpi portion of the Software section for more information regarding use and configuration of kdcpi.

3.2. DC20, DC25, DC200+, DC210, DC210+ Zoom, DC215, DC220, DC220+, DC240, DC260, DC265, DC280, DC290

All of the cameras provide mechanisms for data transfer via standard RS232 serial port. Some of the cameras provide mechanisms for data transfer via USB (universal serial bus). This section is tailored to those who wish to use their digital camera with gPhoto. Please refer to the gPhoto portion of the Software section of this document for more information pertaining to application usage.

The following steps are untested, however there is no reason for them to not work. If one finds that the steps do or do not work please send a report to David Burley so that the status may be noted here.

3.2.1. Serial Camera Control

Additional notes regarding transfer of data from these cameras using RS232 serial support will be added in a future version of this HOWTO. All GNU/Linux distributions should be configured in a such a way with a default install that serial communications with the camera should not require any kernel configuration at all. See the gPhoto portion of the Software section for more information regarding use and installation of gPhoto.

3.2.2. USB Camera Control

There are no special drivers or kernel changes needed to support the DC220, DC260, DC265 and DC290 cameras under this configuration. gPhoto contains the necesary drivers to support USB transfer from these cameras. However if the dc2xx kernel module is loaded it may be necesary to remove it else a resource busy error may occur. To remove the module run the following command:

bash# /sbin/rmmod dc2xx
   

Attempting to remove the module even if it is not loaded will not cause any harm, so it is suggested that one remove it before starting gPhoto and connecting to the camera via USB. See the gPhoto portion of the Software section for more information regarding use and installation of gPhoto.

3.3. DC220, DC260, DC265, DC290 (HP Photosmart C500?)

The cameras provide mechanisms for data transfer via standard RS232 serial port, USB (Universal Serial Bus) and IrDA (infrared) interface. Additionally, images may be offloaded from the camera through the removal of the camera's Compact Flash Card and use of a Compact Flash PC Card Adapter in a PC Card reader or notebook PC Card slot. Currently these cameras are supported by OpenDiS for USB, IrDA and Serial data transfer. For usage examples and information on how to install and configure the application to work with the cameras, refer to the Open Digita Services portion of the Software section.

Please note that the steps below have only been verified to work with the Kodak DC-265; reports of other models that work with the same steps should be sent to David Burley. There is no reason the steps should not work for all digital cameras that run DigitaOS.

3.3.1. Serial Camera Control

Additional notes regarding transfer of data from DigitaOS enabled cameras using RS232 serial support will be added in a future version of this HOWTO. All distributions should be configured in such a way with a default install that serial communications with the camera should not require any kernel configuration at all. See the OpenDiS and/or Digita Operating Environment -- Command Device Protocol Python Script portion of the Software section for information regarding serial camera control.

3.3.2. 2.2.x Kernel USB Support

This section only applies to those running a 2.2.x series kernel. For those running a 2.4.x series kernel skip this section. At the moment the USB implementation in the 2.2.x series is insufficient and substantially out of date. As such, most USB devices are unsupported natively with the included drivers. However there is a patch available for the 2.2.15 - 2.2.17 kernels.

What software is needed (if not already present):

  1. usb-2.4.0-test2-pre2-for-2.2.16-v3.diff.gz

  2. Linux Kernel 2.2.17

This document assumes a working knowledge of kernel and program compiling. If unfamiliar with the process please go and read the Kernel-HOWTO.

Applying the patch:

bash# cp usb-2.4.0-test2-pre2-for-2.2.16-v3.diff.gz /usr/src
bash# gunzip /usr/src/usb-2.4.0-test2-pre2-for-2.2.16-v3.diff.gz
bash# cd /usr/src/linux
bash# patch -p1 < ../usb-2.4.0-test2-pre2-for-2.2.16-v3.diff
   

Select the following to be built as either modules or part of your kernel:

  1. Support for your USB controller (It is suggested that all of these be compiled as modules unless the controller type is known.).

  2. USB Kodak DC-2xx Camera Support.

  3. Preliminary USB Device Filesystem.

Reboot the system and then load the created modules if the support is not compiled into the kernel. To load the modules do the following:

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/usbcore.o
   

Use the following if the USB controller uses either an Intel or a VIA chipset. Some others may also be supported:

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/usb-uhci.o
   

Use the following if the above did not work and this is the controller type:

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/uhci.o 
   

Use this if the USB controller uses an SiS chipset, is a Compaq, or because the above two didn't seem to work and this is the only option left to try.

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/usb-ohci-hcd.o 
   

Load the module for Kodak Digital Camera support:

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/dc2xx.o 
   

Mount the USB Device Filesystem:

bash# mount -t usbdevfs ignored /proc/bus/usb
   

3.3.3. 2.4.x Kernel USB Support

This section only applies to those running a 2.4.x series kernel. For those running a 2.2.x series kernel skip this section and follow the 2.2.x Kernel USB Support section. The 2.4.x series kernels have USB supported natively which makes it a bit easier to configure than for the 2.2.x kernel series.

What software is needed (if not already present):

  1. Linux Kernel 2.4.0

This document assumes a working knowledge of kernel and program compiling. If unfamiliar with the process please go and read the Kernel-HOWTO.

Select the following to be built as either modules or part of your kernel:

  1. Support for your USB controller (It is suggested that all of these be compiled as modules unless the controller type is known.).

  2. USB Kodak DC-2xx Camera Support.

  3. Preliminary USB Device Filesystem.

Reboot the system and then load the created modules if the support is not compiled into the kernel. To load the modules do the following:

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/usbcore.o
   

Use the following if the USB controller uses either an Intel or a VIA chipset. Some others may also be supported:

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/usb-uhci.o
   

Use the following if the above did not work and this is the controller type:

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/uhci.o 
   

Use this if the USB controller uses an SiS chipset, is a Compaq, or because the above two didn't seem to work and this is the only option left to try.

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/usb-ohci-hcd.o 
   

Load the module for Kodak Digital Camera support:

bash# /sbin/insmod /lib/modules/$(uname -r)/usb/dc2xx.o 
   

Mount the USB Device Filesystem:

bash# mount -t usbdevfs ignored /proc/bus/usb
   

3.3.4. Kernel USB Devices

The following is a bash shell script designed to create all 16 Kodak devices for use with both the current 2.4.x kernel series and the obsoleted 2.2.X kernel series with the current USB backport. Copy the text below into a file named MakeKodakDev, then make that file executable by typing 'chmod +x MakeKodakDev' and then run the script ./MakeKodakDev as root (or su'd to root) it will create the devices so they don't have to be made individually by hand.

It creates as per the dc2xx.txt file in the kernel documentation the following 16 devices:

/dev/dc2xx0 type=character major=180 minor=80

...

/dev/dc2xx16 type=character major=180 minor=95

# Filename: MakeKodakDev
# Creates the device files for USB access of Kodak digital cameras.
# Last Modified January 6, 2001 
# Please see the Kodak Digital Camera HOWTO for more information 
# http://www.marblehorse.org/projects/documentation/kodak/
#!/bin/sh

export scrapvar=0
 
   while [ $scrapvar -lt 17 ];
      do mknod -m 0666 /dev/dc2xx$scrapvar c 180 $(( $scrapvar + 80 ));
      scrapvar=$(( $scrapvar + 1 ));
   done

# EOF
   

3.3.5. Kernel IrDA Support

Most newer distributions come with IrDA support and the proper utilities to handle IrDA. Redhat 7.0 is one of them. However for the rest of us some configuration will be necessary. Get a copy of the latest kernel (2.2.x series or above) and compile all the IrDA features in as modules. IrDA works a lot like PCMCIA support in GNU/Linux so it is important to have all the modules for any other IrDA devices one may have. There is a good HOWTO on compiling a new kernel, the Kernel-HOWTO. Please refer to it for questions regarding configuring and compiling a new Linux kernel.

3.3.6. IrDA Utils Software

The next step in configuring IrDA support is installing the irda-utils package. Unfortunately, at the time of the current version of this HOWTO, the author had problems locating the source archive for the utilities so he took the one Redhat uses to build their RPM for Redhat 7.0. Please note that root permissions will be necesary to run the commands needed to install the software but should not be necesary to access the camera.

What software is needed (if not present already):

  1. irda-utils 0.9.10 and patches

  2. gpg signature for the irda-utils archive

Extracting the archive, patching, compiling and installing it:

bash# cp irda-utils-0.9.10+patches.tar.gz /usr/src
bash# cd /usr/src
bash# tar zxvf irda-utils-0.9.10+patches.tar.gz
bash# tar zxvf irda-utils-0.9.10.tar.gz
bash# cd irda-utils-0.9.10
bash# patch -p1 < ../irda-utils-0.9.4-chkconfig.patch 
bash# patch -p1 < ../irda-utils-typo.patch
bash# patch -p1 < ../irda-utils-redhat.patch
bash# make
bash# make install
   

3.3.7. Creating the IrDA Device Nodes

The device nodes are necesary so that the application can talk to the driver for the device. Although the irlpt devices are not necesary to get the camera working, creating them now will save the time of having to look them up how to do it later if you do ever need them.

bash# mknod -m 0666 /dev/ircomm0 c 161 0
bash# mknod -m 0666 /dev/ircomm1 c 161 1
bash# mknod -m 0666 /dev/irlpt0 c 161 16
bash# mknod -m 0666 /dev/irlpt1 c 161 17
   

3.3.8. Modifying /etc/conf.modules or /etc/modules.conf

Use a text editor and open up /etc/conf.modules or /etc/modules.conf depending on your distribution. Add the following three lines to the file while being careful not to change any others.

#IrDA
alias tty-ldisc-11 irtty 
alias char-major-161 ircomm-tty
   

3.3.9. Enabling IrDA and Testing for Connectivity

Irmanager is what starts and stops the proper IrDA modules. The d1 flag tells irmanager to enter discovery mode.

As user root run the following command:

bash# /usr/sbin/irmanager -d1
   

Put the camera into connect mode and turn it on. Make sure that the camera is close to and facing the IrDA port on the computer. Run the following to see if there are any communications via IrDA:

bash$ /usr/bin/irdadump
   

After running the command one should see output similar to the following:

00:04:10.608823 xid:cmd bedcb551 > ffffffff S=6 s=2 (14)
00:04:10.698818 xid:cmd bedcb551 > ffffffff S=6 s=3 (14)
00:04:10.788815 xid:rsp bedcb551 < 5f36a4a1 S=6 s=3 Kodak DC265 Zoom hint=8404 [ Computer IrCOMM ]
(33) 00:04:10.798819 xid:cmd bedcb551 > ffffffff S=6 s=4 (14)
00:04:10.888815 xid:cmd bedcb551 > ffffffff S=6 s=5 (14)
00:04:10.978818 xid:cmd bedcb551 > ffffffff S=6 s=* armstrong hint=0400 [ Computer ] (25)

6 packets received by filter
   

If the previous message was not displayed, try relocating the camera closer or further away from the IrDA port and ensure that there is not too much external interference in the environment in the form of light. Also if the machine is a laptop with a PC-Card (or PCMCIA) modem removing it may help resolve the issue.

3.4. Compact Flash PC Card Adapter/PCMCIA-ATA Storage Card

This section is for those who wish to utilize maximum data transfer rate and save the battery power in the camera's batteries. The method of connectivity suggested in this section applies to all Kodak DC-Series cameras that use either PCMCIA-ATA storage cards or Compact Flash Cards. This method of picture access only allows for storage, retrieval, and deletion of images on a Compact Flash Card. These instructions are tested with a Kodak 16 MB Picture Card and a SanDisk CompactFlash PC Card Adapter on a Dell Inspiron 7000 notebook computer.

What software is needed (if not already present):

  1. PCMCIA-CS-3.1.21

This document assumes a working knowledge of kernel and program compiling. If unfamiliar with the process it is strongly suggested to go and read the Kernel-HOWTO.

Select the following to be built as either modules or part of your kernel:

  1. DOS FAT fs support

  2. VFAT (Windows-95) fs support

Reboot the system and then load the created modules each time access to the compact flash card is desired if the support is not compiled into the kernel. To load the modules do the following:

bash# /sbin/insmod /lib/modules/$(uname -r)/fat.o 
bash# /sbin/insmod /lib/modules/$(uname -r)/vfat.o 
  

Compile and configure PCMCIA-CS. This part of the process is beyond the scope of this document, however there is a document with such information that can be found in the PCMCIA-HOWTO. There is also most likely a pre-packaged version for the distribution of GNU/Linux the computer running. This step can be greatly simplified if a pre-packaged version is used.

Using the Compact Flash PC Card Adapter:

Create a directory to mount the Compact Flash Card to.

bash# mkdir /flashcard 
  

Insert the Compact Flash Card into the Compact Flash PC Card Adapter (both should face the same direction. Note that this step is unnecessary for the cameras that use a PCMCIA-ATA storage card.).

Insert the Compact Flash PC Card Adapter or PCMCIA-ATA storage card into the PC-Card slot of the notebook computer.

Mount the card to /flashcard (The Compact Flash Card PC Card Adapter/PCMCIA-ATA storage card is assigned its device by figuring out how many IDE controllers are on the system, and then assigning it the next device. For example, if a system were to have 2 IDE controllers, and would thus have /dev/hda /dev/hdb /dev/hdc and /dev/hdd assigned to the current controllers, the Compact Flash Card PC Card Adapter would be assigned /dev/hde1.).

bash# mount -t vfat /dev/hde1 /flashcard 
  

From this point the files can be copied, moved, deleted, and renamed as done on a normal filesystem. Information regarding file management commands may be found in the documentation included with the OS distribution used, such as man pages. The manual pages which list the commands to use to do the above procedures can be accesses by typing the following to get the command's respective manual page entry: 'man cp', 'man mv', 'man rm'. Before removing the Compact Flash Card PC Card Adapter remember to unmount it with the following command.

bash# umount /flashcard 
  

The Compact Flash Card PC Card Adapter/PCMCIA-ATA storage card can be removed from the PC Card Reader and the Compact Flash Card and be removed from the Compact Flash Card PC Card Adapter (If the adapter was used).