×

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

Bi-monthly release with minor bug fixes and improvements

Error setting Observer Location from INDI on Celestron Nexstar

  • Posts: 33
  • Thank you received: 3
Hello, I am a newbie to INDI so please treat me gently.


I live at longitude 000:07:24 East, when I try to set my Celestron Nexstar from the Site Management page of the INDI control panel it sets the mount to West. I have found that any setting less than 1 degree sets to west, above this it all works as advertised.

I have looked at the INDI Celestron driver code which appears to be correct, is this a bug in the Celestron firmware or somewhere else

Ken
3 years 4 months ago #63133

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

  • Posts: 33
  • Thank you received: 3
OK so I have found the bug in celestrondriver.cpp, it's in the piece of code that sends the East or West to the Celestron mount (0 for east, 1 for west).

The code tests if the degrees passed to it are > 0 if they are it sends east to the mount, for my location degrees are 0 but minutes and seconds are not so the code should be if degrees are > or = to 0;


bool CelestronDriver::set_location(double longitude, double latitude)
{
LOGF_DEBUG("Setting location (%.3f,%.3f)", longitude, latitude);

// Convert from INDI standard to regular east/west -180 to 180
if (longitude > 180)
longitude -= 360;

int lat_d, lat_m, lat_s;
int long_d, long_m, long_s;
getSexComponents(latitude, &lat_d, &lat_m, &lat_s);
getSexComponents(longitude, &long_d, &long_m, &long_s);

char cmd[9];
cmd[0] = 'W';
cmd[1] = static_cast<char>(abs(lat_d));
cmd[2] = static_cast<char>(lat_m);
cmd[3] = static_cast<char>(lat_s);
cmd[4] = lat_d > 0 ? 0 : 1;
cmd[5] = static_cast<char>(abs(long_d)); // not sure how the conversion from int to char will work for longtitudes > 127
cmd[6] = static_cast<char>(long_m);
cmd[7] = static_cast<char>(long_s);
cmd[8] = long_d > 0 ? 0 : 1; //Error is here as in my case the degrees are 0 and the minutes are not, should be cmd[8] = long_d >= 0 ? 0 : 1;

set_sim_response("#");
return send_command(cmd, 9, response, 1, false, true);
}

How do I report this bug?

Ken
The following user(s) said Thank You: Teseo
3 years 4 months ago #63158

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

  • Posts: 535
  • Thank you received: 109
Ken, you can report bugs with INDI here: github.com/indilib/indi/issues

Jim
3 years 4 months ago #63161

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

  • Posts: 33
  • Thank you received: 3
Thanks Jim, report logged.
3 years 4 months ago #63163

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

  • Posts: 535
  • Thank you received: 109
You are welcome. Also, PRs are welcomed if you feel so inclined.
3 years 4 months ago #63164

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

  • Posts: 33
  • Thank you received: 3
3 years 4 months ago #63165

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

  • Posts: 535
  • Thank you received: 109
PR = Pull Request also known as a Merge Request or MR. If you make changes or fixes to the code and you would like to have the repository management team take a look at the changes for inclusion in the code base, you can submit a PR/MR with the fix. The PR makes it easier for the team to get your fix into place in the code. I mentioned this because you did your own sleuthing in the code and found the problem. You understand the fix, and have proposed a solution. Submitting a PR would entail setting up a development environment for INDI development, forking the repository on github, making the change against your fork, and then creating the PR to have the team review the change. There is a section in the top menu, under "Manufacturers" to assist in setting up an INDI development environment.(which I think I am going to propose we change to "Creators", or something that sounds less industrial).

If you are not comfortable doing this for any reason, a bug report where the sleuthing has been done is the next best thing, so thank you!

Jim
3 years 4 months ago #63166

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

  • Posts: 33
  • Thank you received: 3
Aha, I understand I am not into Github but ought to be I guess so a nice learning experience for me.

Ken
3 years 4 months ago #63175

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

Time to create page: 0.802 seconds