I need to write a script that automates Kstar and Ekos to start, connect devices, start sequence and so on..
For now I’m at the beginning, and this is my code:
import os
import logging
import time
import shlex, subprocess
import sys
from dbus import glib
glib.init_threads()
import dbus
bus = dbus.SessionBus()
def open_ekos_window(bus):
kstars = bus.get_object("org.kde.kstars", "/KStars")
main_window = dbus.Interface(kstars, 'org.kde.KMainWindow')
main_window.activateAction('ekos')
ekos_object = bus.get_object("org.kde.kstars", # Connection name
"/KStars/Ekos" # Object's path
)
# Get Ekos interface
E_iface = dbus.Interface(ekos_object, 'org.kde.kstars.Ekos')
# Start Ekos
E_iface.start()
def main():
open_ekos_window(bus)
if __name__ == '__main__':
main()
I use the astroberry OS, where the INDI drivers are automatically started at the beginning.
So far so good, but now I would to get the status of the single devices the to perform some checks. And after load some scheduler to start some sequence.