stellarium and arduino communication problem with lx200 protocol

Asked by madan

Hi

I am new to mailing list. I am writing arduino program for my home made eq mount.
I'm in need of some help for stellarium error.
Stellarium accepts :GR# but it gives error: degree sign expected for :GD# though the telescope(arduino) is connected and seen in stellarium.

I am not able to slew or go any further due to this error.

Logs:

15757, 12:15:53.883258Z: Lx200Connection::sendCommand(Lx200CommandGetRa)
15757, 12:15:53.883258Z: Lx200Connection::writeFrontCommandToBuffer(Lx200CommandGetRa): queued
15757, 12:15:53.883258Z: Lx200Connection::sendCommand(Lx200CommandGetDec)
15757, 12:15:53.884258Z: Connection::performWriting: writeNonblocking(5) returned 5; #:GR#
15757, 12:15:59.035552Z: Lx200Connection::resetCommunication
15757, 12:15:59.206562Z: Lx200Connection::sendCommand(Lx200CommandGetRa)
15757, 12:15:59.206562Z: Lx200Connection::sendCommand(Lx200CommandGetDec)
15757, 12:16:09.103128Z: Lx200Connection::writeFrontCommandToBuffer(Lx200CommandGetRa): queued
15757, 12:16:09.104128Z: Connection::performWriting: writeNonblocking(5) returned 5; #:GR#
15757, 12:16:09.286139Z: Connection::performReading: readNonblocking returned 9; 10:10:10#
15757, 12:16:09.286139Z: Lx200CommandGetRa::readAnswerFromBuffer: RA = 10:10:10
15757, 12:16:09.286139Z: Lx200Connection::writeFrontCommandToBuffer(Lx200CommandGetDec): queued
15757, 12:16:09.466149Z: Connection::performWriting: writeNonblocking(5) returned 5; #:GD#
15757, 12:16:09.656160Z: Connection::performReading: readNonblocking returned 10; -11*11:11#
15757, 12:16:09.656160Z: Lx200CommandGetDec::readAnswerFromBuffer: error: degree sign expected
15757, 12:16:09.656160Z: Lx200CommandGetDec::readAnswerFromBuffer: Dec = -11:11:11

here is the arduino code:

  {
    if (stringOne =="#:GR#"){
      hh += HH;
      mm += MM;
      ss += SS1;
      Serial.print (hh);
      Serial.print (':');
      Serial.print (mm);
      Serial.print (':');
      Serial.print (ss);
      Serial.print ('#');
      stringOne ="";

    }
    if (stringOne =="#:GD#"){

      Serial.write ('-');
      Serial.print (deg);
      Serial.write ('*');
      Serial.print (mint);
      //Serial.print (':');
      //Serial.print (sec);
      Serial.write ('#');
      stringOne ="";
    }
  }

I went through almost all blogs and email list and I couldnt find a solution for this error.
Please do notify me if there are any more information required.
looking for suggestions.

thank you,
Madan

Question information

Language:
English Edit question
Status:
Answered
For:
Stellarium Edit question
Assignee:
Bogdan Marinov Edit question
Last query:
Last reply:
Revision history for this message
Bogdan Marinov (daggerstab) said :
#1

In the Lx200CommandGetDec::readAnswerFromBuffer() function, Stellarium expects the degree value to have two digits, followed by the ASCII character with code 223. I have vague memories of researching this, but I'm not sure why such a check is not performed for the RA value. If necessary, I can try digging up my LX200 command reference to check, but it will take time.

Does this help?

Revision history for this message
madan (panchatham) said :
#2

hi bogdan,

i got the same suggestion from another mail list.
if i am right 223 is Beta character. i tried sending Beta and also asterisk, colon none of them worked.
how to send the values exactly?
sorry for asking silly question. i am not a really into programing. just started :)

thank you,
madan

Revision history for this message
Bogdan Marinov (daggerstab) said :
#3

The client's source code uses a cast of 223 to "char":

(char)223

See here (direct link to the line in the code browser):
http://bazaar.launchpad.net/~stellarium/stellarium/trunk/view/5862/plugins/TelescopeControl/src/servers/Lx200Command.cpp#L496

Can you help with this problem?

Provide an answer of your own, or ask madan for more information if necessary.

To post a message you must log in.