×

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

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

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

The manual says it can be in Access Mode (aka hotspot) or you can join it to your WiFi network. So the IP depends on how you connect it. There is no information on the port used, you have to ask Celestron or find it from another source.
6 years 8 months ago #18159

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

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

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

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

Forgive my ignorance. But this code doesn't make sense to me.
the variable cmonitor is refering to a property named "CONNECTION".
why are we setting the member variable s to "CONNECT" and "DISCONNECT" at the same time?!?!?

Let's say I need to set the device IP and port, therefore I need to set the "DEVICE_PORT" property. This property has only one member. Then, how can I set both IP and port of the mount?

Cheers.
6 years 7 months ago #18180

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

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 7 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.

Time to create page: 0.859 seconds