×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Driver OnStep (LX200 like) for INDI

  • Posts: 276
  • Thank you received: 52
A while ago there was an update to the lx200 driver to remove some extra space in commands sent.
The offending area may be here
lx200driver.cpp

OLD = snprintf(read_buffer, sizeof(read_buffer), ":SG %+03d#", static_cast<int>;(hours));
// Meade Telescope Serial Command Protocol Revision 2010.10
// :SGsHH.H#
// Set the number of hours added to local time to yield UTC
// Returns:
// 0 – Invalid
// 1 - Valid
NEW = snprintf(read_buffer, sizeof(read_buffer), ":SG%+04.01lf#", hours);

return (setStandardProcedure(fd, read_buffer));
}

The lx200 2010 manual has:
:SGsHH.H# Set the number of hours added to local time to yield UTC Returns: 0 – Invalid 1 - Valid

The Command.ino of OnStep shows this
github.com/hjd1964/OnStep/blob/release-4.24/Command.ino

//  :SG[sHH]# or :SG[sHH:MM]# (where MM is 30 or 45)^M
//            Set the number of hours added to local time to yield UTC^M
//            Return: 0 on failure^M
//  
The following user(s) said Thank You: Alex Varakin
2 years 1 week ago #81504

Please Log in or Create an account to join the conversation.

  • Posts: 174
  • Thank you received: 27
Thank you so much, Gene, for pointers!
Isue is that OnStep is not able to parse the dot as part of the number sent from INDI, e.g.  -5.0
I think the correct fix is to implement override method as part of OnStep driver, as opposed to relying on the method of the generic LX200 driver.
As a quick fix, I worked around the problem by changing Command.ino of OnStep as shown below:

//  :SG[sHH]# or :SG[sHH:MM]# (where MM is 30 or 45)
//            Set the number of hours added to local time to yield UTC
//            Return: 0 on failure
//                    1 on success
      if (command[1] == 'G')  { 
        if (strlen(parameter) < 7) {
          double f=0.0;
          char *temp=strchr(parameter,'.');
          if (temp) {
            if (temp[0] == '.' && temp[1] == '4' && temp[2] == '5') { temp[0]=0; f=0.75; } else
            if (temp[0] == '.' && temp[1] == '3' ) { temp[0]=0; f=0.5; } else 
            if (temp[0] == '.' && temp[1] == '0' ) { temp[0]=0; f=0.0; } else { i=-999; } // force error if not :00 or :30 or :45
          }

 
2 years 1 week ago #81516

Please Log in or Create an account to join the conversation.

An override is the best way to go IMO so that it works with existing firmware.
2 years 1 week ago #81523

Please Log in or Create an account to join the conversation.

  • Posts: 276
  • Thank you received: 52
Alex, glad the info helped!

Jasem, Ok! I closed issue #1643 but did not open one against OnStep for the issue

Gene

BTW: Forum seems to be getting worse, no response yesterday in browser over periods of time and after trying to post this same response earlier today, and post did not make it.
2 years 1 week ago #81524

Please Log in or Create an account to join the conversation.

  • Posts: 452
  • Thank you received: 71
@alex, @gene,

I pushed a fix to github.com/azwing/indi master

Can somebody test before I submit a pull request?
2 years 1 week ago #81533

Please Log in or Create an account to join the conversation.

  • Posts: 276
  • Thank you received: 52
@Alain,
Just a comment

The original lx200driver did not support non whole integer offsets (%03d), this was corrected in the base driver update (%+04.01lf).

The main GIT OnStep Command.ino also supports non whole integer offsets but limits what it will accept to :00, :30 and :45
It requires the exact strings if the ':' is included, e.g. ":00", ":30" and not :0 or :3

Now Meade command set does not cover the :45 offset directly only closely

en.wikipedia.org/wiki/List_of_UTC_time_offsets

What would be chance of adding the :00/:30/:45 capability in the OnStep overrides driver?

Disclaimer: I am not an OnStep user

Observation: Until issue 1604 the indilib community did not seem to suffer from the whole integer only offsets but if you are inside OnStep code :-)

Gene
The following user(s) said Thank You: Alain Zwingelstein
2 years 1 week ago #81548

Please Log in or Create an account to join the conversation.

  • Posts: 452
  • Thank you received: 71
@gene,

it is possible and I checked in Kstars "Settings/Geographic" and effectively there are Countries having offsets of 30' or 45'
At least I learned something today! I didn't remember Nepal having +05:45 or Western Australia +08:45 ... and I visited both countries !!!
Time modifying, doing testing and then push for review!
2 years 1 week ago #81550

Please Log in or Create an account to join the conversation.

  • Posts: 452
  • Thank you received: 71
@gene,

I fixed the UTCOffset so that now hh:00, hh:30 and hh:45 are supported.
I found a strange thing, UTC offset is rouded on 1st decimal so that 0,75 is 0,8 so I had to workaround that.
Not happy with it but it works

Any Idea?

PS: changes on github.com/azwing/indi
Last edit: 2 years 1 week ago by Alain Zwingelstein.
2 years 1 week ago #81556

Please Log in or Create an account to join the conversation.

  • Posts: 174
  • Thank you received: 27
Thank you so much Alain for fixing this!
I will be testing tonight.
2 years 1 week ago #81557

Please Log in or Create an account to join the conversation.

  • Posts: 48
  • Thank you received: 7
Hi.
I have a problem that the internal time of OnStep cannot get by INDI.

Set the location and date and time in OnStep.
(My OnStep uses GPS so it's automatic.)
Then connect OnStep to INDI and look at the INDI Control Panel in Ekos.
UTC is not get correctly.
Is there a solution to the cause of this problem?

OnStep is version 4.24q.
INDI is 1.9.5 running on a Raspberry Pi.
Uses the LX200 OnStep driver.

2 years 1 week ago #81576
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 174
  • Thank you received: 27
I tested it and it works for most scenarios, except negative fraction numbers , like -1.5.
Here is the fix:
utc_min=abs((offset-int(offset))*60);
The following user(s) said Thank You: Alain Zwingelstein
2 years 1 week ago #81578

Please Log in or Create an account to join the conversation.

  • Posts: 452
  • Thank you received: 71
@Alex,

I get old .... I will make the change and issue the pull request.
By the way, any idea where comes the round up of offset (When Offset of location it n,75 Indi considers offset as n,8 ?
Last edit: 2 years 1 week ago by Alain Zwingelstein.
2 years 1 week ago #81588

Please Log in or Create an account to join the conversation.

Time to create page: 1.923 seconds