I'm having a brain freeze and would like to double check that my startup procedure is correct.
Odroid running 24h-24h used as the remote server to control the entire observatory, all accessories are plugged in to a switchable USB board (true on-off at power level).
my start up procedure in the following order:
turn on power relays to supply power to the mount and CCD's
turn on USB boards, this is a true power on - off (similar to someone plugging the usb cable in and out)
start indiserver and load all drivers
start VM Kstars localy then get Ekos to connect to remote server.
unpark scope, slew scope to target, take image, park scope.
stop indiserver on remote server
turn off USB boards
turn off power relays
I would also add a weather condition check, although maybe you dont need it if you are making the decision to open the roof/box. However if the Odroid is making the decision then you may need to add it.
Also you could add a check before starting indiserver to see if its already running.
I've pasted my current startup script below. Its basically a collection of steps that I was doing manually over ssh.
This is still a work in progress!!! So there may be bugs,,,, I've only used this twice so far due to bad weather.
Derek
#!/bin/bash
#
# Start indi services if not started, use weather station as test connection
#
CONNECTED=$((indi_eval -f '"Indi Cloud Rain Monitor.CONNECTION.CONNECT"==1')2>&1)
if [[ $CONNECTED == "connect: Connection refused" ]]
then
echo 'starting indi services'
nohup sh startIndiServer.sh &
sleep 10
CONNECTED=$((indi_eval -f '"Indi Cloud Rain Monitor.CONNECTION.CONNECT"==1')2>&1)
fi
#
# Verify weather situation and exit if in warning state
#
if [ $CONNECTED -eq 0]
then
echo 'Connecting weather station driver'
indi_setprop 'Indi Cloud Rain Monitor.CONNECTION.CONNECT=On'
sleep 10
fi
CLOUD_ALERT=$((indi_eval -f '"Indi Cloud Rain Monitor.WEATHER_STATUS.WEATHER_CLOUD_COVER"==3')2>&1)
WEATHER_STATION_ALERT=$((indi_eval -f '"Indi Cloud Rain Monitor.WEATHER_STATUS.WEATHER_STATION_ONLINE"==3')2>&1)
RAIN_ALERT=$((indi_eval -f '"Indi Cloud Rain Monitor.WEATHER_STATUS.WEATHER_RAIN"==3')2>&1)
echo '==== WEATHER CONDITIONS ==='
echo 'Weather device = '${WEATHER_STATION_ALERT}
echo 'Rain = '${RAIN_ALERT}
echo 'Cloud = '${CLOUD_ALERT}
if [ $CLOUD_ALERT -eq 1]
then
echo 'Weather cloud param in alert state, exiting'
exit 1
fi
if [ $RAIN_ALERT -eq 1]
then
echo 'Weather rain param in alert state, exiting'
exit 1
fi
if [ $WEATHER_STATION_ALERT -eq 1]
then
echo 'Weather station is offline or malfunctioning, exiting'
exit 1
fi
#
# Weather status must be ok if we get here. Proceed to power on all equipement
#
echo 'Powering on equipment'
./python/firmataSwitcher.py /dev/arduino_AL01C9VU 2
#
# Connect to the roof and open.
#
echo 'Opening Roof'
CONNECTED=$((indi_eval -f '"Aldi roof.CONNECTION.CONNECT"==1')2>&1)
echo $CONNECTED
if [ $CONNECTED -eq 0]
then
echo 'Connecting roof driver'
indi_setprop 'Aldi roof.CONNECTION.CONNECT=On'
sleep 10
fi
indi_setprop 'Aldi roof.DOME_MOTION.DOME_CCW=Off'
indi_setprop 'Aldi roof.DOME_MOTION.DOME_CW=On'
#
# Wake the telescope from hibernation
#
echo 'waking telescope'
./nexstarPoweronAndWake.sh