Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

LX200 protocol implementation (Python)


freiform

Recommended Posts

Hi, 

is anyone aware of a preferably Python implementation of the LX200 protocol for mount control? I'm planning to communicate with EQmac, which supposedly "provides an LX200 emulation mode via TCP/IP" [1].  Before I start implementing myself I wanted to ask if there already is a solution that I am unable to turn up..

Thanks

Sven

[1] http://eqmac.hulse.id.au/content/interfacing-other-software

Link to comment
Share on other sites

I am a bit unsure as to what you mean. Are you talking about a client to the LX200 protocol, or an implementatin of the protocol itself? The latter would be for controlling dedicated hardware, the former for talking to hardware that talks LX200.

Maybe a peek at INDI?

/per

Link to comment
Share on other sites

If you are talking about the LX200 classic - then the communication protocol is just an RS 232 serial link, 9600 baud. 

If you mean the commands and responses, these are documented in the back of the Meade LX200 instruction manual.

There is also some sample code, but in Basic so maybe not directly usable...

Callum

Link to comment
Share on other sites

  • 6 years later...
8 hours ago, spcemsuk said:

Hello freiform, I am searching for the same thing. Have you did the LX200 protocol implementation with Python? Please, how did you do?
Henr.

That member last visited the forum back in January, and most of his last post were dated August 2020, so you may not get a reply having resurrected a 7 year old post.  You could try sending them a DM just in case they have set their profile to provide notifications to private messages

Link to comment
Share on other sites

9 hours ago, spcemsuk said:

Hello freiform, I am searching for the same thing. Have you did the LX200 protocol implementation with Python? Please, how did you do?
Henr.

HI, as previously posted in this tread, the protocol is freely available. Not all mounts implement all of the protocol though. What mount do you have?

Thereafter its a relatively simple case of sending the commands, as bytes, and receiving the response as bytes(if any). The protocol is rather old and make use of an unusual set of punctuation, so a reasonable knowledge of Python string handing functions is useful.

I assume you are using a Raspberry Pi? What is the connection to the mount, TCP/IP (wifi?) ,serial or USB.

Link to comment
Share on other sites

On 29/05/2022 at 08:00, AstroKeith said:

HI, as previously posted in this tread, the protocol is freely available. Not all mounts implement all of the protocol though. What mount do you have?

Thereafter its a relatively simple case of sending the commands, as bytes, and receiving the response as bytes(if any). The protocol is rather old and make use of an unusual set of punctuation, so a reasonable knowledge of Python string handing functions is useful.

I assume you are using a Raspberry Pi? What is the connection to the mount, TCP/IP (wifi?) ,serial or USB.

Thanks for response! I am using a microcontroller like Raspberry Pi, but his name is ESP32, with TCP/IP connection mode. I can program in C++ (arduino) or Python in my ESP32. Well, I didn't understand how to make the protocol functions to put in microcontroller. I know code, but I don't understand the "Meade Telescope Serial Command Protocol" and neither how to implement it. 
Is it so difficult to make it? 

Link to comment
Share on other sites

9 minutes ago, spcemsuk said:

Thanks for response! I am using a microcontroller like Raspberry Pi, but his name is ESP32, with TCP/IP connection mode. I can program in C++ (arduino) or Python in my ESP32. Well, I didn't understand how to make the protocol functions to put in microcontroller. I know code, but I don't understand the "Meade Telescope Serial Command Protocol" and neither how to implement it. 
Is it so difficult to make it? 

The following code will open a TCP/IP socket as client to a Nexus DSC (as an example) and allow you to send LX200 commands and see what comes back. 

Basically its just using 'send' and 'recv' to communicate. Use the LX200 protocol (attached). Note carefully the syntax, especial the use of : and * as delimiters.

import time
import socket

HOST = '10.0.0.1'  # Nexus DSC IP address
PORT = 4060        # The port used Nexus

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((HOST, PORT))
    s.send(b':P#') # find out if device is in high precision mode
    p = str(s.recv(15),'ascii')
    if p[0] == 'L': 
        s.send(b':U#') #if not toggle it
    while True:
        send = input ("string to be sent (not including leading ':' and trailing '#'")
        send = ':'+send+'#'
        s.send(bytes(send.encode('ascii')))
        time.sleep(0.1)
        ra = str(s.recv(1024),'ascii')
        print(len(ra),':',ra)

LX200CommandSet.pdf

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.