Thanks for the tip.
My project is related to wireless optical communication. Basically, we use two sets of telescope device, as the transmitter and the receiver. These telescopes are supposed to point towards each other automatically.
The code I am developing is supposed to use the coordinates from GPS unit and orientation from compass module and estimates the required rotations for both telescope devices.
The mathematics and procedure are straight forward and easy.
Once I finish the code and also make sure it is functional, I will be more than happy to share it with anyone.
Cheers.
Read More...
Thanks a lot, Jochym.
Actually, your comment helped me a lot. I checked
https://github.com/jochym/nexstar-evo
Yes, I am connected to the Telescope.
I can ping it as well.
Read More...
Here is the error message generated by KStars:
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 ...
For some reason when I set all the properties and then connect to the device (CONNECTION.CONNECT=On
), the connection is set back to Off state (CONNECTION.CONNECT=Off)
Besides only limited no of properties are extracted with the code, whereas "indi_getprop" shows more properties. Also There are no properties related to telescope movement and alignment.
I'm wondering if I am dointy ity wrong.
Here is the code I used:
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
Hopefully, the people from Celestron were kind enough to give me detailed information on WiFi module.
If Direct connection method is used, the default IP address is "1.2.3.4" and port no is "2000".
So having this information, how can I change the connection method in INDI Python program.
I followed the second example in
PyIndi
, while setting the variable monitored to "Celestron GPS".
The code runs and shows some properties which I assume are the default properties.
Then, there is this part:
# if the monitored device is not connected, we do connect it
if not(dmonitor.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
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
Thanks for the tips.
I realized the WiFi module has an IP address of 1.2.3.4
Using "nmap" tool in linux, I'm trying to find the available ports. I also asked the customer serive of Celestron.
Now in your previous reply, you talked about changing the connection to "Ethernet", It would be your kind if you can suggest an example of help page so that I can go though and learn about it.
Cheers.
Read More...
Thanks a lot.
Your previous reply was really helpful. I can use Python code for the simulation drivers.
Now I have some other issues.
How can I find the IP address and port of the mount? I checked the specifications and datasheet. It gives no clue about it.
The mount I am using came as a part of the following setup:
www.celestron.com/browse-shop/astronomy/.../nexstar-evolution-8
Read More...
To make it clear what I want to do, let me put it in this way.
I need to write a simple client program. The client program simply tells the mount to rotate a specific angle.
The project is not related to astronomy so I don't want to use other clients softwares.
I can use both Python and C languages.
However for Raspberry Pi 3, I prefer to use Python.
Read More...
Thank you for replying.
But your answer didn't help me at all. Like I said I am new to INDI. I've never used it. The website doesn't provide a useful document on how to use it.
I also tried to install "PyIndi-Client" module in my Raspberry Pi 3. But it exits with an error.
So basically I have no idea what to do and where to look for information.
Read More...
At the moment I am using "Celestron SkyPortal" and WiFi connection mobile app to control the mount.
Read More...
Hi Everyone,
I want to control a Celestron NexStart mount using Raspberry Pi 3 through WiFi connection.
Raspberry Pi comes with Python as the default programming tool.
I am new to INDI and I like to learn it to some extend. Please let me know where to begin and what to read.
Cheers.
Read More...