2

I want to connect a Nikon camera to a Raspberry Pi with entangle installed.

From a remote computer, via wifi and ssh I have access to the RPi.

How can I simply take a photo (and optionally download it to the RPi) from command line?

I only see graphic interface to manage the camera.

dstonek
  • 199
  • 2
  • 8
  • 1
    Exactly which Nikon camera you intend to use may also be very applicable to your problem. The Nikon D3x000 and D5x00 series don't do many types of tethering particularly well. – Michael C Mar 23 '18 at 12:28
  • I first tried my D600 with USB cable connected to Ubuntu and it worked okay. I also tried an old Coolpix 8800 but it was not detected – dstonek Mar 23 '18 at 15:33
  • But D600 is not detected by RPi (its SD card) – dstonek Mar 23 '18 at 15:49
  • 1
    I'm not sure what the appropriate Stack Exchange site would be for working that out (SuperUser?), but the output of lsusb, gphoto2 --auto-detect, ptpcam --list-devices would be useful to figure it out. – Peter Taylor Mar 23 '18 at 18:28
  • @PeterTaylor That's right. Both cards are listed in Nautilus (file browser in Ubuntu) but executing gphoto2 -> Error 'Could not claim the USB device'. This is a question, how you say, for SuperUser. BTW, gphoto2 autodetect does detect Nikon DSC D600. – dstonek Mar 23 '18 at 19:22
  • Both cards? Sounds like you have some other software running which uses fuse to implement a filesystem over PTP. Identify and disable/reconfigure that and you'll probably find that gphoto2 works. – Peter Taylor Mar 23 '18 at 20:19
  • D600 has two SD slots. I use one for RAW and the other for JPEG backup. Both are listed. I've read that gphoto2 cannot claim USB device because kernel is doing so. Seems it's not that simple to kernel unclaim – dstonek Mar 23 '18 at 21:42
  • I also have to point out that graphic interface of Entangle works okay in Ubuntu, I am able to take and view photos I take from the program. Seems like Entangle sorts out the claim issue. – dstonek Mar 23 '18 at 22:16
  • I realized how to fix that: unmount SD cards. gphoto2 --capture-image -> New file is in location /capt0000.jpg on the camera
    New file is in location /capt0000.nef on the camera
    No photos 'on the camera' not even hidden
    – dstonek Mar 23 '18 at 22:44

2 Answers2

3

Reading Entangle's man page, it doesn't appear there are any command line options to control the camera and/or capture images.

Note that the bottom of Entangle's man page suggests to see also gphoto2, which is a fairly full-featured command line interface to interact with and control the camera. gphoto2's man page gives the following example usage:

gphoto2 --capture-image --interval 60 --hook-script /usr/share/doc/gphoto2/test-hook.sh

    Capture one image every 60 seconds from now to eternity. The
    example hook script will be called after each captured image has
    been stored on the computer.
scottbb
  • 32,685
  • 12
  • 104
  • 188
  • 1
    In further evidence, the home page of the website says "It is built on top of libgphoto using GTK-3 for its interface". – Peter Taylor Mar 23 '18 at 08:25
  • Despite I cannot check gphoto2 with my D600 (it is not detected by RPi) I marked the answer as a solution because it is the way to follow. – dstonek Mar 23 '18 at 16:01
2

Most graphical tethering programs for Linux are GUI wrappers around libgphoto2. The standard command-line interface for libgphoto2 is gphoto2.

The main competitor which I know of is libptp / ptpcam. I have a fork which compiles on my Raspberry Pi and adds an exposure bracketing feature at https://github.com/pjt33/ptpcam-fork

Peter Taylor
  • 1,497
  • 10
  • 16