Bi-monthly release with minor bug fixes and improvements
Please Log in or Create an account to join the conversation.
import PyIndi
import time
class IndiClient(PyIndi.BaseClient):
def __init__(self):
super(IndiClient, self).__init__()
def newDevice(self, d):
global dmonitor
# We catch the monitored device
dmonitor = d
def newProperty(self, p):
global monitored
global cmonitor
global mmonitor
global amonitor
# we catch the "CONNECTION" property of the monitored device
if (p.getDeviceName() == monitored and p.getName() == "CONNECTION"):
cmonitor = p.getSwitch()
if (p.getDeviceName() == monitored and p.getName() == "CONNECTION_MODE"):
mmonitor = p.getSwitch()
if (p.getDeviceName() == monitored and p.getName() == "DEVICE_TCP_ADDRESS"):
amonitor = p.getText()
print("New property ", p.getName(), " for device ", p.getDeviceName())
def removeProperty(self, p):
print("removeProperty function")
pass
def newBLOB(self, bp):
print("newBLOB function")
pass
def newSwitch(self, svp):
print("newSwitch function")
print(svp.name)
print(svp[0].s)
pass
def newNumber(self, nvp):
print("newNumber function")
global newval
global prop
# We only monitor Number properties of the monitored device
prop = nvp
newval = True
def newText(self, tvp):
print("newText function")
pass
def newLight(self, lvp):
print("newLight function")
pass
def newMessage(self, d, m):
print("newMessage function")
pass
def serverConnected(self):
print("serverConnected function\n")
pass
def serverDisconnected(self, code):
print("serverDisconnected function\n")
pass
monitored = "Celestron GPS"
dmonitor = None
cmonitor = None
mmonitor = None
amonitor = None
indiclient = IndiClient()
indiclient.setServer("localhost", 7624)
# we are only interested in the telescope device properties
indiclient.watchDevice(monitored)
indiclient.connectServer()
# wait CONNECTION_MODE property be defined
while not(mmonitor):
time.sleep(0.05)
mmonitor[0].s = PyIndi.ISS_OFF # the "SERIAL" ISwitch
mmonitor[1].s = PyIndi.ISS_ON # the "TCP" ISwitch
indiclient.sendNewSwitch(mmonitor) # set the driver
# wait DEVICE_TCP_ADDRESS property be defined
while not(amonitor):
time.sleep(0.05)
amonitor[0].text = "1.2.3.4" # the "ADDRESS" ISwitch
amonitor[1].text = "2000" # the "PORT" ISwitch
indiclient.sendNewText(amonitor) # set the driver
# wait CONNECTION property be defined
while not(cmonitor):
time.sleep(0.05)
cmonitor[0].s = PyIndi.ISS_ON # the "CONNECT" switch
cmonitor[1].s = PyIndi.ISS_OFF # the "DISCONNECT" switch
indiclient.sendNewSwitch(cmonitor) # send this new value to the device
while(1):
pass
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
2017-07-30T15:03:35: Handshake failed.
2017-07-30T15:03:35: Failed to communicate with the mount, check the logs for details.
2017-07-30T15:03:35: Write Error: Broken pipe
2017-07-30T15:03:35: Read Error: Connection reset by peer
2017-07-30T15:03:35: Initializing Celestron using Kx CMD...
2017-07-30T15:03:35: Connection successful, attempting handshake...
2017-07-30T15:03:35: Connecting to 1.2.3.4@2000 ...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
https://github.com/jochym/nexstar-evo
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.