Thibault thanked Rob Lancaster in topic Xplanet 2 months ago
Thibault replied to the topic 'fully automated telescope control' in the forum. 2 months ago

Awesome !

Thank you very much Jasem for your commitment ! being able to use Ekos directly from scripts is my dream feature, (I started doing nice things with python bindings of Indi, but I really had to get my hands dirty to understand that I would never be able to build a software as powerful and an robust as Ekos on my own, even if I only need a subset of its features).

I will now switch to the dev version of KStars in order to be able to test the latest features to come


Thibault replied to the topic 'fully automated telescope control' in the forum. 2 months ago

Yes, as I am currently exploring this topic, I can definitely try to write at least a small summary of the features accessible through DBus scripting.
Do you know where I should put that ? / in which format I should edit it ?

For now I see a few topics that can be interesting:

Indi DBus scripting
For now, I think the previous code allows to use basic INDI features through INDI DBus interface quite easily.

Scripting KStars, as a planetarium engine,through DBus
I did not tried to use this feature, as I try to rely on astropy to get ephemeride related data. but it could be interesting to show how to setup an observer position, time, and export a view in a script.
I did not saw where was the documentation for this, but it looks like Introspection already gives what's needed for a short example.

Using Ekos features through DBus
That is my main point of interest, and the module documentation here helps a lot:
However, there are still things that I need to understand.

Question 1: Related to this page:
I don't understand how to get this object through the bus, for me, the following code:

from pydbus import SessionBus
bus = SessionBus()
ekosmanager = bus.get("org.kde.kstars","/KStars/EkosManager")
Result in the following error:

GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/KStars/EkosManager

Apparently EkosManager does not exist ? However Ekos exist and doesn't looks like it is documented. ?

Question 2:
I managed to somehow start indi client, whithout needing to connect every Devices using INDIDBus interface thanks to something like this:
ekos = bus.get("org.kde.kstars","/KStars/Ekos")

However, I guess it worked only because there was a default profile already loaded somwhere (and I was able to set a specific existing profile thanks to ). But I don't know how to programaticaly create such profile.

Question 3:
I am working on setting up a fully automated focusing routine. I was surprised how easy it was to get something close to that (I'll share the code when it will work), with a few lines of DBus that starts with:
autofocuser = bus.get("org.kde.kstars","/KStars/Ekos/Focus")

However, there are manyy subteleties that I was not able to implement:
-Whenever I launched ekos.start(), how can I synchronize to the end of the startup, when the object is ready to handle submodule (focus, alignment, etc...)
-After setting up some parameters, and launching with autofocuser.start(), I would also like to be able to put a callback on every iterations to monitor HFR, and logs in my own app, and especially, be able to synchronize with the end of the process, how should I do ?
-It looks like many parameters from the GUI are not accessible through DBus (suspend guiding checkbox, number of frames,... )

Question 4:
When I press Ctrl+b, I was expecting to find all the content exposed in the DBus documentation. However, I only see KStars and SimClock module, is it normal ?

Thank you in advance for your help


Thibault replied to the topic 'StarQuew - Web INDI client and sequence generator' in the forum. 2 months ago

Congratulation for this work !
I really liked your previous indi-based project , and took a lot of ideas from there to implement my own app.
I wish this project a long life :)


Thibault replied to the topic 'fully automated telescope control' in the forum. 2 months ago

First things first, I upgraded and tested the DBus script to python3 + more recent python binding system for dbus scripting called pydbus (dbus python module is now obsolete):

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from gi.repository import GObject
from gi.repository import GLib
import os
import time

# Create a session bus.
from pydbus import SessionBus
bus = SessionBus()

# Create an object that will proxy for a particular remote object.
remote_object = bus.get("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:")

# Get INDI interface
myDevices = [ "indi_simulator_telescope", "indi_simulator_ccd" ]

# Start INDI devices
remote_object.start("7624", myDevices)

print("Waiting for INDI devices...")

# Create array for received devices
devices = []

while True:
    devices = remote_object.getDevices()
    if (len(devices) < len(myDevices)):

print("We received the following devices:")
for device in devices:

print("Establishing connection to Telescope and CCD...")

# Set connect switch to ON to connect the devices
remote_object.setSwitch("Telescope Simulator", "CONNECTION", "CONNECT", "On")
# Send the switch to INDI server so that it gets processed by the driver
remote_object.sendProperty("Telescope Simulator", "CONNECTION")
# Same thing for CCD Simulator
remote_object.setSwitch("CCD Simulator", "CONNECTION", "CONNECT", "On")
remote_object.sendProperty("CCD Simulator", "CONNECTION")

telescopeState = "Busy"
ccdState       = "Busy"

# Wait until devices are connected
while True:
    telescopeState = remote_object.getPropertyState("Telescope Simulator", "CONNECTION")
    ccdState       = remote_object.getPropertyState("CCD Simulator", "CONNECTION")
    if (telescopeState != "Ok" or ccdState != "Ok"):

print("Connected to Telescope and CCD is established.")
print("Commanding telescope to slew to coordinates of star Caph...")

# Set Telescope RA,DEC coords in JNOW
remote_object.setNumber("Telescope Simulator", "EQUATORIAL_EOD_COORD", "RA", 0.166)
remote_object.setNumber("Telescope Simulator", "EQUATORIAL_EOD_COORD", "DEC", 59.239)
remote_object.sendProperty("Telescope Simulator", "EQUATORIAL_EOD_COORD")

# Wait until slew is done
telescopeState = "Busy"
while True:
    telescopeState = remote_object.getPropertyState("Telescope Simulator", "EQUATORIAL_EOD_COORD")
    if (telescopeState != "Ok"):

print("Telescope slew is complete, tracking...")
print("Taking a 5 second CCD exposure...")

# Take 5 second exposure
remote_object.setNumber("CCD Simulator", "CCD_EXPOSURE", "CCD_EXPOSURE_VALUE", 5.0)
remote_object.sendProperty("CCD Simulator", "CCD_EXPOSURE")

# Wait until exposure is done
ccdState       = "Busy"
while True:
    ccdState = remote_object.getPropertyState("CCD Simulator", "CCD_EXPOSURE")
    if (ccdState != "Ok"):

print("Exposure complete")

# Get image file name and open it in external fv tool
fileinfo = remote_object.getBLOBFile("CCD Simulator", "CCD1", "CCD1")
print("We received file: ", fileinfo[0], " with format ", fileinfo[1], " and size ", fileinfo[2])

print("Invoking fv tool to view the received FITS file...")
# run external fits viewer
command = "fv " + fileinfo[0]

print("Shutting down INDI server...")
# Stop INDI server


Thibault replied to the topic 'fully automated telescope control' in the forum. 2 months ago

Awesome ! Although I am a complete beginner to DBus scripting, I am going to make some experiments with this :)


Thibault replied to the topic 'fully automated telescope control' in the forum. 2 months ago

I am sorry if this has been answered elswhere.
I recently saw this page, and it looks like the latest documentation I could find about DBus scripting in python is this one:

Are there some update explaining for instance how to script the autoguiding ?


Thibault has liked Magnus's Profile 2 months ago
Thibault thanked fehlfarbe in topic Take image with python script 3 months ago
Thibault replied to the topic 'Problem with PyIndi client' in the forum. 3 months ago

Sorry, I don't own a skywatcher mount nor do I use eqmod, what is the limit yiu are talking about ?


Thibault created a new topic ' Support of TELESCOPE_PIER_SIDE switch / meridian flip' in the forum. 3 months ago

Dear all,

I am trying to setup a virtual version of my future observatory, and I am now trying to understand the constraint related to the use of german equatorial mount (I never had one before).

I noticed that the indi_smulator_telescope does not features the TELESCOPE_PIER_SIDE switch defined here:

I was wondering which commercially available mount that has a indi driver features this switch, and how is it possible to tell indi to automatically perform a meridian flip given a certain angular threshold.

And finally, is there a simulator for this ?

Thank you very much for your help


Thibault thanked Jasem Mutlaq in topic GPhoto CCD Transfer Format 4 months ago
Thibault replied to the topic 'Cooling of CCD via pyindi' in the forum. 4 months ago

Whenever I want to integrate a new feature to my python sequencer, I first start to read this page:

Here, I see that there is the 'CCD_TEMPERATURE' property, which is of type Number, and is not readonly. It contains only one member which is "CCD_TEMPERATURE_VALUE". Of course, I guess you know that.

The next step is usually just to query/send the new value. To do so , I highly recommend you to use the class that you can find here:

Then when you have instanciated your device, you can do something like this:
self.setNumber('CCD_TEMPERATURE', {'CCD_TEMPERATURE_VALUE': float(-30)}, sync=True, timeout=60)

In the device class, you can see that, setting the sync to true makes the client to wait for the server to update state to PyIndi.IPS_OK, PyIndi.IPS_IDLE. It has to be tested, but I guess that setting temperature may (or may not) return whenever the target temperature has been reached.

Good luck with coding you client.
Additional question, in your code, you wrote 'PyQtIndi.IndiClient' is it normal ? do you use a PyQt indiclient ?



3rd Party

Choose from the numerous 3rd party INDI drivers to suit your needs!

Got Problem?

Check out the FAQ, the forum, and the bug tracking system to resolve any issues you might have!
You can also subscribe to INDI newsletter and development mailing lists to get the latest updates on INDI!