S S

Linux support on-site, on-line and in the cloud.

0793 572 8612

Systems Administration Notes.

Getting the shutter count on Canon EOS digital camera.


Getting the shutter count on Canon EOS digital camera.

Been puzzled for a week or so that I couldn’t find the shutter count on on my new Canon EOS D5 Mk III. Having gone through all the options I could find and having studied the manual index pages I was pretty sure it wasn’t there.

Research on t’internet found several assertions that the count is recorded in every photographs exif data, but it ain’t. I checked myself and then used an online site to upload a pic for analysis, "No shutter info found in ....." was returned.

More Google searches revealed a couple of products, windows only, that would return the shutter count. Well deeply suspicious of that. The thought of running compiled, obscure, proprietary software against 1.5Ks worth of kit made me very nervous indeed.

Then joy and bliss someone mentioned using gphoto2 to get this information. No details were given other than how to install which I had anyway, already, but now I was searching on the right lines ie. "shutter count Canon gphoto2".

So here is the real gen.

To use gphoto2 without specifying the device you need anything else that might look like a camera to be removed first. My camera was connected with a USB cable and this interaction confused me at first.

bash-4.2$ gphoto2 --list-config


*** Error ***
This camera does not provide any configuration options.
*** Error (-6: ’Unsupported operation’) ***

Using --auto-detect explains.

bash-4.2$ gphoto2 --auto-detect
Model                          Port
----------------------------------------------------------
Mass Storage Camera            disk:/run/media/fulford/DP-32SD

Not a camera at all but a SDHC card that was plugged into the PC. The camera wasn’t showing up because although switched on it needs to be active for gphoto2 to detect it. This means you need either to have just turned on the camera or to have half pressed the shutter immediately before running the command. Now we see a more encouraging result.

bash-4.2$ gphoto2 --auto-detect
Model                          Port
----------------------------------------------------------
Mass Storage Camera            disk:/run/media/fulford/DP-32SD
Canon EOS 5D Mark III          usb:008,012

Now I don’t want to have to specify which camera so the easiest way forward is to unmount that SDHC card and remove it.

Now I can list the configuration directories with --list-config , remembering of course to first activate the camera again.

# activate camera
bash-4.2$ sudo gphoto2 --list-config|grep shutter
/main/status/shuttercounter
bash-4.2$

There are an awful lot of configuration options so that note that grep to find the one we want. Note also that at this stage we need super user privileges.

Now finally

bash-4.2$ sudo gphoto2 --get-config /main/status/shuttercounter
Label: Shutter Counter
Type: TEXT
Current: 127

Which matches exactly with my count of photographs to date and reassures me that my EOS 5D Mk III, despite it’s massive discount, came with 0 shutter releases. What a happy bunny I am.

Clifford W Fulford
29 February 2016.



The layout and associated style sheets for this page are taken from the World Wide Web Consortium and used here under the W3C software licence.