×

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: 332
  • Thank you received: 42
@James
This replaces all TrackSate and covers all cases so far I could test.
Sorry was not able to vreate a pull request against yout Master

getCommandString(PortFD, OSStat, ":GU#"); // :GU# returns a string containg controller status
if (strcmp(OSStat, OldOSStat) != 0) //if status changed
{
// ============= Telescope Status
strcpy(OldOSStat, OSStat);

IUSaveText(&OnstepStat[0], OSStat);
if (strstr(OSStat, "nN"))
{
IUSaveText(&OnstepStat[1], "Idle");
TrackState = SCOPE_IDLE;
}
if (!strstr(OSStat, "N"))
{
IUSaveText(&OnstepStat[1], "Slewing");
TrackState = SCOPE_SLEWING;
}
if (strstr(OSStat, "N") && !strstr(OSStat, "n"))
{
IUSaveText(&OnstepStat[1], "Tracking");
TrackState = SCOPE_TRACKING;
}
if (strstr(OSStat, "I"))
{
TrackState = SCOPE_PARKING;
IUSaveText(&OnstepStat[1], "Parking");
IUSaveText(&OnstepStat[3], "Park in Progress");
}
if (strstr(OSStat, "P"))
{
SetParked(true);
TrackState = SCOPE_PARKED;
IUSaveText(&OnstepStat[1], "Parked");
IUSaveText(&OnstepStat[3], "Parked");
}
if (strstr(OSStat, "F"))
{
SetParked(false);
TrackState=SCOPE_IDLE;
IUSaveText(&OnstepStat[1], "Idle");
IUSaveText(&OnstepStat[3], "Parking Failed");
}

if (strstr(OSStat, "p"))
{
SetParked(false);
if (strstr(OSStat, "nN"))
{
IUSaveText(&OnstepStat[1], "Idle");
TrackState = SCOPE_IDLE;
}
IUSaveText(&OnstepStat[3], "UnParked");
}
1 year 5 months ago #73281

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

  • Posts: 332
  • Thank you received: 42
After testing more, the code works fine but there is still something wrong with Ekos.

When I Park the mount Ekos considers TrackState as Parked which is OK,
but when I unpark Ekos considers TrackState as Idle (despite the fact that the driver says Tracking).
So as James said there is still something to do somewhere ...
When I manually "stop/start" tracking in the control panel things are synced again between driver and Ekos ????
1 year 4 months ago #73300

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

  • Posts: 59
  • Thank you received: 1
I'm testing your repository (github.com/azwing/indi) and i have always the same problem :-(
On Kstars 3.5.4 Stable:

2021-07-07T19:56:01 Shutdown complete.
2021-07-07T19:56:01 Ekos stopped.
2021-07-07T19:56:00 INDI devices disconnected.
2021-07-07T19:55:56 Mount parked.
2021-07-07T19:55:55 Parking mount in progress...
2021-07-07T19:55:54 Cap parked.
2021-07-07T19:55:49 Parking Cap...
2021-07-07T19:55:48 Warming up CCD...
2021-07-07T19:55:48 No jobs left in the scheduler queue.
2021-07-07T19:55:47 Job 'HD 97277' is terminated due to errors.
2021-07-07T19:55:47 Warning: job 'HD 97277' slew failed, marking terminated due to errors.
2021-07-07T19:55:46 Job 'HD 97277' is slewing to target.
2021-07-07T19:55:46 Warning: job 'HD 97277' found not slewing, restarting.
2021-07-07T19:55:45 Job 'HD 97277' is slewing to target.
2021-07-07T19:55:45 Warning: job 'HD 97277' found not slewing, restarting.
2021-07-07T19:55:43 Job 'HD 97277' is slewing to target.
2021-07-07T19:55:41 Cap unparked.
2021-07-07T19:55:36 Unparking cap...
2021-07-07T19:55:35 Mount unparked.
2021-07-07T19:55:30 Scheduler started.
2021-07-07T19:54:39 Scheduler list saved to /home/serge/testflat2.esl


I think, it's a Kstars problem
Status of Indi GU#:
Start:
LX200 OnStep.OnStep Status.Tracking=Parked
Unpark:
LX200 OnStep.OnStep Status.Tracking=Tracking
LX200 OnStep.OnStep Status.Tracking=Slewing
-> Kstars error (Warning: job 'HD 97277' found not slewing, restarting.)

Tested with CCDciel and skychart: Seems to work fine \o/
1 year 4 months ago #73305

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

  • Posts: 332
  • Thank you received: 42
Thank you Serge,

you're right, could be inside Ekos the question is where :-)

Anyhow it is raining frogs here (Alsace) so ... parsing the code is fine ....
1 year 4 months ago #73307

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

  • Posts: 332
  • Thank you received: 42
Serge,

I believe (???) it is fixed in my last commit on github.com/azwing/indi
Simply added the condition is parked then I change to unpark ...
hope it solves your issue
1 year 4 months ago #73310

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

  • Posts: 59
  • Thank you received: 1
New tests :-)
Not good news...

Manual moves:
Restart indi drivers (IndiWebManager)
LX200 OnStep.OnStep Status.Tracking=Parked
Unpark:
LX200 OnStep.OnStep Status.Tracking=Tracking
Goto:
LX200 OnStep.OnStep Status.Tracking=Slewing
End goto:
LX200 OnStep.OnStep Status.Tracking=Tracking
Park:
LX200 OnStep.OnStep Status.Tracking=Parking
The Kstars green flag is ON.
...
Parked:
LX200 OnStep.OnStep Status.Tracking=Parked
Unpark:
LX200 OnStep.OnStep Status.Tracking=Tracking
...
Seems to work.

Sequence Kstars:
2021-07-08T18:21:23 Shutdown complete.
2021-07-08T18:21:23 Ekos stopped.
2021-07-08T18:21:22 INDI devices disconnected.

[NOK the mount is in parking progress, not parked] 2021-07-08T18:21:18 Mount parked.

[OK] 2021-07-08T18:21:17 Parking mount in progress...
2021-07-08T18:21:16 No jobs left in the scheduler queue.
[OK] 2021-07-08T18:21:15 Job 'Mars2' is complete.
2021-07-08T18:21:14 Job 'Mars2' capture is in progress...
[OK] 2021-07-08T18:21:13 Job 'Mars2' slew is complete.
[OK] 2021-07-08T18:20:43 Job 'Mars2' is slewing to target.
[OK] 2021-07-08T18:20:40 Mount unparked.
2021-07-08T18:20:35 Scheduler started.

[OK] Kstars is waiting for the mount is tracking (end of goto).
[NOK] But after the "park" command it consider the mount is already parked :-(
however the Indi driver seems to give the right values...

And i have more and more crash of Kstars 3.5.4 :-( (I think, it's not the indi driver)

Good news anyway It seems to work well with CCDCiel.
I think I will only use CCDciel

Thanks :-)
1 year 4 months ago #73334

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

  • Posts: 155
  • Thank you received: 37
From a glance it seems like it's going to cause extra state changes on certain codes with regard to parking (calling setParked(x) results in a change to either PARKED or IDLE, and a variable IsParked being set (accessible through isParked()) and I think that's changed in the past.

Issues with what you've got:
F shouldn't change TrackState. (Park failed, but the state should be processed via n/N )
p and nN only, if it's pn, it'll produce TRACKING when it should be IDLE (here again state should be processed via n/N)
Not sure why the myTrackState?

That own-goto branch of mine, I didn't handle it right, either, when I looked at your code: (F, I and p should be moved in my code before the n/N/P processing, because of the potential call to setParked(false) in them, which could result in an idle state.) Basically moving up the ==parkdata== / ==end...== section should have fixed that issue. (I have pushed the branch, but not tested it, as I need to get away from the computer for a bit, as I keep looking and running through the same logic and questioning it, so I'm going to stop and come back in a while so I don't break anything too badly.)

Please have a look though: github.com/james-lan/indi/blob/own-goto/...ope/lx200_OnStep.cpp (Note it doesn't include IsNewSwitch() settings which can change it.)

Note the multi unparked in ( indilib.org/forum/development/1406-drive...html?start=660#73262 ) should be resolved in the current version, as each call will set status, but will only correct the internal parked variable when needed. (That I have tested some, and so far I haven't had issues with it.)

Issues/TrackState manipulation remaining with mine:
Scope may get set for a split second to TrackState=SCOPE_IDLE when unparking, but that will be correct shortly thereafter within the function. due to the call to set IsParked
Same with parking (but to the correct TrackState=SCOPE_PARKED) so non issue

One thing that could be done is skip the OSStat == OldOSStat check. That would resolve the sync issue and why when you start/stop tracking it gets corrected. (With the isParked() guards around it shouldn't cause any issues for the correct things to be set with regards to TrackState, not sure about the rest of it.) So we'd need to make sure things don't cause issues like messing with TrackState can, but that I think is probably the best case. But it could mask TrackState and other issues as well.

Alright, I'm off, let me know what you all think. (Apologies, I left this up last night, but aside from me being less tired everything else should be the same.)
1 year 4 months ago #73335

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

  • Posts: 332
  • Thank you received: 42
Hi James,

Yes leaving coding away some time will do good.
Looking all the time at a problem makes us blind :-)

I will have a look on your code.
In the meantime "myTrackState" is removed (was just a testing variable)
I have now a situation where OnStep TrackState is sync with Ekos except for SCOPE_PARKING where Ekos still states Slewing.
But I notice no other strange behavior.
1 year 4 months ago #73338

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

  • Posts: 332
  • Thank you received: 42
Serge,

I experience no crashes with Kstars (I have 3.5.5 Beta, but I had also none with 3.5.4 Stable)
I cannot reproduce the Park issues, it works fine for me but I must agree I do test all manually not in sequencing.
I never tested the Ekos automation so far.
Can you share your scripts?
1 year 4 months ago #73340

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

  • Posts: 59
  • Thank you received: 1
I have removed all Indi drivers (just keep CCD simulator and LX200OnStep) and i have no crashes.
The park problem is only in automated sessions.
My sequence is very simple:
- Unpark mount
- Goto a star
- take one shoot (light, 1s)
- Park the mount

Perhaps for Kstars, "Park"ing and "Park"ed are the sames
1 year 4 months ago #73342

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

  • Posts: 59
  • Thank you received: 1
For me, in the mount tab (Ctrl K, tab mount, i unpark mount, goto a star, the unpark button is grey (mount is really unparked)
If I click on the park button, it instantly turns grey (parked mount) as the mount continues to move to the park point.
I can click on the unpark button while the mount is not yet parked (it is moving to its park position). So the mount stops where it is. and goes into tracking.
Maybe this is the normal operation.
The only problem is that the automatic sequence stops when the mount is not yet parked.

My shelter can send the park order to the mount directly on OnStep (by WiFi).
I can use this solution.
I do not park the mount at the end of the sequence but only the shelter (which will park the mount for him).
Last edit: 1 year 4 months ago by Serge CLAUS.
1 year 4 months ago #73343

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

  • Posts: 332
  • Thank you received: 42
I just started a sequence that makes the following:

Unpark
Track and Focus on a star
take 10 dark
take 10 flat
take 10 pictures
track and focus on another star
take 10 dark
take 10 flat
take 10 pictures
park
shutdown

and seems to work as expected (I use ccd simulator)

Where I am not happy is that Ekos still states Slewing instead of Parking but this is most probably deep in Ekos not Indi so I am a bit dry on that.

Still to test some other things and set-up a debugging ...
time to sleep :-)
1 year 4 months ago #73345

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

Time to create page: 0.967 seconds