Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bugs in LX200 protocol implementation #818

Closed
gzotti opened this issue Oct 24, 2019 · 16 comments
Closed

Possible bugs in LX200 protocol implementation #818

gzotti opened this issue Oct 24, 2019 · 16 comments
Assignees
Labels
bug Something likely wrong in the code
Milestone

Comments

@gzotti
Copy link
Member

gzotti commented Oct 24, 2019

It seems there should be a few problems in the LX200 commands:

  • Degree sign should be '*' (according to protocol specs), not char(223) which gets truncated (compiler warning).
  • There should be no spaces in the :Sd and :Sr commands

However, I cannot test this as I have no compatible instrument. I will push a tentative fix for the next beta, and we should ask users for response.

@gzotti gzotti added this to the 0.19.3 milestone Oct 24, 2019
@gzotti gzotti self-assigned this Oct 24, 2019
@gzotti gzotti added this to To do in Plugin: Telescope Control via automation Oct 24, 2019
@gzotti gzotti added the state: in progress The problem is in process of solution... label Oct 24, 2019
@alex-w alex-w added state: fixed The bug has been fixed and removed state: in progress The problem is in process of solution... labels Oct 31, 2019
@alex-w alex-w moved this from To do to In progress in Plugin: Telescope Control Oct 31, 2019
@alex-w alex-w added the bug Something likely wrong in the code label Nov 5, 2019
@alex-w
Copy link
Member

alex-w commented Dec 14, 2019

Feedback: https://astronomy.ru/forum/index.php?topic=21983.msg4908237#msg4908237

Not working the RA axis

P.S. False positive - it was DIY project with implementation the LX200 protocol for communication for Stellarium.

@alex-w alex-w closed this as completed Dec 19, 2019
Plugin: Telescope Control automation moved this from In progress to Done Dec 19, 2019
@alex-w alex-w removed the state: fixed The bug has been fixed label Nov 15, 2020
@toweosp
Copy link

toweosp commented Dec 12, 2021

It seems to me that a bug has been introduced with this issue.

When I try to control my MEADE LX200GPS with Stellarium, I get the following error message

Connection::performWriting: writeNonblocking(5) returned 5; #:GD#
Connection::performReading: readNonblocking returned 10; +51ß14:14#
Lx200CommandGetDec::readAnswerFromBuffer: error: degree sign (*) expected

If #:GD# is sent directly to the telescope via the serial interface, it responds with 0xDF (DEC 223) for the degree sign, e.g.:

ASCII: +51ß14:20#
HEX: 0x2b 0x35 0x31 0xdf 0x31 0x34 0x3a 0x32 0x30 0x23

This also seems to be the expected behavior, see

https://www.skymtn.com/mapug-astronomy/ragreiner/LX200Commands.html
and
https://www.astro.louisville.edu/software/xmtel/archive/xmtel-indi-6.0/xmtel-6.0l/support/lx200/CommandSet.html

Therefore, from my point of view, the character DEC 223 / HEX 0xDF must be checked for, not '*'.

@gzotti
Copy link
Member Author

gzotti commented Dec 12, 2021

@toweosp Whoa, finally somebody competent to test this with a real instrument, many thanks.

That means the asterisk published everywhere in the protocol specs is really just a print replacement because they cannot print 0xDF themselves? I just wonder why this is the only character in the protocol that is invalid according to the compiler. Maybe we can change the data type to unsigned char to avoid compiler warnings.

@gzotti gzotti reopened this Dec 12, 2021
Plugin: Telescope Control automation moved this from Done to In progress Dec 12, 2021
@gzotti gzotti modified the milestones: 0.19.3, 0.21.3 Dec 12, 2021
@toweosp
Copy link

toweosp commented Dec 12, 2021

I also wonder why Meade removed the grammar info when they revised their website for the LX200 protocol (see archive on https://www.astro.louisville.edu/software/xmtel/archive/xmtel-indi-6.0/xmtel-6.0l/support/lx200/CommandSet.html#LX200CmdSetGrammar), since there is no information on this in the PDF that you can download from the Meade website today.

@gzotti
Copy link
Member Author

gzotti commented Dec 12, 2021

This change also removed one of two spaces. @toweosp Do you have insight whether these spaces are indeed correct, i.e. should I revert this as well?

@gzotti gzotti closed this as completed in c29ba52 Dec 12, 2021
Plugin: Telescope Control automation moved this from In progress to Done Dec 12, 2021
@gzotti gzotti added the state: fixed The bug has been fixed label Dec 12, 2021
@github-actions
Copy link

Hello @gzotti! Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@gzotti
Copy link
Member Author

gzotti commented Dec 12, 2021

I re-open just to let @toweosp check this fix.

@gzotti gzotti reopened this Dec 12, 2021
Plugin: Telescope Control automation moved this from Done to In progress Dec 12, 2021
@gzotti
Copy link
Member Author

gzotti commented Dec 12, 2021

@toweosp please can you compile and test this fix?

@toweosp
Copy link

toweosp commented Dec 13, 2021

@gzotti
Thank you for your fast correction! The control of the telescope - especially detection of the DEC position - is working now:

Connection::performWriting: writeNonblocking(5) returned 5; #:GD#
Connection::performReading: readNonblocking returned 10; +29ß12:42#
Lx200CommandGetDec::readAnswerFromBuffer: Dec = +29:12:42

Regarding the :Sr command, I have observed the following with direct serial communication:

#:Sr23:00:00#
Returns: 1
#:Gr#
Returns: 23:00:00#

#:Sr 23:00:00#
Returns: 1
#:Gr#
Returns: 23:00:00#

#:Sr-----23:00:00#
Returns: 1
#:Gr#
Returns: 100:00:00#

#:Srasdfasf#
Returns: 1
#:Gr#
Returns: 100:00:00#

#:Sr#
Returns: 1
#:Gr#
Returns: 100:00:00#

I was not able to provoke the return value 0 (invalid).

I have not checked the :Sd command yet.

p.s.: By chance I had found this:
https://bugs.launchpad.net/stellarium/+bug/1272960

@gzotti
Copy link
Member Author

gzotti commented Dec 13, 2021

You mean these lower test were with some serial terminal (putty?), without Stellarium? Interesting. I'd just have needed an LX200. Thank you for sharing this protocol. It seems even bogus values do "something", successfully, and only not setting anything (electrical problem, or failure in reading back any value?) would return 0? Then we should also test for result 100, and do something with it. (Ignore&retry?)

It seems this documentation bug (* vs. °) on Meade's side has confused several people... If one space more or less is harmless, we shall keep one space. But please test whether anything is still broken. We should finally have a fix for this family.

@alex-w
Copy link
Member

alex-w commented Dec 21, 2021

@toweosp any news?

@alex-w alex-w closed this as completed Dec 23, 2021
Plugin: Telescope Control automation moved this from In progress to Done Dec 23, 2021
@toweosp
Copy link

toweosp commented Dec 23, 2021

@alex-w @gzotti As written in my last post the control of the telescope - especially detection of the DEC position - is working now. This was tested by controlling my telescope with stellarium in a "dry run" in my cellar doing a blind initial alignment of the telescope.

The additional checks regarding the :Sr command where done using a serial terminal program. I wasn't able to do more real life testing so far due to bad weather - this is a sure sign that everything is working now ;-)

@gzotti
Copy link
Member Author

gzotti commented Dec 23, 2021

Thank you for testing these things. We hope this is finally done and circumstances documented now.

@alex-w alex-w removed the state: fixed The bug has been fixed label Dec 25, 2021
@github-actions
Copy link

Hello @gzotti! Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

@giuse320
Copy link

giuse320 commented Jan 6, 2022

'*' = char ASCII 42

@gzotti
Copy link
Member Author

gzotti commented Jan 6, 2022

@giuse320 what do you want to say with this comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something likely wrong in the code
Projects
Development

No branches or pull requests

4 participants