×

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

Bi-monthly release with minor bug fixes and improvements

Ekos sends wrong latitude/longitude to mount

  • Posts: 322
  • Thank you received: 31
I am using a Vixen Sky Sensor 2000 PC, with KStars on Ubuntu.

In KStars I set the location as

Longitude: -80 12 00.00
Latitude: 43 34 00.00

When I start INDI from KStars, I see this message:

Site location updated to Latitude: 43:34:00 - Longitude: 279:48:00
And in the hand controller, the coordinates were updated to: -080:11:00 +43:34:00

See how both are different from what I configured in KStars?

Here is the puzzle: even if I tell INDI to NOT update the mount, this still happens, which is wrong.

And it is not INDI that is at fault, it is Ekos/KStars somehow.

Because, when I connect to the mount from a terminal and execute the same commands I see in the log, everything is normal.

And when I start INDI from the command line and connect to it from Cartes du Ciels, everything is normal as well.

I don't see in the log anything that out of the ordinary.


[2018-03-28T16:33:18.478 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] Coordinate format is high precision
. "
[2018-03-28T16:33:18.478 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] <getSiteLatitude> "
[2018-03-28T16:33:18.478 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:Gt#> "
[2018-03-28T16:33:18.481 EDT DEBG ][ org.kde.kstars.indi] - CCD Simulator : "Error: Invalid range for Width (WIDTH). Valid
range is from 1 to 1280. Requested value is 4000 "
[2018-03-28T16:33:18.534 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] RES <+43<EF><BF><BD>34> "
[2018-03-28T16:33:18.534 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] VAL [43,34] "
[2018-03-28T16:33:18.534 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] <getSiteLongitude> "
[2018-03-28T16:33:18.534 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:Gg#> "
[2018-03-28T16:33:18.534 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] RES <080<EF><BF><BD>12> "
[2018-03-28T16:33:18.534 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] VAL [80,12] "
[2018-03-28T16:33:18.534 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[DEBUG] Mount Controller Latitude: 43.5667
Longitude: 279.8 "

So the correct coordinates are reported from the mount to INDI.

But then in the hand controller, it is not 80:12 anymore, it is 80:11.

And in the INDI control panel it reports this:

2018-03-28T20:33:18: [INFO] Site location updated to Latitude: 43:34:00 - Longitude: 279:48:00
5 years 11 months ago #24634

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

  • Posts: 322
  • Thank you received: 31
I think I found the problem.

The Sky Sensor 2000 PC driver calls updateLocation, which writes the coordinates to the mount, even if INDI is set to NOT update the mount.

Moreover, the code in setLongitude should subtract the minutes.

For example +080:11 is 279:49, not 279:33.

So, is getSexComponents() not working well?

Also, the SS2000PC controller ignores the seconds, so no point in sending them ..

Moreover, the setLongitude and setLatitude functions do not log what the command was sent to the mount, nor what the response was.

So in summary two issues:
  • setLongitude() does not convert the longitude correctly (messes up the minutes).
  • When INDI is told not to update the geographic location, it still does so.
Last edit: 5 years 11 months ago by Khalid.
5 years 11 months ago #24635

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

  • Posts: 322
  • Thank you received: 31
I am working on a patch, and once it is tested, I will submit a PR.
5 years 11 months ago #24637

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

Do you know what's the format for longitude in LX200? Is it 0 to +180 WEST, and 0 to -180 EAST? Because in the code (which been used for more than a decade), it sends the longitude as 360 - INDILongitude, which would make it 0 to 360 Westward. INDI longitude is defined as 0 to 360 Eastward. In Meade doc it doesn't explicitly mention this when sending longitude, but upon receiving longitude, it says that EAST longitude are negatives, which enforces the first assumption made above regarding the range.
5 years 11 months ago #24659

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

  • Posts: 322
  • Thank you received: 31
Jasem,

I tested with the code that is in the PR, and it works (for my coordinates)

github.com/indilib/indi/pull/546

Here is what is in the log:

"[SCOPE] RES <+04> "
"[SCOPE] VAL [4] "
"[SCOPE] CMD <:St +043*11:57#> "
"[SCOPE] CMD <:St +043*11:57#> successful. "
"[SCOPE] CMD <:Sg 080*22:29#> "
"[SCOPE] CMD <:Sg 080*22:29#> successful. "

I did not test with a longitude that is east of Greenwich.

Also, this change is specific to Sky Sensor 2000, because it requires a space after the :St and :Sg, unlike the standard LX200.
5 years 11 months ago #24666

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

  • Posts: 322
  • Thank you received: 31
I tested my PR with coordinates for Kuwait City.

Seems to be working properly as far as INDI/KStars are concerned.

2018-03-29T17:18:50: [INFO] Site location updated to Latitude: 29:04:00 - Longitude: 47:58:59

Here is the log output.

[2018-03-29T13:18:50.571 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:GG#> "
[2018-03-29T13:18:50.571 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] RES <+04> "
[2018-03-29T13:18:50.571 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] VAL [4] "
[2018-03-29T13:18:50.571 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:SG -03#> "
[2018-03-29T13:18:50.652 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:SG -03#> successful. "
[2018-03-29T13:18:50.654 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:St +029*04:00#> "
[2018-03-29T13:18:50.694 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:St +029*04:00#> successful. "
[2018-03-29T13:18:50.695 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:Sg -47*58:59#> "
[2018-03-29T13:18:50.746 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:Sg -47*58:59#> successful. "
[2018-03-29T13:18:50.748 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[DEBUG] Configuration successfully saved fo
r GEOGRAPHIC_COORD. "

But when I look in the hand controller, I see the longitude as +46:02:00 (Vixen designates east as positive).

When I use a location west of Greenwich, I get proper operation:

2018-03-29T17:34:23: [INFO] Site location updated to Latitude: 43:34:00 - Longitude: 279:48:00

The hand controller has -080:11:00 (Vixen designates west as negative).

And the logs:

[2018-03-29T13:34:23.427 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:GG#> "
[2018-03-29T13:34:23.427 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] RES <+04> "
[2018-03-29T13:34:23.427 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] VAL [4] "
[2018-03-29T13:34:23.430 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:St +043*34:00#> "
[2018-03-29T13:34:23.479 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:St +043*34:00#> successful. "
[2018-03-29T13:34:23.479 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:Sg 080*11:60#> "
[2018-03-29T13:34:23.569 EDT DEBG ][ org.kde.kstars.indi] - SkySensor2000PC : "[SCOPE] CMD <:Sg 080*11:60#> successful. "

So my code is working for west of Greenwich, but not east of it.

Any modifications you suggest that would make it work for both?
Last edit: 5 years 11 months ago by Khalid.
5 years 11 months ago #24667

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

Is Vixen following LX200 as basis for their implementation? In LX200, it's 360 - longitude, so in your case it would send positive 080*22:29, so it might be that LX200 convention is the correct way. Try to send .. in that case for Kuwait City, it's 360 - 48 = 312:00:00 so it should send this:
<:Sg 312*00:00#>

If you send that, do you have 48 East in the hand controller??
5 years 11 months ago #24668

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

  • Posts: 322
  • Thank you received: 31
I sent this from a terminal:

:Sg 312*00:00#

And the hand controller is +048:00:00.

So it seems correct east of 0.

West of 0, sending this:

:Sg 080*12#

Works, and sets the hand controller to -80:12:00. So, it is straight coordinates, but with a leading zero.

I am now a bit confused. What change to the code will work for both cases?

Remember that the standard LX200 will not work, since SS2K needs a space after the command for both long and lat, and a leading zero for Longitude.
5 years 11 months ago #24670

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

  • Posts: 322
  • Thank you received: 31
Here is a rewrite for the longitude function that seems to work, mostly.

It is off by one minute in some cases.

For example, when I use -80:12:00 in KStars, it sets it to 080*11 (not 12). If I use -80:12:20, then it uses 080*12 correctly. Don't know why.
// This override is needed, because the Sky Sensor 2000 PC requires a space
// between the command its argument, unlike the 'standard' LX200 mounts, which
// does not work on this mount.
int LX200SS2000PC::setSiteLongitude(double Long)
{
    int d, m, s;
    char temp_string[32];
    double longitude;
 
    if (Long < 0)
    {   
        // Long is negative in KStars, so west of Greenwich
        longitude = abs(Long);
    }
    else
    {   
        // Long is positive, so east of Greenwich
        longitude = 360 - Long;
    }
 
    getSexComponents(longitude, &d, &m, &s);
 
    snprintf(temp_string, sizeof(temp_string), ":Sg %03d*%02d#", d, m);
 
    return setStandardProcedure(PortFD, temp_string);
}
5 years 11 months ago #24672

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

Just use LX200 function and add the space, that's it.
5 years 11 months ago #24673

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

  • Posts: 322
  • Thank you received: 31
That does not work.

For 80:12:34 West, that does this:

"[SCOPE] CMD <:Sg 279:47#> "

And hand controller gets +080:13:00 (which is east of Greenwich!)
5 years 11 months ago #24674

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

  • Posts: 322
  • Thank you received: 31
This PR is now updated with the almost working code.

github.com/indilib/indi/pull/546

It is still off by one minute for longitude if I use xx:yy:00. yy will be yy -1. This is what getSexComponents() returns.

Since I enter the minutes and seconds in KStars, this is no longer an issue.
5 years 11 months ago #24676

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

Time to create page: 0.245 seconds