×

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

Bi-monthly release with minor bug fixes and improvements

Ekos Scheduler

Ekos Scheduler was created by Jasem Mutlaq

Overview of Ekos Scheduler and additional changes in KStars 2.4.0

8 years 7 months ago #4953

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

  • Posts: 58
  • Thank you received: 6

Replied by Pasi Sarkkinen on topic Ekos Scheduler

Very nice, good job B)
8 years 7 months ago #4954

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

  • Posts: 94
  • Thank you received: 38

Replied by max on topic Ekos Scheduler

WOW,Great !
8 years 7 months ago #4955

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

  • Posts: 314
  • Thank you received: 34

Replied by pauledd on topic Ekos Scheduler

Nice going! :)
--= human, without Windows™ =--
pls excuse my bad english! :)
8 years 7 months ago #4956

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

  • Posts: 2255
  • Thank you received: 223

Replied by Gonzothegreat on topic Ekos Scheduler

AMAZING !!!!!

This is now really becoming The best Astro software for Linux, full stop.
The scheduler looks pretty cool, I DO LIKE the fact that your can control the dome (via a script), in my case it's a "box" with automated roof opening.

AWESOME update!!!!!
8 years 7 months ago #4969

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

  • Posts: 45
  • Thank you received: 6

Replied by gus on topic Ekos Scheduler

wow! love it!

I don't want to look dumb, but... how do I get it for my ubuntu mate on rpi2? after upgrading, kstars-bleeding is 2.3.0.....

great work, thank you very much :cheer:
Last edit: 8 years 7 months ago by gus.
8 years 7 months ago #4973

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

  • Posts: 2255
  • Thank you received: 223

Replied by Gonzothegreat on topic Ekos Scheduler

In the startup procedure, the script runs first correct? End in the shutdown procedure, the script runs last?
What is Ekos looking for to be able to move on to the Unpark mount command after running the script in the startup procedure?

I have a script to open up the roof of the observatory, it would be ab absolute disaster for me to run the startup procedure in Ekos and have the mount unpark with the roof closed.... Just the thought of the all thing being crushed.... ouch.
Could you please explain in details how the startup and shutdown procedure works?
Script examples etc...

thanks, I hope you understand that I need to be 100% sure of the all procedure.
8 years 7 months ago #4975

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

Replied by Jasem Mutlaq on topic Ekos Scheduler

Ah thanks for the suggestion!! Unpark dome indeed needs to be done before unpark mount, I'll do that immediately. The startup scripts is for _anything_ else that isn't unpark dome and unpark mount and needs to be done _before_ those actions are taken.

Btw, I'm interested to see if we can make an INDI Dome driver for your roll-off (I am building one very soon). How do you exactly control the roof?

The startup and shutdown procedures are simple. Let's say you schedule 5 objects, as soon as one of the object is due for observation, the startup script (if one is specified) is executed. In your case, all you're doing in unpark dome + unpark mount then you don't need a startup script. In my case, I would the startup script to turn on power to the equipment as I don't want them running all the time, just when I need them to.

So once the startup script executes successfully, unpark dome and then unpark mount are called. Then the scheduler does it thing. Once all jobs are complete (or if weather is bad), the shutdown procedure is called. It will warm CCD (if supported and checked), park mount and park dome (again if checked and supported). THEN, the shutdown procedure is called. In my case, I would use that to remotely turn off the power.

I hope that clears it up.
8 years 7 months ago #4978

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

Replied by Jasem Mutlaq on topic Ekos Scheduler


The armhf build for 15.04 has been failing for a while (missing packages). So sorry there is nothing I can do about that. It's working fine on 15.10, so you might have to wait until next Ubuntu release on armhf.
The following user(s) said Thank You: gus
8 years 7 months ago #4979

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

  • Posts: 2255
  • Thank you received: 223

Replied by Gonzothegreat on topic Ekos Scheduler


Yes it makes sense to unpark the roof before the mount, thanks for changing the order.

The box is a cube, the lid opens up via two linear actuators.




please be patient, the video is 2m46s long, there is a delay after the lid opens up and the telescope deploys.
(the thumbnail picture was taken with my GF1 and an old 50m Minolta lens, single shot, 8sec)

The controller box is an Odroid C1 with an 8 relays board, off the GPIO.
I have two scripts I can use to open the lid. A manual and an automatic one.

manual:
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#

automatic ones:
#Opening
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#

#Closing
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#

I also have two quick scripts to turn on the power for the Atik and the EQ5 (they could be combined into one script really):
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#


I guess the automated ones will be replaced by the Ekos scheduler at some point.

I also hate leaving stuff on with the power, hence the scripts above.

It does clear things up, however about the "once the startup script executes successfully, unpark dome and then unpark mount are called.", what if the script fails for whatever reason, does the Ekos scheduler know about that?



thanks for the great work you're doing again.
Last edit: 8 years 7 months ago by Gonzothegreat.
8 years 7 months ago #4981

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

Replied by Jasem Mutlaq on topic Ekos Scheduler

Wow!! That's a lot of bash scripting!

regarding the startup script failure; Yes, if the script returns anything but 0 then it failed and it would report an error and stop there. Now, let's try to move some of that script into INDI. Let's start with the "box". Can you write a C++ program to control it as instructed here ? It seems that you're turning rely on, wait for 20 seconds, then turn it off?
8 years 7 months ago #4982

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

  • Posts: 2255
  • Thank you received: 223

Replied by Gonzothegreat on topic Ekos Scheduler

I'm OK with bash, python and C++ are languages from a different planet... lol.
I'll give it a go I guess.

As for the 20 second delays, I wrote the script when I was in testing phase, without consideration for the micro-switches.
That delay will go.
8 years 7 months ago #4983

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

Time to create page: 1.578 seconds