×

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: 161
  • Thank you received: 39
Just a FYI with regards to :GX90#, getCommandSingleCharResponse will break that call since it returns a function call based on a double return, not an integer. It's a bug with the current. Tried to make a pull request for Howard, but messed up somehow with github's stuff so I just sent it to the list.

I've got it called with the (new) getCommandSingleCharErrorOrLongResponse which has a short timeout (200ms), and if for some reason it isn't working, I've got it falling back based on :GU# which may not be correct if a custom rate has been entered.

And FINALLY, I think I have everything where status gets set. I just had to override/replace/catch so many things, so I may have missed them. Last one I think was manually doing EQUATORIAL_EOD_COORD which was getting set to IPS_BUSY (aka goto) when called in (base) Telescope. Which I think finally kills the issue of KStars/Ekos detecting the end of a slew. (I hope anyway.) I added some things to kstars as debug/try to fix, so double checking with a clean copy that those aren't the only reason it works. (None of it was triggering those changes.)

I got so used to the Blur-Beep, with the default sounds (slew started/sync. That my mind is now expecting it while testing out the alignment. LOL, It happened right as I was considering if to post this, or wait, expecting things to go bad. Fortunately, The cause wasn't OnStep though, Ekos initiated a Meridian flip which caused the dreaded (by me at least) "Slew detected..." message.

I haven't tested all versions again, but so far it seems good, so I'm declaring victory for tonight.
2 years 5 months ago #76391

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

  • Posts: 161
  • Thank you received: 39
After checking with V3, V4, V5 & OnStepX (aka V10) everything seems to work well, and I've started a pull request for it to main.

(github's diffs seem broken so especially if looking at the TrackState & similar code, I'd highly suggest just looking at the file instead of diffs.)

The KStars/Ekos Align issue is solved and hopefully any others where a Slew is detected as ending immediately, as I finally found one place that EqNP was set that I missed somehow. (Shouldn't have, but finally.)

kstars/logs$ cat 2021-10-05/* | grep -c "Slew det"
90
kstars/logs$ cat 2021-10-06/* | grep -c "Slew det"
2

This is mostly the result of the align module (testing various versions, ~20 for each version tested), the two that happened today were both Meridian Flips triggered by Ekos. This is with 300+ Slews/Gotos in each day's tests. (Full is: "Slew detected, suspend solving...")

I'll let people know when it's accepted, then please try to break it before INDI 1.9.3.

Also OnStepX has the :GX90# fixed in git.
The following user(s) said Thank You: Alain Zwingelstein
2 years 5 months ago #76398

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

  • Posts: 161
  • Thank you received: 39
The pull request has been merged, and it looks like the PPA for nightly is updated. Please let me know if there are any issues! (I see one person with bluetooth issues in another thread, but I suspect that's unrelated (and the changes likely won't affect it.))
2 years 5 months ago #76462

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

  • Posts: 452
  • Thank you received: 71
Hi James,

I have a strange behavior with OnStep.
1) Site Management Tab
2) Set a Site name
3)When selecting another Site Onstep Crashes

I am trying to debug but found nothing so far
Any idea?

kstars 3.5.6 Beta
INDI Library: 1.9.3
Code v1.9.2-21-g2ea67102f. Protocol 1.7.
OnStep 4.24.k
Last edit: 2 years 5 months ago by Alain Zwingelstein.
2 years 5 months ago #76688

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

  • Posts: 161
  • Thank you received: 39
Sorry for not replying, this was getting annoying to track down. It's not directly an OnStep issue, but seems to be a more general LX200telescope one.

There are 2 ways to fix it.

First a description of the problem:
It's these two lines in lx200telescope.cpp @about 684:
IText *tp = IUFindText(&SiteNameTP, names[0]);
IUSaveText(tp, texts[0]); IDSetText(&SiteNameTP, "Site name updated");

It will then crash when these lines are called about 870, actually on the IDSetSwitch(&SiteNameTP, nullptr) when it tries to send it out, but the reason is:
if (isSimulation())
IUSaveText(&SiteNameTP.tp[0], "Sample Site");
else {
getSiteName(PortFD, SiteNameTP.tp[0].text, currentSiteNum);

Now, The reason it crashes is that IUSaveText will reallocate the string length to strlen()+1 (for null) It's originally allocated as (about 1225):
SiteNameT[0].text = new char[64];

IUSaveText does this (literally the only line function):
tp->text = strcpy(realloc(tp->text, strlen(newtext) + 1), newtext);

So as long as the getSiteName method of calling the pointer directly (SiteNameTP.tp[0].text) is used, and no IUSaveText is, it's good. When it's used as the getSiteName, (Changing sites) it has a shortened string, and dies when trying to send the XML out. Which is why it only dies only after a change of site, and fetches the changed to site's name.

First fix is to avoid reallocation in the set function :
strncpy(SiteNameTP.tp[0].text,texts[0],64);
IDSetText(&SiteNameTP, "Site name updated");


The Second is to modify the getSiteName to also use IUSaveText:
if (isSimulation())
IUSaveText(&SiteNameTP.tp[0], "Sample Site"); //Update this as well? Under sim, it doesn't seem to crash.
else {
//getSiteName(PortFD, SiteNameTP.tp[0].text, currentSiteNum); //Original Call
char temp_site_name[64] = {0};
getSiteName(PortFD, temp_site_name, currentSiteNum);
IText *tp = IUFindText(&SiteNameTP, "Name"); //Should change the line ( IUFillText(&SiteNameT[0], "Name", "", "");) so it's not just 'Name'?
IUSaveText(tp, temp_site_name);
}

@knro, Any preference on which way is more proper/better for INDI? It looks like lx200pulsar2.cpp uses the getSiteName method and if the 2nd solution is chosen it would need to be updated as well. I'm inclined to use the first solution, as it's simpler, and there seem to be a few
The following user(s) said Thank You: Alain Zwingelstein
Last edit: 2 years 5 months ago by james_lan. Reason: Stupid formatting!
2 years 5 months ago #76974

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

I pushed a fix to this, please test from Git.
The following user(s) said Thank You: Alain Zwingelstein
2 years 4 months ago #77074

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

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

I checked the fix but still have kstars crash when clicking on the "Set" button for Site Names (in the Site Management Panel)
2 years 4 months ago #77080

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

I can't reproduce the crash here (with LX200 Autostar simulator) when setting the site name. Are you sure you compiled from latest GIT and installed?
2 years 4 months ago #77090

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

  • Posts: 452
  • Thank you received: 71
In fact it is true, with the simulator there is no bug!
An yes, I installed and compiled the latest git source.
I tested with LX200_Classic, LX200_Basic, LX200_OnStep in real situation (controller attached)
Last edit: 2 years 4 months ago by Alain Zwingelstein.
2 years 4 months ago #77092

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

  • Posts: 65
  • Thank you received: 4
Hi Jasem, i installed Indi server on my Raspberry Pi via APT.

My question is when is the APT repository updated? At the same time has the github repository?

I would prefer to stick to apt update/upgrades if i could.

Thanks,
Chad
2 years 4 months ago #77096

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

  • Posts: 161
  • Thank you received: 39
Simulator just assigns it, so never calls IUUpateText

Each call to getSiteName needs to be changed. I have added a pull request which should fix all the remaining locations.

github.com/indilib/indi/pull/1550

And because I suck at git branches, you can check directly from github.com/james-lan/indi
The following user(s) said Thank You: Alain Zwingelstein
Last edit: 2 years 4 months ago by james_lan. Reason: added links
2 years 4 months ago #77101

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

  • Posts: 452
  • Thank you received: 71
@Jame, @Jasem,

I just built the last git and it works fine.
I tested with Onstep and with all lx200 variants (Classic ...)
The following user(s) said Thank You: james_lan
2 years 4 months ago #77140

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

Time to create page: 1.004 seconds