Upgrading gphoto2 for Raspberry Pi to solve Canon 5D MkIII issues

The awesome little Raspberry Pi arrived this week on Monday morning on my desk. Including all that one may need to build and make something marvellous. I decided to build a simple photobooth using the Canon 5D MkIII.

To access a camera with a Raspberry you’ll need a USB cable to connect the camera to the Raspberry Pi board and of course the gphoto2 library.

sudo apt-get gphoto2

I would also recommend updating the Raspbian system too.

sudo apt-get update
sudo apt-get upgrade

The last command will take some time to complete.

Only works once issue on Canon Cameras

Using the default gphoto2 I was able to connect to camera however only once! It seems to be a bug within the gphoto code.

Upgrading to 2.5.5 with ‘Gonzalo’ Code – No joy but may work for you.

Upgrading to gphoto 2.5.x seems to resolve the issue however this isn’t too easy. You need the source code, subversion and then to compile it under Raspbian. I found an interesting blog post which speaks about the procedure. But I ran into some trouble much too complicated.  Until I found the following https://github.com/gonzalo/gphoto2-updater


wget https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh
chmod +x gphoto2-updater.sh
sudo ./gphoto2-updater.sh

Unfortunately this failed for me.

Upgrading gphoto2 to 2.5.2 

Next up, I found another method to upgrade the gphoto2 code. However this script only updates it to 2.5.2. Which maybe enough for my project requirements.

http://www.ohmypi.com/2013/06/07/compiling-gphoto2-dependencies-how-to/

However the script takes between 30-40 minutes to complete. I actually created a SH script in vi with the following contents to automate the process. This worked wonderfully.


apt-get install -y libltdl-dev libusb-dev libexif-dev libpopt-dev
cd/
mkdir gphoto-working-directory
cd gphoto-working-directory/
wget http://ftp.de.debian.org/debian/pool/main/libu/libusbx/libusbx_1.0.11.orig.tar.bz2
tar xjvf libusbx_1.0.11.orig.tar.bz2
cd libusbx-1.0.11/
./configure
make
make install
cd ..
wget http://downloads.sourceforge.net/project/gphoto/libgphoto/2.5.2/libgphoto2-2.5.2.tar.bz2
tar xjf libgphoto2-2.5.2.tar.bz2
cd libgphoto2-2.5.2
./configure
make
make install
cd ..
wget http://downloads.sourceforge.net/project/gphoto/gphoto/2.5.2/gphoto2-2.5.2.tar.gz
tar xzvf gphoto2-2.5.2.tar.gz
cd gphoto2-2.5.2
./configure
make
make install
cd ..
ldconfig

Upgrading to 2.5.5


apt-get install -y libltdl-dev libusb-dev libexif-dev libpopt-dev
cd/
mkdir gphoto-working-directory
cd gphoto-working-directory/
wget http://ftp.de.debian.org/debian/pool/main/libu/libusbx/libusbx_1.0.11.orig.tar.bz2
tar xjvf libusbx_1.0.11.orig.tar.bz2
cd libusbx-1.0.11/
./configure
make
make install
cd ..
wget http://downloads.sourceforge.net/project/gphoto/libgphoto/2.5.5/libgphoto2-2.5.5.tar.bz2
tar xjf libgphoto2-2.5.5.tar.bz2
cd libgphoto2-2.5.5
./configure
make
make install
cd ..
wget http://downloads.sourceforge.net/project/gphoto/gphoto/2.5.5/gphoto2-2.5.5.tar.gz
tar xzvf gphoto2-2.5.5.tar.gz
cd gphoto2-2.5.5
./configure
make
make install
cd ..
ldconfig

This entry was posted in Photography, Raspberry Pi. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *