Bi-monthly release with minor bug fixes and improvements
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# You must initialize the gobject/dbus support for threading
# before doing anything.
import gobject
import os
import time
gobject.threads_init()
from dbus import glib
glib.init_threads()
# Create a session bus.
import dbus
bus = dbus.SessionBus()
# Create an object that will proxy for a particular remote object.
start_ekos = bus.get_object("org.kde.kstars", # Connection name
"/kstars/MainWindow_1/actions/ekos" # Object's path
)
# Get Ekos interface
iface = dbus.Interface(start_ekos, 'org.qtproject.Qt.QAction')
# Start Ekos devices
iface.trigger()
print "Starting Ekos..."
#now start indi progile
# Create an object that will proxy for a particular remote object.
remote_object = bus.get_object("org.kde.kstars", # Connection name
"/KStars/INDI" # Object's path
)
# Introspection returns an XML document containing information
# about the methods supported by an interface.
print ("Introspection data:\n")
print remote_object.Introspect()
# Get INDI interface
iface = dbus.Interface(remote_object, 'org.kde.kstars.INDI')
myDevices = [ "indi_simulator_telescope", "indi_simulator_ccd" ]
# Start INDI devices
iface.stop("7624")
iface.start("7624", myDevices)
print "Waiting for INDI devices..."
# Create array for received devices
devices = []
while True:
devices = iface.getDevices()
if (len(devices) < len(myDevices)):
time.sleep(1)
else:
break;
print "We received the following devices:"
for device in devices:
print device
print "Establishing connection to Telescope and CCD..."
# Set connect switch to ON to connect the devices
iface.setSwitch("Telescope Simulator", "CONNECTION", "CONNECT", "On")
# Send the switch to INDI server so that it gets processed by the driver
iface.sendProperty("Telescope Simulator", "CONNECTION")
# Same thing for CCD Simulator
iface.setSwitch("CCD Simulator", "CONNECTION", "CONNECT", "On")
iface.sendProperty("CCD Simulator", "CONNECTION")
telescopeState = "Busy"
ccdState = "Busy"
# Wait until devices are connected
while True:
telescopeState = iface.getPropertyState("Telescope Simulator", "CONNECTION")
ccdState = iface.getPropertyState("CCD Simulator", "CONNECTION")
if (telescopeState != "Ok" or ccdState != "Ok"):
time.sleep(1)
else:
break
print "Connected to Telescope and CCD is established."
# Create an object that will proxy for a particular remote object.
start_scheduler = bus.get_object("org.kde.kstars.Ekos.Scheduler", # Connection name
"/KStars/Ekos/Scheduler" # Object's path
)
# StartEkos Scheduler interface
iface = dbus.Interface(start_scheduler, "org.kde.kstars.Ekos.Scheduler")
# Start Ekos devices
iface.loadScheduler(test.esl )
#iface.start()
print "Starting Scheduler..."
Please Log in or Create an account to join the conversation.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# You must initialize the gobject/dbus support for threading
# before doing anything.
import gobject
import os
import time
gobject.threads_init()
from dbus import glib
glib.init_threads()
# Create a session bus.
import dbus
bus = dbus.SessionBus()
remote_object = bus.get_object("org.kde.kstars", "/KStars/Ekos/Scheduler")
iface = dbus.Interface(remote_object, 'org.kde.kstars.Ekos.Scheduler')
iface.loadScheduler("/home/jasem/Pictures/SchedularTest/capella.esl")
Please Log in or Create an account to join the conversation.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# You must initialize the gobject/dbus support for threading
# before doing anything.
import argparse
import gobject
import os
import time
parser = argparse.ArgumentParser (description='auto start Ekos sequence')
parser.add_argument('-s','--scheduler',type=str, help='scheduler file name located in /home/pi/filename, enter full path')
parser.add_argument('-p','--profile', default="Simulators", help='enter equippement profile name')
args = parser.parse_args()
gobject.threads_init()
from dbus import glib
glib.init_threads()
# Create a session bus.
import dbus
bus = dbus.SessionBus()
INDI = bus.get_object("org.kde.kstars", # Connection name
"/KStars/INDI" # Object's path
)
# Get INDI interface
iface = dbus.Interface(INDI, 'org.kde.kstars.INDI')
# Stop INDI devices (because that was giving me bug after in ekos)
iface.stop("7624")
# Create an object that will proxy for a particular remote object.
start_ekos = bus.get_object("org.kde.kstars", # Connection name
"/kstars/MainWindow_1/actions/ekos" # Object's path
)
# Get Ekos interface
iface = dbus.Interface(start_ekos, 'org.qtproject.Qt.QAction')
# Start Ekos devices
iface.trigger()
print ("Starting Ekos...")
#now start ekos progile
# Create an object that will proxy for a particular remote object.
Ekos = bus.get_object("org.kde.kstars", # Connection name
"/KStars/Ekos" # Object's path
)
# Get ekos interface
iface = dbus.Interface(Ekos, 'org.kde.kstars.Ekos')
#myDevices = [ "indi_simulator_telescope", "indi_simulator_ccd" ]
# Start INDI devices
iface.stop()
iface.disconnectDevices()
iface.setProfile(args.profile)
iface.start()
iface.connectDevices()
print "Waiting for INDI devices..."
run_scheduler = bus.get_object("org.kde.kstars", # Connection name
"/KStars/Ekos/Scheduler" # Object's path
)
# StartEkos Scheduler interface
iface = dbus.Interface(run_scheduler, "org.kde.kstars.Ekos.Scheduler")
# Start Ekos devices
iface.loadScheduler(args.scheduler)
iface.start()
print "Starting Scheduler..."
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
./ekos_cli.py --help
usage: ekos_cli.py [-h] [--start_ekos] [--stop_ekos] [--profile PROFILE]
[--load_schedule LOAD_SCHEDULE] [--start_scheduler]
[--stop_scheduler] [--reset_scheduler]
Ekos cli
optional arguments:
-h, --help show this help message and exit
--start_ekos start ekos
--stop_ekos stop ekos
--profile PROFILE equipment profile name, fi Simulators
--load_schedule LOAD_SCHEDULE
schedule .esl file path. Note: this replaces the
entire observation list with this single entry.
--start_scheduler start the scheduler
--stop_scheduler stop the scheduler
--reset_scheduler reset all jobs in the scheduler
Please Log in or Create an account to join the conversation.