×

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: 59
  • Thank you received: 1
Hello,

My PC: mini ITX board Intel 64 bits (J1900) 8GB RAM on Lubuntu 20.04
Kstars and indi drivers: "deb ppa.launchpad.net/mutlaqja/ppa/ubuntu focal main"

OnStep version: 4.24e (on ESP32)
Indi LX200 drivers version: 1.11
INDI Library: 1.9.1 Code 1.9.1-tgz. Protocol 1.7.
indi-bin 1.9.1~202106261417~ubuntu20.04.1 amd64
libindi-data 1.9.1~202106261417~ubuntu20.04.1 all
Kstars: 3.5.3 Stable (kstars-bleeding 6:3.5.3+202105061503~ubuntu20.04.1 amd64)
Last edit: 1 year 4 months ago by Serge CLAUS.
1 year 4 months ago #73231

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

  • Posts: 304
  • Thank you received: 24
Same repositories that I use, but I am on 18.04 still.

deb ppa.launchpad.net/mutlaqja/ppa/ubuntu bionic main

My indi-bin package has this timestamp in it:

indi-bin 1.9.1~202106261410~ubuntu18.04.1

So it was built on 2021-06-26.

I don't know what 1.9.1-tgz is in your case.
1 year 4 months ago #73232

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

  • Posts: 329
  • Thank you received: 42
Hi Khalid,

I forgot the indi version which is:
INDI Library: 1.9.1
Code v1.9.1-10-g9045b593. Protocol 1.7.

I am quite sure the current indi version distributed via ppa suffers this bug.
I made some tests even with TrackState = SCOPE_TRACKING disabled in the OnStep driver.
It must for sure be somewhere in indi or kstars, not in the driver itself ...
Still testing
1 year 4 months ago #73240

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

  • Posts: 304
  • Thank you received: 24
Thanks Alain,

If you want me to test something, let me know what sequence I should do, and what output to look for.

I can test everything except parking and focusers (don't use either).
1 year 4 months ago #73241

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

  • Posts: 155
  • Thank you received: 37
OK, I think I found it, and it's my bad.

For ref:
// [n]ot tracking
// [N]o goto

Trying to simplify things, I'd removed some parking code which also handled the :GU return in one case (not n or N). The own goto should be updated with that (and unrelated PEC, since the command (:QZ#) used no longer works on newer versions, but that should be good now.)

So:
General cases:
!n !N = SLEWING (tracking, goto) < Case I neglected, since it seems like you wouldn't be tracking while on a goto
n !N = SLEWING (not tracking, goto)
     (If also I (Parking n progress) = PARKING)
!n N = TRACKING (tracking, no goto)
n N = IDLE (not tracking, no goto)

Overriden by
P (Parked, also set parked true) PARKED

Related which only give Messages/not change trackstate:
p (sets parked false) (unparked)
F (sets parked false) (parking failed)
I (sets parked false, case handled above) (parking in progress)
H (messages only, combined with p/P)

Someone want to check my logic to make sure I didn't miss anything?
 
1 year 4 months ago #73244

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

  • Posts: 329
  • Thank you received: 42
Hi James,error is there.
It seems strange since this code was not modified a long time but with the highlighted changes it seems to work.

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, "n") && strstr(OSStat, "N"))
{
IUSaveText(&OnstepStat[1], "Idle");
TrackState = SCOPE_IDLE;
}
//if (strstr(OSStat, "n") && !strstr(OSStat, "N"))
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;
}

// ============= Refractoring
if ((strstr(OSStat, "r") || strstr(OSStat, "t"))) //On, either refractory only (r) or full (t)
{
if (strstr(OSStat, "t"))
{
IUSaveText(&OnstepStat[2], "Full Comp");
}
if (strstr(OSStat, "r"))
{
IUSaveText(&OnstepStat[2], "Refractory Comp");
}
if (strstr(OSStat, "s"))
{
IUSaveText(&OnstepStat[8], "Single Axis");
}
else
{
IUSaveText(&OnstepStat[8], "2-Axis");
}
}
else
{

IUSaveText(&OnstepStat[2], "Refractoring Off");
IUSaveText(&OnstepStat[8], "N/A");
}


// ============= Parkstatus
if (strstr(OSStat, "P"))
{
SetParked(true); //defaults to TrackState=SCOPE_PARKED
TrackState = SCOPE_PARKED;
IUSaveText(&OnstepStat[3], "Parked");
}
if (strstr(OSStat, "F"))
{
SetParked(false); // defaults to TrackState=SCOPE_IDLE
TrackState=SCOPE_IDLE;
IUSaveText(&OnstepStat[3], "Parking Failed");
}
if (strstr(OSStat, "I"))
{
SetParked(false); //defaults to TrackState=SCOPE_IDLE but we want
TrackState = SCOPE_PARKING;
IUSaveText(&OnstepStat[3], "Park in Progress");
}
if (strstr(OSStat, "p"))
{
SetParked(false); //defaults to TrackState=SCOPE_IDLE but we want
if (strstr(OSStat, "nN")) // azwing need to detect if unparked idle or tracking
{
IUSaveText(&OnstepStat[1], "Idle");
TrackState = SCOPE_IDLE;
}
else
{
//TrackState = SCOPE_TRACKING;
//IUSaveText(&OnstepStat[1], "Tracking");
}

IUSaveText(&OnstepStat[3], "UnParked");
}
1 year 4 months ago #73245

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

  • Posts: 155
  • Thank you received: 37
Note that is only fixed for the issue reported by Serge CLAUS of the state not being right during a goto from indilib.org/forum/development/1406-drive...html?start=648#73196

It may or may not fix the kstars instant camera issue. (Hopefully?)
1 year 4 months ago #73247

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

  • Posts: 329
  • Thank you received: 42
Not able to test the case with the camera but I believe ti should solve it also.
I was really a missinterpretaion of the Onstep status.
1 year 4 months ago #73248

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

  • Posts: 155
  • Thank you received: 37
Here's what I've got, with everything together to handle the TrackState (unparking handled down below) There aren't any other TrackStates assigned.

if (strstr(OSStat, "P"))
{
SetParked(true); //defaults to TrackState=SCOPE_PARKED
TrackState = SCOPE_PARKED;
IUSaveText(&OnstepStat[3], "Parked");
} else {
if (strstr(OSStat, "n") && strstr(OSStat, "N"))
{
IUSaveText(&OnstepStat[1], "Idle");
TrackState = SCOPE_IDLE;
}
if (strstr(OSStat, "n") && !strstr(OSStat, "N"))
{
if (strstr(OSStat, "I")) {
IUSaveText(&OnstepStat[1], "Parking/Slewing");
TrackState = SCOPE_PARKING;
} else {
IUSaveText(&OnstepStat[1], "Slewing");
TrackState = SCOPE_SLEWING;
}
}
if (strstr(OSStat, "N") && !strstr(OSStat, "n"))
{
IUSaveText(&OnstepStat[1], "Tracking");
TrackState = SCOPE_TRACKING;
}
if (!strstr(OSStat, "N") && !strstr(OSStat, "n"))
{
IUSaveText(&OnstepStat[1], "Slewing");
TrackState = SCOPE_SLEWING;
}
}

That then becomes the only handling the lx200_OnStep driver does, but there are some lower levels:

Going through lx200telescope/lx200generic, and trying to cross reference things, the only place it looks like it sets state that isn't overridden is in the init with a SCOPE_IDLE (which seems fine). (Goto and Park (overriden both set it)).

There are some in inditelescope, but I'm not certain I've found them all.

ISNewSwitch():
TrackStateSP, will change it.
ParkStateSP will change it as well.

As will the call to SetParked/SyncParkStatus (Changes to IDLE or PARK)

TODO: copy/modify to intercept TrackStateSP & ParkStateSP.
TODO: copy/override SetParked/SyncParkStatus

That will move us to a model of purely from-telescope instead of an assumed command state + from-telescope.

Once those are done, That should mean 100% the OnStep driver has control of the Trackstate, with the above from :GU#, and should eliminate the kstars camera issue.
1 year 4 months ago #73250

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

  • Posts: 329
  • Thank you received: 42
James,

searching for TrackState in inditelescope.h the following confirms your code.
enum TelescopeStatus
{
SCOPE_IDLE,
SCOPE_SLEWING,
SCOPE_TRACKING,
SCOPE_PARKING,
SCOPE_PARKED
};

thanks for your work
1 year 4 months ago #73256

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

  • Posts: 59
  • Thank you received: 1
My latest test with the latest driver (github.com/james-lan/indi/tree/own-goto):


New driver:

Start Indi:
LX200 OnStep.OnStep Status.Tracking=
[NOK] No value

Unpark:
LX200 OnStep.OnStep Status.Tracking=Tracking
[OK]

Goto:
LX200 OnStep.OnStep Status.Tracking=Slewing
[OK]

End goto:
LX200 OnStep.OnStep Status.Tracking=Tracking
[OK]

Parking:
LX200 OnStep.OnStep Status.Tracking=Parking/Slewing
[OK ?]

Parked:
LX200 OnStep.OnStep Status.Tracking=Parking/Slewing
[NOK]

Unpark:
LX200 OnStep.OnStep Status.Tracking=Tracking
[OK]

Old driver:
Start Indi:
LX200 OnStep.OnStep Status.Tracking=Idle

Unpark:
LX200 OnStep.OnStep Status.Tracking=Tracking

Goto:
LX200 OnStep.OnStep Status.Tracking=Tracking
[NOK]

End goto:
LX200 OnStep.OnStep Status.Tracking=Tracking

Parking:
LX200 OnStep.OnStep Status.Tracking=Slewing

Parked:
LX200 OnStep.OnStep Status.Tracking=Idle

Séquence Kstars with mount parked:
[NOK]
2021-07-06T10:20:36 Shutdown complete.
2021-07-06T10:20:36 Ekos stopped.
2021-07-06T10:20:35 INDI devices disconnected.
2021-07-06T10:20:31 Mount parked.
2021-07-06T10:20:30 Parking mount in progress...
2021-07-06T10:20:29 Cap parked.
2021-07-06T10:20:24 Parking Cap...
2021-07-06T10:20:23 No jobs left in the scheduler queue.


2021-07-06T10:20:22 Job 'Neptune' is terminated due to errors.
2021-07-06T10:20:22 Warning: job 'Neptune' slew failed, marking terminated due to errors.
2021-07-06T10:20:21 Job 'Neptune' is slewing to target.
2021-07-06T10:20:21 Warning: job 'Neptune' found not slewing, restarting.
2021-07-06T10:20:20 Job 'Neptune' is slewing to target.
2021-07-06T10:20:20 Warning: job 'Neptune' found not slewing, restarting.
2021-07-06T10:20:17 Job 'Neptune' is slewing to target.


2021-07-06T10:20:15 Cap unparked.
2021-07-06T10:20:10 Unparking cap...
2021-07-06T10:20:09 Mount unparked.
2021-07-06T10:20:04 Scheduler started.

Sequence Kstars with mount unparked:
[NOK]
2021-07-06T10:28:02 Shutdown complete.
2021-07-06T10:28:02 Ekos stopped.
2021-07-06T10:28:01 INDI devices disconnected.
2021-07-06T10:27:57 Mount parked.
2021-07-06T10:27:56 Mount unparked.
2021-07-06T10:27:55 Mount unparked.
2021-07-06T10:27:54 Mount unparked.
2021-07-06T10:27:53 Mount unparked.
2021-07-06T10:27:52 Mount unparked.
2021-07-06T10:27:51 Parking mount in progress...
2021-07-06T10:27:50 Cap parked.
2021-07-06T10:27:45 Parking Cap...
2021-07-06T10:27:44 No jobs left in the scheduler queue.
2021-07-06T10:27:43 Job 'Neptune' is terminated due to errors.
2021-07-06T10:27:43 Warning: job 'Neptune' slew failed, marking terminated due to errors.
2021-07-06T10:27:42 Job 'Neptune' is slewing to target.
2021-07-06T10:27:42 Warning: job 'Neptune' found not slewing, restarting.
2021-07-06T10:27:41 Job 'Neptune' is slewing to target.
2021-07-06T10:27:41 Warning: job 'Neptune' found not slewing, restarting.
2021-07-06T10:27:38 Job 'Neptune' is slewing to target.
2021-07-06T10:27:36 Cap unparked.
2021-07-06T10:27:31 Unparking cap...
2021-07-06T10:27:30 Mount already unparked.
2021-07-06T10:27:28 Scheduler started.

Sequence Kstars with old driver and mount parked:
2021-07-06T10:39:17 Shutdown complete.
2021-07-06T10:39:17 Ekos stopped.
2021-07-06T10:39:16 INDI devices disconnected.
2021-07-06T10:39:12 Mount parked.
[NOK] The telescope is on Neptune, not parked

2021-07-06T10:39:11 Parking mount in progress...
2021-07-06T10:39:10 Cap parked.
2021-07-06T10:39:05 Parking Cap...
2021-07-06T10:39:04 No jobs left in the scheduler queue.
2021-07-06T10:39:03 Job 'Neptune' is complete.
2021-07-06T10:39:02 Job 'Neptune' capture is in progress...
[NOK] capture start before the mount is on Neptune

2021-07-06T10:39:02 Job 'Neptune' slew is complete.
2021-07-06T10:39:00 Job 'Neptune' is slewing to target.
2021-07-06T10:38:58 Cap unparked.
2021-07-06T10:38:53 Unparking cap...
2021-07-06T10:38:52 Mount unparked.
2021-07-06T10:38:48 Scheduler started.
Last edit: 1 year 4 months ago by Serge CLAUS.
1 year 4 months ago #73262

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

  • Posts: 329
  • Thank you received: 42
after some thinking (yes it happens) I believe best is to discriminate the sates based on the following return codes:
Status Unambiguous OnStep return Code
Idle nNp
Tracking Np
Slewing p and !N (it is the only one that is ambiguous with Tracking
Parking nI
Parked nNp

I tried it on many scenarios and seems to work fine.
Will do some more tests and return to you with code.
1 year 4 months ago #73270

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

Time to create page: 0.854 seconds