Enrico Pallazzo replied to the topic 'Slew with PyIndi' in the forum. 5 years ago

Umm, there is something about the execution time. If I run this as a script it actually works. I was trying to execute in a Jupyter notebook.
Maybe there is a respawn mechanism that loads back the coordinates from the telescope and when I overwrite them with my target coordinates I have to apply the settings before the next refresh. Anyway, the script works. It can crash at the end because there isn't no disconnect from the server and probably the C++ doesn't invoke the destructor at the end having some memory leak. So if someone wants to use I suggest to add indiclient.disconnectServer() at the end.


Enrico Pallazzo created a new topic ' Slew with PyIndi' in the forum. 5 years ago

I have an INDI server with a SkyWatcher AZEQ6 mount connected that works perfectly with KStars, so the communication and the server is properly installed.
I am now trying to do some test with python to control the mount with the PyIndi library but I haven't succeed even in a simple slew script.
As far as I understood the following script should slew to Vega, but it doesn't do anything neither it returns any error.
What am I doing wrong?

 import PyIndi
import time

 class IndiClient(PyIndi.BaseClient):
     def __init__(self):
         super(IndiClient, self).__init__()
     def newDevice(self, d):
     def newProperty(self, p):
     def removeProperty(self, p):
     def newBLOB(self, bp):
     def newSwitch(self, svp):
     def newNumber(self, nvp):
     def newText(self, tvp):
     def newLight(self, lvp):
     def newMessage(self, d, m):
     def serverConnected(self):
     def serverDisconnected(self, code):
 # connect the server

 if (not(indiclient.connectServer())):
      print("No indiserver running on "+indiclient.getHost()+":"+str(indiclient.getPort())+" - Try to run")
      print("  indiserver indi_simulator_telescope indi_simulator_ccd")

 # connect the scope
 telescope="EQMod Mount"

 # get the telescope device
 while not(device_telescope):

 # wait CONNECTION property be defined for telescope
 while not(telescope_connect):

 # if the telescope device is not connected, we do connect it
 if not(device_telescope.isConnected()):
     # Property vectors are mapped to iterable Python objects
     # Hence we can access each element of the vector using Python indexing
     # each element of the "CONNECTION" vector is a ISwitch
     telescope_connect[0].s=PyIndi.ISS_ON  # the "CONNECT" switch
     telescope_connect[1].s=PyIndi.ISS_OFF # the "DISCONNECT" switch
     indiclient.sendNewSwitch(telescope_connect) # send this new value to the device

 # Now let's make a goto to vega
 # Beware that ra/dec are in decimal hours/degrees
 vega={'ra': (279.23473479 * 24.0)/360.0, 'dec': +38.78368896 }

 # We want to set the ON_COORD_SET switch to engage tracking after goto
 # device.getSwitch is a helper to retrieve a property vector
 while not(telescope_on_coord_set):

 # the order below is defined in the property vector, look at the standard Properties page
 # or enumerate them in the Python shell when you're developing your program
 telescope_on_coord_set[0].s=PyIndi.ISS_ON # TRACK
 telescope_on_coord_set[1].s=PyIndi.ISS_OFF # SLEW
 telescope_on_coord_set[2].s=PyIndi.ISS_OFF # SYNC
 # We set the desired coordinates
 while not(telescope_radec):
 # and wait for the scope has finished moving
 while (telescope_radec.s==PyIndi.IPS_BUSY):
     print("Scope Moving ", telescope_radec[0].value, telescope_radec[1].value)


Enrico Pallazzo replied to the topic 'Load and Sync' in the forum. 5 years ago

Exactly, this camera does not work with INDI Canon/GPhoto. I made it working using the chdkptp interface but it is full of hacks that are non standard in gphoto library and there is not way to make it working in gphoto. But I am a bit confused now: why are we talking about the camera? My question was: is it possible to load an image and do the sync with the coordinates of the image instead of the slew? I think this is much easier than to code a new driver for an unsupported camera.


Enrico Pallazzo replied to the topic 'Load and Sync' in the forum. 5 years ago

Canon EOS M10. In particular the long exposure mode works only with CHDK firmware (with the default firmware it does not have Bulb mode).


Enrico Pallazzo replied to the topic 'Load and Sync' in the forum. 5 years ago

Maybe I was not clear with my problem. Let say that my mount has a small misalignment error. Now when I take a photo with the camera and I do Load & Slew astrometry will get the correct coordinates of the pictures but the mount will slew in a position that is not 100% correct because it is with the misalignment. So even if it performs a sync, the final result will be a misaligned position.

By the way, the final sync done after the Load & Slew is performed with the first connected camera (that in my case is the guiding camera, the only one recognized by INDI). This is also somehow a problem because if the guiding scope and the main telescope are not perfectly aligned I'd like to sync everything with the main telescope, not with the guiding.

Everything can be simply solved with the possibility to sync the position with the loaded image without slewing.


Enrico Pallazzo created a new topic ' Load and Sync' in the forum. 5 years ago


first of all thank you for the excellent KStars and Ekos. I have an issue with the Align module.
There are two possibilities of Astrometry alignment, one is Capture & Solve and the other is Load & Slew.
My problem is that I have a camera that is not supported by indi, so I have my external code to manage it, but I would like to capture the image and sync the telescope with my image. This is not possible because if I do Load & Slew the option Sync is not possible, the only thing that I can to is to Slew.
But if I am not perfectly aligned is useless to Slew to coordinates that are not fully correct.
So I wonder if it is possible in some way to do a Load & Sync instead of Slew.
In the right options there is the option Sync but when I use Load & Slew the Slew on Target is automatically selected (and this is coherent with the button function).
Any help is appreciated.