I got this working and it really wasn't tricky at all - and no timing issues so far.
And I would also like to say thank you for this thread - without it, I probably would never have though of using the d-bus interface to get the exposure parameter - it just kinda came to me after thinking - damn there's gotta be a way to get this info if I can't pass a parameter.
As for the question of what parameters would be useful to scripts - sorry I'm way to new to this to have much input, (2 months of playing with Ekos/INDI and I only got my 1st long exposure/multi exposure session last night)

Setup:

  • IR Led (with 220 ohm resistor soldered to anode (+) pin) connected to Rpi GPIO ground and trigger pin (I used physical pins 12 for trigger and 13 for ground)
  • Borrowed a c++ program for IR trigger (github.com/outofjungle/NikonRemote/blob/master/NikonRemote.cpp) and modified it to use "wiringPi" instead of "arduino". Then added a cmd line argument so it will trigger the IR led immediately or at a specific number of seconds.  (sub-second triggering is always handled by INDI Nikon driver, so I'm not to worried about accuracy of this trigger mechanism)
  • Created a Python script that queries d-bus for exposure time and if successful - triggers the NikonRemote IR program immediately (via subprocess.run()) and then creates a spawned child process (via subprocess.Popen()) to create a NikonRemote process that will trigger the shutter again after X seconds.  (I don't know how acurrate the timing is, so I never exceed 29 minutes as the camera has a 30min maximum shutter duration and I don't want the IR to trigger if the camera has already closed the shutter.). The python script then immediately returns control to Ekos while the 2nd NikonRemote process continues to run as a background process.

How it all works for a session is pretty simple - only one extra step (bullet 3):
  • My camera is always in full manual mode with "bulb" as the shutter speed. (NOTE: INDI driver will not use bulb mode for shutter speeds below 30sec - as far as I can tell from scanning the code - and testing seems to confirm this). However - I suppose that could change in the future...
  • Setup my rig with Nikon DSLR INDI driver (via PTP) - normal polar align, align, focus - all this is done with the camera in normal "capturemode" setting of "continuous low speed" allowing full control via normal INDI driver.
  • Once I'm ready to start sequencing - go to "INDI Control Panel" and in the Nikon Tab - under the "capturesettings" tab, find "capturemode" and change the dropdown to "Quick Response Remote"
    • it seems that if you change it here instead of on the camera - the 15min Remote timeout does not seem to be a limitation
    • I'm also running my camera with AC power - so I'm not concerned about battery drain caused by IR sensor waiting to be triggered - which is something the manual mentions
  • In Ekos under the "Camera" tab in the "Script Manager" dialog box - enter "NikonRemote.py" as the Pre-Capture script.
  • Set your exposure to any value above 30 sec (I wouldn't trust it for anything less 31 sec - driver might try to trigger shutter as well) and below say 1740sec (29 min) and fire away normally
  • and that's it
Capture preview works.
Sessions work
The only problem I had was the IR Led shifted because I didn't fasten it to the camera securely enough and I lost 3 of the last 15 images of my session (unfortunately - Ekos is not able to determine that a new image hasn't been captured and just keeps downloading the last image on the SD card. I could set the INDI driver to "delete" instead of "save" for captured images - but I'll have to think about that...)
I'm actually running the NikonRemote IR trigger executable on my Rpi attached to the mount and the Python script on my computer in the house, where I run Kstars/Ekos. I run the NikonRemote executable via SSH and Private keys from within the python script.

Is this a great solution - not really.
Does it work - you bet.
I've ordered a USB relay and Nikon remote trigger cable and will be changing this over to a better solution once they arrive in a couple weeks.
If you want any of the scripts or code - let me know.
Oh, and this is all Linux & Rpi based - so if you're using windows or mac you might have to do some coding work.

Cheers

Read More...