×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Celestron NexStar Evolution Mount + Python + Raspberry Pi

When you run the driver, always use indi_getprop to get a list of existing properties. This would help you decide which ones are needed. So basically:
+ Celestron GPS.CONNECTION_MODE.CONNECTION_TCP=On
+ Celestron GPS.DEVICE_TCP_ADDRESS.ADDRESS="1.2.3.4" or whatever
+ Celestron GPS.DEVICE_TCP_ADDRESS.PORT="2000"
+ Celestron GPS.CONNECTION.CONNECT=On

Regarding the CONNECTION, CONNECT=ON & DISCONNECT=OFF then you send CONNECTION. Please read INDI Developer Manual to understand how INDI works.
6 years 8 months ago #18181

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
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
6 years 7 months ago #18187

Please Log in or Create an account to join the conversation.

I know you're NOT using this for astronomy, but can you at least use KStars to test connection to your mount? Once that's out of the way, go back to your Python code. Within KStars, turn on DEBUG logging and then establish a connection and find out what it's failing exactly. You could probably do the same thing in Python but I'd wager it's going to take a lot more coding to figure out.
6 years 7 months ago #18188

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
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 ... 

I tried connecting to the mount by using "SkyQLinkPC" and "NexRemore" in Windows OS and everything works fine.
6 years 7 months ago #18192

Please Log in or Create an account to join the conversation.

Did you connect to the Celestron hotpost before you established connection? You must be able to reach the IP address 1.2.3.4 by pinging it from your machine.
6 years 7 months ago #18193

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
Yes, I am connected to the Telescope.

I can ping it as well.
6 years 7 months ago #18194

Please Log in or Create an account to join the conversation.

  • Posts: 200
  • Thank you received: 57
Celestron driver is not going to work in wifi mode. The Nexstar Evolution is using AUX protocol over Wi-Fi. You need to use nexstarevo driver over wifi or celestron driver over serial connection to hand controller. The NS-evo driver is beta-quality but should work and I, as a primary author, will be happy to help you make it work. I would really appreciate any feedback concerning this driver.
The following user(s) said Thank You: Jasem Mutlaq
Last edit: 6 years 7 months ago by Paweł. Reason: typo
6 years 7 months ago #18226

Please Log in or Create an account to join the conversation.

  • Posts: 200
  • Thank you received: 57
Addendum: some changes in libindi must have disagree with my driver and recent build stopped working - I recommend the last released version. I'll fix it soon but not today sadly.
6 years 7 months ago #18257

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
Thanks a lot, Jochym.

Actually, your comment helped me a lot. I checked
https://github.com/jochym/nexstar-evo
and found a lot of useful information about AUX protocol. I finally managed to control the mount. To avoid the hassle for time being, I will use a simple Python code to control the mount. The concept of INDI drivers is too much for what I intend to do.

I also need to thank knro because of his patience and quick replies to my questions.
6 years 7 months ago #18264

Please Log in or Create an account to join the conversation.

  • Posts: 200
  • Thank you received: 57
I missed your post about the goal. If your goal is to write a direct AUX client without astronomy context indi is not a right route IMHO. You can write much simpler interface code in python3.5+ using async/await. See the simulator code in the indi driver - it is almost complete mount simulator written in python in few hours. There is also some skeletal code in the mentioned github repo which you can use as a starting point. I am writing an independent satellite tracker for the mount so I would appreciate if you tell us how is it going with your project (github repo?) - maybe I can also reuse some of your code.
6 years 7 months ago #18265

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
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.
6 years 7 months ago #18267

Please Log in or Create an account to join the conversation.

  • Posts: 200
  • Thank you received: 57
Even more helpful may be the python library I have written for the satellite tracker. You can lift the interfacing code right out of it.
github.com/jochym/nexstar-evo/nsevo/nexstarevo.py
6 years 7 months ago #18276

Please Log in or Create an account to join the conversation.

Time to create page: 0.789 seconds