I discovered gphoto2 a couple of days ago and I've been digging into the documentation but I've not been able to solve my problem.

I would like to create a star trail with my Nikon D3400. The camera should take a sequence of shots in bulb mode (exposure time 2 minutes). Ideally, there should be as little off-time as possible between two different shots. I would also like to save the frames into the camera SD card.

The command I have assembled so far is:

gphoto2 -F 30 -I 1 --set-config bulb=1 --wait-event=120s --set-config capturetarget=1

Break down:

  • F 30 sets the number of frames to shoot.
  • -I 1 sets the interval to 1s.
  • --set-config bulb=1 activate bulb mode.
  • --wait-event=120s shoot for 2 minutes.
  • --set-config capturetarget=1 save the picture to the camera SD card.

Unfortunately, it only takes one shot, then it exits without giving any errors.

What am I doing wrong? Is it even possible to take multiple shots when using bulb mode? Are there any other approaches to achieve my goal with a PC connected to the camera?

  • May I ask why you don't want to use a dedicated intervalometer? Say, one that you could set up prior to (such for 2 minutes), and then trigger them from your computer. I'm curious, not stating that this is a better choice than what you're desiring to do. I certainly understand wanting to know the how and why for a particular task, not necessarily the 'easy'.
    – J.Hirsch
    Feb 12, 2020 at 20:58
  • 1
    No reason in particular, it's just that I have a raspberry that I currently don't use and I could turn it into a camera controller: this may be even better than an intervalometer as I could also write bash script to take multiple EV shots for HDR (D3400 is an entry level camera and doesn't provide that option). To connect to the raspberry I use VNC (from my phone, setting it to be an hotspot wi-fi). Then I select the proper script to launch: each script is using zenity that allows me to easily insert the values I need (such as shutter speed, iso, number of frames...).
    – Davide_sd
    Feb 12, 2020 at 21:12
  • 1
    Ahhh, I see. Excellent Reason there! I'm sure you've done lots of homework; may I suggest reading up on HDR and mechanisms ? And if you're willing to put in a little back-breaking labour, you can go back to doing stitching manually with PT-GUI and whatnot (doing HDR Panoramas the hardway). That'll give you solid foundations for how and what's done now.
    – J.Hirsch
    Feb 12, 2020 at 22:51

1 Answer 1


You can try to do the task by explicitly define loop and interval:

for i in $(seq 1 30)
gphoto2 --set-config bulb=1 --wait-event=120s --set-config capturetarget=1
sleep 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.