If not, then please click on the following link: http://users.bigpond.net.au/blmiller/linux/c5050.html
Please update any links to this page you may have had.
Some useful links:
Most distributions come with a kernel with just about all options and drivers compiled as modules. You may find that you don't need to compile your kernel to get things going; just loading the necessary modules.
As I compile my kernels for just the hardware I have, I see no need to use modules. So all drivers are part of the kernel. It's a personal choice, so go with what ever you feel is right.
<*> Support for USB [ ] USB verbose debug messages --- Miscellaneous USB options [*] Preliminary USB device filesystem [ ] Enforce USB bandwidth allocation (EXPERIMENTAL) [ ] Long timeout for slow-responding devices (some MGE Ellipse UPSe --- USB Host Controller Drivers <*> EHCI HCD (USB 2.0) support (EXPERIMENTAL) <*> UHCI (Intel PIIX4, VIA, ...) support < > OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support --- USB Device Class drivers < > USB Audio support < > USB Bluetooth support (EXPERIMENTAL) < > USB MIDI support <*> USB Mass Storage support [ ] USB Mass Storage verbose debug [ ] Datafab MDCFE-B Compact Flash Reader support [ ] Freecom USB/ATAPI Bridge support [ ] ISD-200 USB/ATA Bridge support [ ] Microtech CompactFlash/SmartMedia support [ ] HP CD-Writer 82xx support [ ] SanDisk SDDR-09 (and other SmartMedia) support [ ] SanDisk SDDR-55 SmartMedia support [ ] Lexar Jumpshot Compact Flash Reader < > USB Modem (CDC ACM) support [Rest of config lines not shown...]
<*> SCSI support --- SCSI support type (disk, tape, CD-ROM) <*> SCSI disk support (40) Maximum number of SCSI disks that can be loaded as modules <*> SCSI tape support < > SCSI OnStream SC-x0 tape support < > SCSI CD-ROM support <*> SCSI generic support --- Some SCSI devices (e.g. CD jukebox) support multiple LUNs [*] Enable extra checks in new queueing code [*] Probe all LUNs on each SCSI device [*] Verbose SCSI error reporting (kernel size +=12K) [ ] SCSI logging facility SCSI low-level drivers --->
[ ] Quota support < > Kernel automounter support <*> Kernel automounter version 4 support (also supports v3) < > Reiserfs support < > ADFS file system support (EXPERIMENTAL) < > Amiga FFS file system support (EXPERIMENTAL) < > Apple Macintosh file system support (EXPERIMENTAL) < > BeOS file systemv(BeFS) support (read only) (EXPERIMENTAL) < > BFS file system support (EXPERIMENTAL) <*> Ext3 journalling file system support [ ] JBD (ext3) debugging support <*> DOS FAT fs support <*> MSDOS fs support < > UMSDOS: Unix-like file system on top of standard MSDOS fs <*> VFAT (Windows-95) fs support
and you should get output that looks somethg like$ ls -l /proc/bus/usb
If you don't get this, then check that the Preliminary USB device filesystem has been mounted. There should be the following line in your /etc/fstab:dr-xr-xr-x 1 root root 0 Feb 2 2003 . dr-xr-xr-x 4 root root 0 Feb 2 2003 .. dr-xr-xr-x 1 root root 0 Feb 2 2003 001 dr-xr-xr-x 1 root root 0 Feb 2 2003 002 dr-xr-xr-x 1 root root 0 Feb 2 2003 003 dr-xr-xr-x 1 root root 0 Feb 2 2003 004 -r--r--r-- 1 root root 0 Feb 2 2003 devices -r--r--r-- 1 root root 0 Feb 2 2003 drivers
and mount it as root with:none /proc/bus/usb usbdevfs defaults 0 0
$ mount /proc/bus/usb
Take a look in /proc/bus/usb/devices. There is lots of information, but look closer and you should see your camera.
Also check that it shows up with a Driver type being usb-storage. Now we have contact!T: Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI Root Hub S: SerialNumber=b400 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=07b4 ProdID=0105 Rev= 1.00 S: Manufacturer=OLYMPUS S: Product=C5050Z S: SerialNumber=000244703998 C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms T: Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI Root Hub S: SerialNumber=b000 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI Root Hub S: SerialNumber=b800 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6 B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.04 S: Manufacturer=Linux 2.4.20 ehci-hcd S: Product=Intel Corp. 82801DB USB EHCI Controller S: SerialNumber=00:1d.7 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=256ms
Another nice thing to check is the /var/log/messages or /var/adm/messages file. Do a tail on this and you should see the following:
This tells you which SCSI disk that your camera is going to be. In this case it will be /dev/sda.Feb 1 23:20:43 maverick kernel: hub.c: new USB device 00:1d.2-2, assigned address 2 Feb 1 23:20:43 maverick kernel: scsi1 : SCSI emulation for USB Mass Storage devices Feb 1 23:20:43 maverick kernel: sda:<7>usb-storage: queuecommand() called
If that's not enough looking around you can always have a look in /proc/scsi/scsi. I have a real Advansys SCSI card with a DAT tape drive on it, so I get the following:
You can also take a look in /proc/scsi/usb-storage-0/1 which will show you:Host: scsi0 Channel: 00 Id: 06 Lun: 00 Vendor: ARCHIVE Model: 4326XX 27871-XXX Rev: 0322 Type: Sequential-Access ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: OLYMPUS Model: C5050Z Rev: 1.00 Type: Direct-Access ANSI SCSI revision: 02
Host scsi1: usb-storage Vendor: OLYMPUS Product: C5050Z Serial Number: 000244703998 Protocol: Transparent SCSI Transport: Bulk GUID: 07b401050000000244703998 Attached: Yes
As root, mount the camera with the following command:
If all works, the red LED on the rear right of the camera should flicker for a second and you're in. To see what you have on the camera, you can use any of the standard command line commands like cd, ls, cp, rm, etc. To see what is available on the camera, you can do the following command:$ mount -t vfat /dev/sda1 /mnt/camera
and get something like the following:$ find /mnt/camera
In this case, I have only 2 JPEG images stored in the camera./mnt/camera /mnt/camera/dcim /mnt/camera/dcim/100olymp /mnt/camera/dcim/100olymp/p2010001.jpg /mnt/camera/dcim/100olymp/p2010002.jpg
Umount the camera with the following command:
WARNING! Never power off or disconnect the camera before unmounting the device. If you do you risk corrupting the camera file system and trashing your pictures.$ umount /mnt/camera
Now any non-root user can mount and umount the camera with the following commands:/dev/sda1 /mnt/camera vfat rw,noauto,user 1 0
This might be as far as you are interested in going as it's a working solution.$ mount /mnt/camera $ umount /mnt/camera
The autofs tools are available from:
Compile and install them according the their documentation.ftp://ftp.kernel.org/pub/linux/daemons/autofs/testing-v4/
I deleted the /mnt directory and everything below it and recreated an empty /mnt directory.
My /etc/auto.master looks like:$ rm -rf /mnt $ mkdir /mnt
and my /etc/auto.mnt looks like:/mnt /etc/auto.mnt
which not only covers the camera, but the CD-ROM and floppy disk too.cdrom -fstype=iso9660,ro :/dev/hdc camera -fstype=vfat,rw,umask=000 :/dev/sda1 floppy -fstype=auto,rw :/dev/fd0
I use Slackware Linux, so I started automount in the /etc/rc.d/rc.M script. On other systems this may go somewhere like the rc.local file or in a new init script if you use a System V style startup. The actual script code I added in is:
This starts the automount daemon so that it will automatically unmount /mnt/camera after it has not been used for 5 seconds.# Start the automounter... if [ -f /etc/auto.master ]; then /usr/sbin/automount --timeout 5 /mnt file /etc/auto.mnt fi
NOTE: If you change into the /mnt/camera directory or any of its subdirectories then it will not be unmounted after 5 seconds of inactivity because your presence there is enough to keep it mounted.
This is a very useful utility that can read information from the JPEG Header on each picture. In this header there is a lot of information about the picture and the camera settings used in taking it. It also lets you access the thumbnail image that's also in the header.http://www.sentex.net/~mwandel/jhead/
The actual script is called /usr/local/bin/c5050 and is as follows:bash-2.05$ jhead 2003-01-30_18:24:05.jpg File name : 2003-01-30_18:24:05.jpg File size : 3523123 bytes File date : 2003:02:04 23:09:01 Camera make : OLYMPUS OPTICAL CO.,LTD Camera model : C5050Z Date/Time : 2003:01:30 18:24:05 Resolution : 3200 x 2400 Flash used : No Focal length : 21.3mm Exposure time: 0.0025 s (1/400) Aperture : f/2.6 ISO equiv. : 64 Metering Mode: matrix Jpeg Quality : fine Jpeg process : Baseline
#!/bin/sh # # Shell script to copy JPEG files from the Olympus C-5050Zoom # camera to the local directory. In the process it renames them # to their date and time that they were taken. # ########################################################################## # c5050_get() - get images from camera directory ########################################################################## c5050_get() { photonum=1 echo "Copying `ls -1 $IMAGEDIR/*.jpg | grep -c .` files..." for f in $IMAGEDIR/*.jpg do # temp name of photo being copied tempname=`basename $f` # copy the image from the camera... cp $f $tempname # print the photo number printf "%3d - " $photonum photonum=`echo "$photonum + 1" | bc` # rename it to it's date & time /usr/local/bin/jhead -n%Y%m%d_%H%M%S $tempname sync done sync } ########################################################################## # c5050_delete() - delete all images from camera directory ########################################################################## c5050_delete() { photonum=1 echo "Deleting `ls -1 $IMAGEDIR/*.jpg | grep -c .` files..." for f in $IMAGEDIR/*.jpg do # temp name of photo being deleted tempname=`basename $f` # print the photo number printf "%3d - deleting %s..." $photonum $tempname photonum=`echo "$photonum + 1" | bc` # rename it to it's date & time rm $f echo "done" done printf "Syncing filesystem..." sync printf "done\n" } ########################################################################## # c5050_rotate() - rotate images in current directory ########################################################################## c5050_rotate() { degrees=$2 shift 2 case $degrees in 90|180|270) break ;; *) echo "Invalid degrees for rotation, should be 90, 180 or 270." exit ;; esac for f in $* do if [ -f $f ] then printf "Rotating file $f $degrees degrees..." jpegtran -rotate $degrees -copy all $f > rotated.$f mv rotated.$f $f echo "done" fi done } ########################################################################## # c5050_help() - basic help ########################################################################## c5050_help() { echo "Usage:" echo " c5050 -delete" echo " c5050 -get" echo " c5050 -help" echo " c5050 -rotate 90|180|270 [filenames...]" echo "" echo " -delete delete ALL JPEG files in the camera." echo " -get copy all JPEG files in the camera to the current" echo " working directory and naming them based upon the" echo " date & time they were taken." echo " -help You are looking at it." echo " -rotate rotate the JPEG files given on the command line" echo " by 90|180|270 degrees." } ########################################################################## # main() - main start of script... ########################################################################## IMAGEDIR=/mnt/camera/dcim/100olymp case $1 in -g*) c5050_get ;; -d*) c5050_delete ;; -r*) c5050_rotate $* ;; *) c5050_help esac
The error looks like:
The problem is that Linux only looks at the disk geometry the first time the camera is plugged in. So when you unplug the camera and change the memory card Linux does not check to see if the geometry has changed. I saw this by looking in /var/log/syslog and connecting/disconnecting the camera while changing the card. Only on the first conection does a message on the geometry come up. It looks something like:bash-2.05$ mount /camera mount: wrong fs type, bad option, bad superblock on /dev/sda1, or too many mounted file systems bash-2.05$
In this case it shows that it (first) detected my 32M xD card. If I then switched the card to being my Compact Flash and tried to mount it I'd get messages like:Mar 26 22:41:21 maverick kernel: Vendor: OLYMPUS Model: C5050Z Rev: 1.00 Mar 26 22:41:21 maverick kernel: Type: Direct-Access ANSI SCSI revision: 02 Mar 26 22:41:21 maverick kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0 Mar 26 22:41:21 maverick kernel: SCSI device sda: 64000 512-byte hdwr sectors (33 MB) Mar 26 22:41:21 maverick kernel: sda: Write Protect is off
To get around this problem I found that there is a way to dynamically remove and add SCSI devices. It's really made for SCSI hot swappable devices and is found in the SCSI-2.4-HOWTO. So once you have changed the card and reconnected it to your PC, you have to dynamically remove it, then dynamically add it. The commands to do this are:Mar 26 22:42:01 maverick kernel: FAT: bogus logical sector size 0 Mar 26 22:42:01 maverick kernel: VFS: Can't find a valid FAT filesystem on dev 08:01.
The values for host, bus, id and lun can all be obtained from the message shown above in the syslog file:echo "scsi remove-single-device host bus target lun" > /proc/scsi/scsi echo "scsi add-single-device host channel id lun" > /proc/scsi/scsi
So fo my camera, the commands look like:Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0 ^ ^ ^ ^ | | | | host ------------ | | | bus ----------------------- | | id ----------------------------- | lun ------------------------------------
If you don't already have a SCSI card in your PC, then the value for host will most likely be '0'.echo "scsi remove-single-device 1 0 0 0" > /proc/scsi/scsi echo "scsi add-single-device 1 0 0 0" > /proc/scsi/scsi
If I now change my camera to use the Compact Flash and connect it to my PC, then (as root) run the two commands above, I get the following in my syslog:
So now it's got the right geometry for the Compact Flash and I can go ahead and mount it.Mar 26 23:17:11 maverick kernel: Vendor: OLYMPUS Model: C5050Z Rev: 1.00 Mar 26 23:17:11 maverick kernel: Type: Direct-Access ANSI SCSI revision: 02 Mar 26 23:17:11 maverick kernel: Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0 Mar 26 23:17:11 maverick kernel: SCSI device sda: 250880 512-byte hdwr sectors (128 MB) Mar 26 23:17:11 maverick kernel: sda: Write Protect is off
But wait, there's more... This can be automated. I read in /usr/src/linux/Documentation/usb/hotplug.txt that when ever hot pluggable devices are added or removed a program called /sbin/hotplug is run if it exists. I have written a little shell script and called it /sbin/hotplug that detects whenever the camera is added and runs the two command above to remove, then add the SCSI camera device. (Remember to change the two lines in the script to reflect the actual SCSI parameters of your camera.) This looks like:
To get /sbin/hotplug to run automatically, it needs to be made executable with a "chmod 755 /sbin/hotplug" and the option compiled into the kernel. This option is found in the General setup section:#!/bin/sh echo "------------------ `date` ------------------------" >> /var/log/hotplug.txt echo "ACTION: $ACTION" >> /var/log/hotplug.txt echo "PRODUCT: $PRODUCT" >> /var/log/hotplug.txt echo "TYPE: $TYPE" >> /var/log/hotplug.txt echo "INTERFACE: $INTERFACE" >> /var/log/hotplug.txt echo "DEVICE: $DEVICE" >> /var/log/hotplug.txt echo "DEVFS: $DEVFS" >> /var/log/hotplug.txt if [ "$ACTION" = "add" -a "$PRODUCT" = "7b4/105/100" ] then echo " Olympus C5050Z add detected..." >> /var/log/hotplug.txt echo "scsi remove-single-device 1 0 0 0" > /proc/scsi/scsi echo "scsi add-single-device 1 0 0 0" > /proc/scsi/scsi fi if [ "$ACTION" = "add" -a "$PRODUCT" = "4da/2312/100" ] then echo " Panasonic NV-MX500 add detected..." >> /var/log/hotplug.txt echo "scsi remove-single-device 1 0 0 0" > /proc/scsi/scsi echo "scsi add-single-device 1 0 0 0" > /proc/scsi/scsi fi
Once you have done all of this, you should have no problems with changing the memory card in your camera (when it's disconnected of course). You can monitor this happening by looking in your /var/log/syslog and /var/log/hotplug.txt files.[*] Networking support [*] PCI support (Any) PCI access mode [*] ISA bus support [*] PCI device name database [ ] EISA support [ ] MCA support [*] Support for hot-pluggable devices PCMCIA/CardBus support ---> PCI Hotplug Support --->
Digital Photography Review - Olympus ForumUser Pages:
MSN Group - Olympus Camedia 5050 Support Group
Yahoo Group - Olympus 4040 and 5050
Olympus 5050 digital camera online resource
Number of times page accessed since March 28, 2003:
free hit counter