Sample scripts for INDI Telescope Scripting Gateway

This is python scripts used to test INDI Telescope Scripting Gateway. The default folder for them is /usr/share/indi/scripts (or /usr/local/share/indi/scripts on OSX). You can use any other folder, any other script names and any other script language, just make sure, that all of them have "executable" bit set.

All scripts except for status.py are called only when related driver property is set. status.py is called periodically and is supposed to create file with name submitted as parameter containing single line with 3 number: 0/1 for unparked/parked, ra and dec as floats.

---------- connect.py --------------
I
#!/usr/bin/python
#
# Connect script for INDI Telescope Scripting Gateway
#
# Arguments: none
# Exit code: 0 for success, 1 for failure
#

import sys

coordinates = open('/tmp/indi-status', 'w')
coordinates.truncate()
coordinates.write('1 0 90')
coordinates.close()

sys.exit(0)


---------- disconnect.py --------------

#!/usr/bin/python
#
# Connect script for INDI Telescope Scripting Gateway
#
# Arguments: none
# Exit code: 0 for success, 1 for failure
#

import sys

sys.exit(0)

---------- park.py --------------

#!/usr/bin/python
#
# Park script for INDI Telescope Scripting Gateway
#
# Arguments: none
# Exit code: 0 for success, 1 for failure
#

import sys

coordinates = open('/tmp/indi-status', 'w')
coordinates.truncate()
coordinates.write('1 0 90')
coordinates.close()

sys.exit(0)

---------- unpark.py --------------

#!/usr/bin/python
#
# Park script for INDI Telescope Scripting Gateway
#
# Arguments: none
# Exit code: 0 for success, 1 for failure
#

import sys

coordinates = open('/tmp/indi-status', 'w')
coordinates.truncate()
coordinates.write('0 0 90')
coordinates.close()

sys.exit(0)

---------- sync.py --------------

#!/usr/bin/python
#
# Sync script for INDI Telescope Scripting Gateway
#
# Arguments: RA Dec
# Exit code: 0 for success, 1 for failure
#

import sys

script, ra, dec = sys.argv

coordinates = open('/tmp/indi-status', 'w')
coordinates.truncate()
coordinates.write('0 ' + ra + ' ' + dec)
coordinates.close()

sys.exit(0)

---------- goto.py --------------

#!/usr/bin/python
#
# Goto script for INDI Telescope Scripting Gateway
#
# Arguments: RA Dec
# Exit code: 0 for success, 1 for failure
#

import sys

script, ra, dec = sys.argv

coordinates = open('/tmp/indi-status', 'w')
coordinates.truncate()
coordinates.write('0 ' + ra + ' ' + dec)
coordinates.close()

sys.exit(0)

---------- move_north.py --------------

#!/usr/bin/python
#
# Move north script for INDI Telescope Scripting Gateway
#
# Arguments: slew rate (0-3)
# Exit code: 0 for success, 1 for failure
#

import sys

sys.exit(0)

---------- move_east.py --------------

#!/usr/bin/python
#
# Move east script for INDI Telescope Scripting Gateway
#
# Arguments: slew rate (0-3)
# Exit code: 0 for success, 1 for failure
#

import sys

sys.exit(0)

---------- move_south.py --------------

#!/usr/bin/python
#
# Move south script for INDI Telescope Scripting Gateway
#
# Arguments: slew rate (0-3)
# Exit code: 0 for success, 1 for failure
#

import sys

sys.exit(0)

---------- move_west.py --------------

#!/usr/bin/python
#
# Move west script for INDI Telescope Scripting Gateway
#
# Arguments: slew rate (0-3)
# Exit code: 0 for success, 1 for failure
#

import sys

sys.exit(0)

---------- abort.py --------------

#!/usr/bin/python
#
# Abort script for INDI Telescope Scripting Gateway
#
# Arguments: none
# Exit code: 0 for success, 1 for failure
#

import sys

sys.exit(0)

---------- status.py --------------

#!/usr/bin/python
#
# Status script for INDI Telescope Scripting Gateway
#
# Arguments: file name to save current state and coordinates (parked ra dec)
# Exit code: 0 for success, 1 for failure
#

import sys

script, path = sys.argv

coordinates = open('/tmp/indi-status', 'r')
status = open(path, 'w')
status.truncate()
status.write(coordinates.readline())
status.close()

sys.exit(0)



