Go Down

Topic: Arduino + Stellarium with Meade lx200 Protocol (Read 13489 times) previous topic - next topic


i'm trying to interface stellarium and an Arduino based telescope motor through the Telescope plugin using the meade lx200 protocol as described here-->http://www.meade.com/support/LX200CommandSet.pdf.
I have successfully answered to the getRA command but the getDEC command gives me problems:
in fact in the protocol documentation it says that i have to send back the value of the Declination as
Code: [Select]

i think s is the sign(+ or -) and i give random numbers on D and M (eg.
Code: [Select]
. this is what i send back through Serial.
But in the log message it says:
Code: [Select]

15445, 11:34:00.890104Z: Lx200Connection::sendCommand(Lx200CommandGetRa)
15445, 11:34:00.890104Z: Lx200Connection::writeFrontCommandToBuffer(Lx200CommandGetRa): queued
15445, 11:34:00.890104Z: Lx200Connection::sendCommand(Lx200CommandGetDec)
15445, 11:34:00.890104Z: Connection::performWriting: writeNonblocking(5) returned 5; #:GR#
15445, 11:34:05.904390Z: Lx200Connection::resetCommunication
15445, 11:34:05.921391Z: Lx200Connection::sendCommand(Lx200CommandGetRa)
15445, 11:34:05.921391Z: Lx200Connection::sendCommand(Lx200CommandGetDec)
15445, 11:34:15.952965Z: Lx200Connection::writeFrontCommandToBuffer(Lx200CommandGetRa): queued
15445, 11:34:15.952965Z: Connection::performWriting: writeNonblocking(5) returned 5; #:GR#
15445, 11:34:16.018969Z: Connection::performReading: readNonblocking returned 11; 03:00:00#

15445, 11:34:16.018969Z: Lx200CommandGetRa::readAnswerFromBuffer: RA = 03:00:00
15445, 11:34:16.018969Z: Lx200Connection::writeFrontCommandToBuffer(Lx200CommandGetDec): queued
15445, 11:34:16.077972Z: Connection::performWriting: writeNonblocking(5) returned 5; #:GD#
15445, 11:34:16.138976Z: Connection::performReading: readNonblocking returned 7; +45*00#
15445, 11:34:16.138976Z: Lx200CommandGetDec::readAnswerFromBuffer: error: '+' or '-' expected
15445, 11:34:16.138976Z: Lx200Connection::resetCommunication
15445, 11:34:16.202979Z: Lx200Connection::sendCommand(Lx200CommandGetRa)
15445, 11:34:16.202979Z: Lx200Connection::sendCommand(Lx200CommandGetDec)
15445, 11:34:16.202979Z: Connection::performReading: readNonblocking returned 2;

I don't know how to solve the
errot '+' or '-' expected

Thanks in advance for any help


The documentation says on page 10:

Set target object declination to sDD*MM or sDD*MM:SS depending on the current precision setting
1 - Dec Accepted
0 - Dec invalid

you need to prepend Sd for the command  - did you include that?

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Code: [Select]
SdsDD*MM# is only for Stellarium to tell the telescope which are is the Declination of the target he has to look for. The
Code: [Select]
Sd before
Code: [Select]
sDD*MM# is only a command to tell the scope Setdeclinationto...
what i was looking to was how should be the declination written by The telescope for the Pc
anyway thanks for the help

i tried it anyway and it doesn't worked, as expected :0 :0


Can you post the library you're using / the code of the sketch?

Maybe that helps us to understand the problem as I don't know now how the log you posted is generated.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


The log i posted is generated by the stellarium telescope plugin, i'll post the sources of the plugin only as attachment, you have to take a look at Server-->the lx200 ones.

and for my sketch code, here it is:
Code: [Select]
void setup() {
String stringOne = "";
void loop() {
  if (Serial.available()){
    while (Serial.available()>0){
      char a=Serial.read();            // Stores current byte
      stringOne += String(a);          // Append current Byte to message String
    if (stringOne == "#:GR#"){         // if command received = get RA do...
    if (stringOne == "#:GD#"){         // if command received = get DEC do...
    stringOne = "";


I tried everything and i think there is only one chance more, to try connecting the telescope to arduino IDE and through the serial monitor send #:GD# and see exactly what it gets.
If somebody with that mount could try it, it would be very appreciate. XD XD



I solved the problem two weeks ago, but want to share what the problem was;
the problem consisted in how i send the DEC back to stellarium, in fact i used the
Code: [Select]

so it received the RA and after the string it added a
Code: [Select]

which stellarium after appends to the DEC string and tries to analize it instead of the "+" or "-", i solved simply by using
Code: [Select]

which doesn't append anything to what i send back.

Thanks anyway for the help


Actually if you look at the length of the string you'll see the RA is sent as 11 characters, but there are only 9 printable ones, so I think it's almost certainly adding 0x0D,0x0A (CRLF) - both of which are separately echoed as blank lines in the log in fact...
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]



I found this project on web, works great on Arduino, but I never test with a real telescope:



Google translator cannot find that page??? What language that is?

The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"


Oct 12, 2012, 05:01 am Last Edit: Oct 12, 2012, 05:05 am by ninosr Reason: 1
langauge is spanish. he is stating the page will be used for documentation and the steps he will take to development the code for his goto mount via Arduino Uno andUSB motor Shield using stepper motors


Hi, read this
Code: [Select]
can help you

after that and understand how this work can drive for this
Code: [Select]
http://www.jgiesen.de/astro/astroJS/siderealClock/ instead calculate everything manually.

I doing the same, but now i have the problem of down't know what to do with what I received.

I'm work with a digital compass and accelerometer

Go Up