New post
0

Problem Controlling Meade LX200 Classic With Raspberry Pi

Hello,

I've used to control the telescope with the SkySafari iOS app by setting the IP address and port and configuring the app for "Meade LX-200 Classic". There's a small application on a raspberry pi which processes the LX-200 commands and sends them to the telescope.

This used to work fine in the past but stopped working recently, and I'm trying to figure out why.

It seems the problem is with the :RS# command. This command expects no response according to the LX-200 protocol, but as soon as the app sends this command, the communication stops working. For :GR# or :GD#, for example, it seems to work fine. The commands arrive and responses get sent back.

Did anything change with respect to how the server side should react to :RS#, for example, should it shutdown the socket (send TCP FIN), or send a special "EOF" character?

Thank you and greetings,

Andreas

4 comments

  • 0
    Avatar
    Aschweiz

    (by "stops working", I mean the app stops sending commands and displays an error message that it could connect to the telescope but didn't get a response)

  • 0
    Avatar
    Keiron Smith

    Hi Andreas, 

    It's not clear at all what your setup is here.  Are you using SkySafari, and if so how?  How is Raspberry Pi implemented into your setup?  If you want help in the community forums you'll need to provide a lot more detail.

    Thanks!

  • 0
    Avatar
    Wolfgang Birkfellner

    Hello!

    Same problem here, and it is not limited to Raspberries, but I encountered it on a Pi as well as on an ESP32 microcontroller. When connecting SkySafari6 pro via wlan on an android device using the standard socket C-limbo, I get the first LX200 command (:GR#), i send an answer (which is received by SkySafari acccording to the log), but then the socket on my side goes into an error state ("Bad Address"); subsequent requests are therefore no longer being handled. 

    So far, so good - BUT the same code works with Cartes du Ciel or KStars without problems. Does anyone have an idea what the problem could be? I will post it when I have an answer ...

    yours

    wolfi

  • 0
    Avatar
    Wolfgang Birkfellner

    Hi!

    I have found something - I don't know whether I am really correct, but after checking TCP/IP layer traffic, I have an idea. I posted the topic here in another forum, let's see whether I am right:

    - according to network traffic, SSafari closes the connection after each write and requests a new connection. no idea why, this is not very canonical.

    - the only chance to keep the connection alive with BSD sockets that I have found is the following:

    - set the socket to SO_REUSEADDR

    - set SO_LINGER to 0 s.

    - after each write, SHUTDOWN the client socket for read and write, and close it.

    - call ACCEPT to reopen the client socket

    - wait for the next incoming request from SSafari.

    Hopefully there is something more elegant. Can provide code if interested ...

    yours

    wolfi

     

     

Please sign in to leave a comment.