Hello
I want to slew my mount to a specific point. For example RA to 4:00:00 or DEC to 77.5. In kstars I can set only both values at once, but I only want to set them independently. I thought I could do this via python-dbus script as decribed in the tutorial. But because I talk to my mount via
indiserver "EQMod Mount"@rp:7624 indi_gphoto_ccd
I dont know how to set it in "myDevices": I tried
myDevices = [ "EQMod Mount@rp:7624", "indi_gphoto_ccd" ]
myDevices = [ '"EQMod Mount"@rp:7624', "indi_gphoto_ccd" ]
myDevices = [ "'EQMod Mount'@rp:7624", "indi_gphoto_ccd" ]
but none of this talkes to the raspberryPi server. Is this possible at all?
complete script:
#!/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.
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 = [ '"EQMod Mount"@rp', "indi_gphoto_ccd" ]
# Start INDI devices
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("EQMod Mount", "CONNECTION", "CONNECT", "On")
# Send the switch to INDI server so that it gets processed by the driver
iface.sendProperty("EQMod Mount", "CONNECTION")
# Same thing for CCD Simulator
iface.setSwitch("GPhoto CCD", "CONNECTION", "CONNECT", "On")
iface.sendProperty("GPhoto CCD", "CONNECTION")
telescopeState = "Busy"
ccdState = "Busy"
# Wait until devices are connected
while True:
telescopeState = iface.getPropertyState("EQMod Mount", "CONNECTION")
ccdState = iface.getPropertyState("GPhoto CCD", "CONNECTION")
if (telescopeState != "Ok" or ccdState != "Ok"):
time.sleep(1)
else:
break
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
iface.setNumber("EQMod Mount", "EQUATORIAL_EOD_COORD", "RA", 4.000)
iface.setNumber("EQMod Mount", "EQUATORIAL_EOD_COORD", "DEC", 77.500)
iface.sendProperty("EQMod Mount", "EQUATORIAL_EOD_COORD")
# Wait until slew is done
telescopeState = "Busy"
while True:
telescopeState = iface.getPropertyState("EQMod Mount", "EQUATORIAL_EOD_COORD")
if (telescopeState != "Ok"):
time.sleep(1)
else:
break
print "Telescope slew is complete, tracking..."
print "Shutting down INDI server..."
# Stop INDI server
iface.stop("7624")