×

INDI Library v1.9.8 Released (29 Sep 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

Driver OnStep (LX200 like) for INDI

  • Posts: 210
  • Thank you received: 44
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
6 months 2 weeks ago #81504

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

  • Posts: 156
  • Thank you received: 22
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
          }

 
6 months 2 weeks 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.
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
6 months 2 weeks ago #81523

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

  • Posts: 210
  • Thank you received: 44
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.
6 months 2 weeks ago #81524

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

  • Posts: 320
  • Thank you received: 41
@alex, @gene,

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

Can somebody test before I submit a pull request?
6 months 2 weeks ago #81533

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

  • Posts: 210
  • Thank you received: 44
@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
6 months 2 weeks ago #81548

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

  • Posts: 320
  • Thank you received: 41
@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!
6 months 2 weeks ago #81550

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

  • Posts: 320
  • Thank you received: 41
@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: 6 months 2 weeks ago by Alain Zwingelstein.
6 months 2 weeks ago #81556

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

  • Posts: 156
  • Thank you received: 22
Thank you so much Alain for fixing this!
I will be testing tonight.
6 months 2 weeks 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.

6 months 2 weeks ago #81576
Attachments:

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

  • Posts: 156
  • Thank you received: 22
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
6 months 2 weeks ago #81578

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

  • Posts: 320
  • Thank you received: 41
@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: 6 months 2 weeks ago by Alain Zwingelstein.
6 months 2 weeks ago #81588

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

Time to create page: 1.277 seconds