×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Re:Controlling camera shutter with SkyWatcher SNAP port

  • Posts: 32
  • Thank you received: 13
I've been asked about how I'm using the GPIO pins to control the shutter.

A good tutorial on how to wire optoisolators can be found here. For astrophotography we don't usually need to control focus, but if you do, there are units available with two optoisolators built in. I'm actually using this board , but I don't recommend it. I was required to use power from the camera (by leaving the focus pin powered) in order for the transistors on the board to work. The method in the first link is easier and better.

You can then use the /sys/class/gpio interface to control the pins. For example, I'm using pin 23 for the shutter. The following code will control the pins and includes the needed exposeSensor and closeShutter functions needed in the script I posted earlier.

# Set GPIO path
GPIO_PATH="/sys/class/gpio"
 
# Define Pins
SHUTTER=23
FOCUS=24
 
# This is backwards because of the board I'm using.  
# You likely want to swap values here.
ON=0
OFF=1
 
 
# Function to export a pin if not already exported
exportPin() {
  if [[ ! -e $GPIO_PATH/gpio$1 ]]
  then
    gpio export "$1" out
  fi
}
 
# Function to change state of a pin
setState() {
  echo $2 > $GPIO_PATH/gpio$1/value
}
 
# Function to expose for for a given number of seconds.
exposeSensor() {
  setState $SHUTTER $ON
  sleep $1
  setState $SHUTTER $OFF
}
 
# Function to close the shutter.
closeShutter() {
  setState $SHUTTER $OFF
}
 
 
# Export pins and set initial state.
exportPin $SHUTTER
setState $SHUTTER $OFF
 
exportPin $FOCUS
setState $FOCUS $OFF

By the way, audio header cables used on old CDROM drives have the right pin spacing for the raspberry PI. :)
Last edit: 3 years 6 months ago by Kristopher. Reason: changed "off" to "powered" to make it a little more clear.
3 years 6 months ago #60681

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 13
My scripts make use of the bc command. The most recent Raspbian updates to Astroberry took this away.

It's simple enough to get back though.

sudo apt install bc


I'm not sure if I'm using other stuff that isn't installed by default. I'm glad I had internet access when I found out last night. :)
3 years 6 months ago #61446

Please Log in or Create an account to join the conversation.

  • Posts: 41
  • Thank you received: 4
Wow! This is a great solution!! Thanks a lot dude!
3 years 1 month ago #68381

Please Log in or Create an account to join the conversation.

  • Posts: 269
  • Thank you received: 53
To control GPIO pins you can also try the indi-asi-power driver.
Latest version uses GPIO 21 for DSLR shutter control but is not yet in the nightly builds. check out indilib.org/forum/ccds-dslrs/8982-issue-....html?start=12#68327
If you want to build from source note that I have moved it to branch asidslr2
it would be fairly simple to convert it to use different pins
The following user(s) said Thank You: Kristopher
3 years 1 month ago #68439

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0
Sorry for the Newbie question. I have a Fuji X-T3. I am also getting an ASIAIR pro which is based on a raspberry pi I think. Using the ASIAIR, would I still be able to control camera using the snap port on my EQ6R pro?


Sent from my iPhone using Tapatalk
3 years 1 week ago #70159

Please Log in or Create an account to join the conversation.

  • Posts: 238
  • Thank you received: 15
Hi Kristopher,

Regarding controlling camera shutter with SkyWatcher SNAP port, I have this modified wireless remote that uses on DSLR that without shutter release port.

www.pentaxforums.com/forums/62-do-yourse...entax-ir-camera.html

But when I connect this modified wireless remote to the SNAP port, it doesn't seem to open the shutter. I can confirm that it is working with another remote timer.

Is something missing from the script?

Hope you can take a look at this matter.

Regards,
Tom
2 years 9 months ago #73485

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 13
A previous Astroberry release included a slightly broken indi_setprop command. The workaround is to specify the INDI server host. To test if this is your issue, bypass the script and just use the following command line tools.  (note the -h 127.0.0.1 part)
indi_setprop -h 127.0.0.1 "EQMod Mount.SNAPPORT1.SNAPPORT1_ON=On"
indi_setprop -h 127.0.0.1 "EQMod Mount.SNAPPORT1.SNAPPORT1_OFF=On"

If that works, you can set a temporary alias in the script or just hardcode the host on all indi_setprop and indi_getprop commands.

Something like this at the top of any bash scripts that use these commands will work around the issue for now.
# Temporary aliases to work around localhost issue.
shopt -s expand_aliases
alias indi_getprop="indi_getprop -h 127.0.0.1"
alias indi_setprop="indi_setprop -h 127.0.0.1"
alias indi_eval="indi_eval -h 127.0.0.1"
The following user(s) said Thank You: Tom
Last edit: 2 years 9 months ago by Kristopher. Reason: This is fixed in the latest release. Hopefully this workaround won't be needed again.
2 years 9 months ago #73489

Please Log in or Create an account to join the conversation.

  • Posts: 238
  • Thank you received: 15
Will try it by tomorrow. But do these changes only apply to astroberry only? How about Stellarmate or another system?

Regards,
Tom
2 years 9 months ago #73490

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 13
My script was written on an Astroberry. I do not know what is included on Stellarmate. Sorry.
2 years 9 months ago #73491

Please Log in or Create an account to join the conversation.

  • Posts: 238
  • Thank you received: 15
Hi Kristopher,

The script still does not work with the modified wireless remote. But if the SNAP port cable directly plugs into the camera shutter release port, it works.

Thanks.
Tom
2 years 9 months ago #73512

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 13
If it works connected directly, then it's not my script... sounds like a compatibility issue with your IR shutter cable. I can't help... but I think it's cool you're messing with it. :)

Out of curiosity, What are you trying to solve using the IR remote if you can already control the shutter with a cable? If your answer is "fun thing to try" I'd totally understand.
The following user(s) said Thank You: Tom
2 years 9 months ago #73546

Please Log in or Create an account to join the conversation.

  • Posts: 238
  • Thank you received: 15
Hi Kristopher,

I got 2 modded DSLRs, one is having a shutter release port and another one is without. So, that modified wireless shutter remote is for it.

Is SNAP port design same as a normal Camera wired timer remote? But when I look at one of the skywatchers manuals, the TIP and RING are for trigger and the SLEEVE is for SNAP. For a normal wired shutter release cable, the TIP is shutter and the RING is the focus plus the SLEEVE is common.

Regards,
Tom
2 years 9 months ago #73550

Please Log in or Create an account to join the conversation.

Moderators: Radek Kaczorek
Time to create page: 1.033 seconds