Bi-monthly release with minor bug fixes and improvements
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
root@heidenrod-obs:/usr/local/bin# more obsroof
#!/bin/bash
X=`cat /dev/shm/rain_sensor`
#set pin 0 and 2 to OUT
gpio mode 0 out
gpio mode 2 out
open() {
if [ "$X" == "dry" ];then
gpio write 0 1
gpio write 2 0
sleep 20
gpio write 0 1
gpio write 2 1
else
echo "It's raining, cannot open roof"
fi
}
close() {
gpio write 0 0
gpio write 2 1
sleep 20
gpio write 0 1
gpio write 2 1
}
$1 $2
root@heidenrod-obs:/usr/local/bin#
root@heidenrod-obs:/usr/local/bin# more openobs
#!/bin/bash
#check if it's running first
if lsof -Pi :7624 -sTCP:LISTEN -t >/dev/null ;then
############################
# Open the roof #
############################
echo "roof opening"
#set pin 0 and 2 to OUT
gpio mode 0 out
gpio mode 2 out
#open the roof
gpio write 0 1
gpio write 2 0
#close relays
sleep 30
echo "roof open"
gpio write 0 1
gpio write 2 1
echo "connecting to HEQ5"
#Establlish connection to HEQ5
until
indi_getprop -h localhost | egrep "EQMod Mount.CONNECTION.CONNECT=On|EQMod Mount.CONNECTION.DISCONNECT=Off"
do
indi_setprop -h localhost 'EQMod Mount.DEVICE_PORT.PORT=/dev/EQDIR'
indi_setprop -h localhost 'EQMod Mount.CONNECTION.CONNECT=On'
done
#Current connection state
CON=`indi_getprop -h localhost | grep Mount.CONNECTION.CONNECT | awk -F= '{print $2}'`
DISC=`indi_getprop -h localhost | grep Mount.CONNECTION.DISCONNECT | awk -F= '{print $2}'`
if [ $CON == "On" -a $DISC == "Off" ]
then
############################
# Check if scope is parked #
############################
RA=`cat ~/.indi/ParkData.xml | grep -A1 axis1position | sed '/^[ \t]\+/d' | cut -d. -f1`
DEC=`cat ~/.indi/ParkData.xml | grep -A1 axis2position | sed '/^[ \t]\+/d' | cut -d. -f1`
#Create range
minRA=`echo $RA - 25 | bc`
maxRA=`echo $RA + 25 | bc`
minDEC=`echo $DEC - 25 | bc`
maxDEC=`echo $DEC + 25 | bc`
#Current RA / DEC values
CRA=`indi_getprop -h localhost | grep CURRENTSTEPPERS.RAStepsCurrent | awk -F= '{print $2}'`
CDEC=`indi_getprop -h localhost | grep CURRENTSTEPPERS.DEStepsCurrent | awk -F= '{print $2}'`
if (($minRA<=$CRA && $CRA<=$maxRA)) && (($minDEC<=$CDEC && $CDEC<=$maxDEC))
then
echo "Unpark the scope"
indi_setprop -h localhost 'EQMod Mount'.TELESCOPE_PARK.UNPARK=On
echo "Deploy the scope to home position"
indi_setprop -h localhost 'EQMod Mount.EQUATORIAL_EOD_COORD.RA;DEC=02:50:35.39;89:20:03.22'
fi
else
echo "Not deployed"
fi
else
echo "Indiserver is NOT running"
fi
root@heidenrod-obs:/usr/local/bin#
root@heidenrod-obs:/usr/local/bin# more closeobs
#!/bin/bash
#check if it's running first
if lsof -Pi :7624 -sTCP:LISTEN -t >/dev/null ;then
#Establlish connection to HEQ5
until
indi_getprop -h localhost | egrep "EQMod Mount.CONNECTION.CONNECT=On|EQMod Mount.CONNECTION.DISCONNECT=Off"
do
indi_setprop -h localhost 'EQMod Mount.DEVICE_PORT.PORT=/dev/EQDIR'
indi_setprop -h localhost 'EQMod Mount.CONNECTION.CONNECT=On'
done
#Current connection state
CON=`indi_getprop -h localhost | grep Mount.CONNECTION.CONNECT | awk -F= '{print $2}'`
DISC=`indi_getprop -h localhost | grep Mount.CONNECTION.DISCONNECT | awk -F= '{print $2}'`
if [ $CON == "On" -a $DISC == "Off" ]
then
###################
#Parking the scope#
###################
indi_setprop -h localhost 'EQMod Mount'.TELESCOPE_PARK.PARK=On
echo "Scope parking"
#sleep 60
#Park set values
RA=`cat ~/.indi/ParkData.xml | grep -A1 axis1position | sed '/^[ \t]\+/d' | cut -d. -f1`
DEC=`cat ~/.indi/ParkData.xml | grep -A1 axis2position | sed '/^[ \t]\+/d' | cut -d. -f1`
#Create range
minRA=`echo $RA - 25 | bc`
maxRA=`echo $RA + 25 | bc`
minDEC=`echo $DEC - 25 | bc`
maxDEC=`echo $DEC + 25 | bc`
#Get current RA / DEC values
until
CRA=`indi_getprop -h localhost | grep CURRENTSTEPPERS.RAStepsCurrent | awk -F= '{print $2}'`
CDEC=`indi_getprop -h localhost | grep CURRENTSTEPPERS.DEStepsCurrent | awk -F= '{print $2}'`
(($minRA<=$CRA && $CRA<=$maxRA)) && (($minDEC<=$CDEC && $CDEC<=$maxDEC))
do
wait
done
if (($minRA<=$CRA && $CRA<=$maxRA)) && (($minDEC<=$CDEC && $CDEC<=$maxDEC))
then
echo "PARKED"
echo PARKED > ~/.indi/.park
############################
# Close the roof #
############################
echo "closing the roof"
#set pin 0 and 2 to OUT
gpio mode 0 out
gpio mode 2 out
#close the roof
gpio write 0 0
gpio write 2 1
#close relays
sleep 30
echo "roof closed"
gpio write 0 1
gpio write 2 1
else
echo "NOT PARKED"
echo NOT_PARKED > ~/.indi/.park
fi
fi
else
echo "Indiserver is NOT running"
fi
root@heidenrod-obs:/usr/local/bin#
root@heidenrod-obs:/usr/local/bin# more Atik314
#!/bin/bash
#set pin 14 to OUT
gpio mode 14 out
off() {
#set relays Atik314 to OFF
gpio write 14 1
echo "off" > ~/.Atik314_relays_status
}
on() {
#set relays Atik314 to ON
gpio write 14 0
echo "on" > ~/.Atik314_relays_status
}
status() {
#read relays status
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
value=$( grep -ic "on" ~/.Atik314_relays_status )
if [ $value -eq 1 ]
then
printf "Atik314 CCD is: ${GREEN}ON${NC} \n"
else
printf "Atik314 CCD is: ${RED}OFF${NC} \n"
fi
}
$1 $2 $3
root@heidenrod-obs:/usr/local/bin# more EQ5
#!/bin/bash
#set pin 13 to OUT
gpio mode 13 out
off() {
#set relays EQ5 to OFF
gpio write 13 1
echo "off" > ~/.EQ5_relays_status
}
on() {
#set relays EQ5 to ON
gpio write 13 0
echo "on" > ~/.EQ5_relays_status
}
status() {
#read relays status
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
value=$( grep -ic "on" ~/.EQ5_relays_status )
if [ $value -eq 1 ]
then
printf "EQ5 Mount is: ${GREEN}ON${NC} \n"
else
printf "EQ5 monut is: ${RED}OFF${NC} \n"
fi
}
$1 $2 $3
root@heidenrod-obs:/usr/local/bin#
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.