×

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

Bi-monthly release with minor bug fixes and improvements

EKOS scripting

  • Posts: 107
  • Thank you received: 12

EKOS scripting was created by Bryan Ramsey

I am trying to automate my EKOS setup, and am running into a few hurdles. To make matters worse, I have a paramount, so TSX is in the mix. My current bash script calls a Linux command tsxfeeder and sets the mount to connected, and finds home (Paramounts have to find home before you can send any subsequent commands). Then it connects to the dome (again via TSX), and finds home to sync the dome encoder to 0 az, and then finally opens the dome. That is it. Later Ill log into the observatory via VNC, start Ekos and start the profile and begin using scheduler. I haven't really delved into scheduler, but for my purposes Ill add a single entry and start it.

The problem is Id like to begin using EKOS/Indi to control the dome also, taking as much as possible from TSX's control. I hate TSX :) :( mostly because it's required, huge and a bit temperamental. At least it's available for Linux or none of this would be possible for me.

So I figured out how to do indi_setprop, no problem other than some of the logic for On and Off, which is not just simple toggles. The problem I see now, is Id like to just issue a shell command from my phone to start everything. Right now with the TSX scripts it's easy, I use JuiceSSH on my android phone because I can save shortcuts that ssh into a server and run whatever. So if I wanted to keep the same workflow, I can't just use indi_setprop, because that won't start the EKOS profile. Is there a way to start EKOS and the profile from the command line? I can't seem to find any documentation that states how. Then I can put all my indi set_prop in the same script. I realize then this won't be using the startup script in scheduler. Maybe once I can script EKOS to start, and run the profile, then I can also put my indi_setprop stuff in a separate scheduler startup script.

Ideally it would, start TSX, EKOS/KSTARS/PHD, then start the profile. Then I could add the indi_setprop stuff there or like I said in the startup script. Actually I just saw the tooltip for the startup script, and it says "BEFORE STARTING EKOS". So the same question applies. How is this supposed to work with profiles? Confused ...

Admittedly I'm probably missing something fundamental in my logic here. Any thoughts would be great. Im skipping python because everything else I do at the observatory is already in bash, which I find intuitive. Python is a whole new thing I don't have time for. :)

Thanks for any advice.

Bryan
4 months 2 weeks ago #97604

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

Replied by Jasem Mutlaq on topic EKOS scripting

Hello Bryan,

Yes, this is available via KStars DBus scripting. Check out documentation: api.kde.org/kstars/html/index.html

To get started directly, have KStars opened and run <strong>qdbusviewer</strong>

You'll see all the methods supported on the right side



To script this in python, it's pretty straight forward. For example, to set time to now:

<code>
import dbus
bus = dbus.SessionBus()
proxy = bus.get_object("org.kde.kstars", "/KStars")
ekos = dbus.Interface(proxy, "org.kde.kstars")
ekos.setTimeToNow()
</code>

To get a property value, you can use something like this:
<code>
def get_ekos_property(name):
bus = dbus.SessionBus()
proxy = bus.get_object("org.kde.kstars", "/KStars/Ekos")
props = dbus.Interface(proxy, "org.freedesktop.DBus.Properties")
value = props.Get("org.kde.kstars.Ekos", name)
</code>
Last edit: 4 months 2 weeks ago by Jasem Mutlaq.
4 months 2 weeks ago #97611
Attachments:

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

Time to create page: 0.215 seconds