Tethering your camera to your computer

By laurence | 16/05/2016

Be sure to have things such as auto timers switched off. Your camera needs to be connected to your computer but NOT mounted.

sudo apt-get install f-spot

sudo apt-get install gphoto2

(f-spot allows you to view your image from the commandline with f-spot -v "$ARGUMENT")

Make sure gphoto2 detects your camera by

gphoto2 --auto-detect

if detected then

gphoto2 --set-config capture=on

gphoto2 --capture-image-and-download

Time lapse

gphoto2 --capture-image-and-download --interval=30 --frames=10

gphoto2 --capture-image-and-download -I 30 -F 10 --filename "foo%n.jpg"

gphoto2 --capture-image-and-download --filename "%Y%m%d%H%M%S.jpg" --interval=30 --frames=10 (to keep in chronological order)

If shooting in RAW simultaneously you will be continually asked if you want to overwrite the image. To get around this use the yes utility

eg

yes n | gphoto2 --capture-image-and-download --filename "%Y%m%d%H%M%S.jpg" --interval=30 --frames=10

Here's a breakdown:

--capture-image: tells gphoto to take an image.

--interval=30 : tells gphoto to keep taking images, once every 30 seconds.

--frames=10 : tells gphoto to stop taking photos after 10 have been captured (leave this off to continue forever).

 

To list your options

gphoto2 --list-config\r\n

for more info

gphoto2 --list-all-config

or for just a single options values try

gphoto2 --get-config name

now you can use these options. For example

gphoto2 --set-config imageformatexthd=0 --set-config flashmode=0 --capture-image-and-download --filename "%Y%m%d%H%M%S.jpg"