I have a python script to start my observatory, which is the following
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import os
import time
import sys
import pykush
import wiringpi
wiringpi.wiringPiSetup()
#set EQ5 pin 2 to OUT
wiringpi.pinMode(2, 1)
#set Atik314 pin 3 to OUT
wiringpi.pinMode(3, 1)
def rain_check():
print "Checking for rain"
io = wiringpi.GPIO(wiringpi.GPIO.WPI_MODE_PINS)
rain_check = io.digitalRead(6)
if rain_check is 0:
ykushon("YKC4434")
time.sleep(2)
ykushon("YKC4445")
time.sleep(2)
eq5()
time.sleep(1)
Atik314()
exit(0)
else:
print 'Raining'
exit(1)
def ykushon(serial_number):
yk = pykush.YKUSH(serial=serial_number)
yk.set_allports_state_up()
def eq5():
eq5 = wiringpi.GPIO(wiringpi.GPIO.WPI_MODE_PINS)
eq5.digitalWrite(2,0)
def Atik314():
atik314 = wiringpi.GPIO(wiringpi.GPIO.WPI_MODE_PINS)
atik314.digitalWrite(3,0)
rain_check()
I would like to add the ability to start the indiserver via the same script, I am aware of Pyindi-client but is there another python library I could use please?
Any pointers is appreciated.