×

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: 322
  • Thank you received: 31
Yes, I am using ESP8266 Board Manager version 2.4.2, and it works.

Espressif, the company that makes the ESP8266 and ESP32, does not have a good track record for stability on newer versions. They always introduce problems. The classic case of good hardware but inferior software.
2 years 4 months ago #77996

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

  • Posts: 161
  • Thank you received: 39
> So yes, buffer clearing is a good idea, but how long would one wait? SWS has a default of 200 ms timeout, plus the time a command takes on OnStep. It varies. Maybe 250 ms minimum timeout is safe? I don't know.

For network (CONNECTION_TCP) specifically, It's (like everything should be) detected on startup. I've got it set to 2 seconds, otherwise 100ms if wired. Messages in the INFO log (ie displayed for users) should be:

* Network based connection, detection timeouts set to 2 seconds
* Non-Network based connection, detection timeouts set to 0.1 seconds

As of the latest version, which I don't think I uploaded to github quite yet, run about 9 hours, I see 29 times the buffer gets flushed, actually just checked a bit later, and it's now 32, with 33 events indicating a read error of some type. So at least with my network that's about 3-4 an hour. Sometimes in batches, sometimes, alone.


One example (flushIO error type = 0 indicates it read something, -4 indicates it timed out (this is expected if we have no data for it to clear. In playing around I increased it to 10ms) In this :GX95# is correct and you see the 2 second timeout on the RES to GX96, which it then returns from in ReadScopeStatus so things like the focusers don't get checked. You see the next :GU# get called. (I have a really low polling interval, 50 ms, which is why it might look like it goes immediately to :GU#.)

"
[2021-11-25T03:30:24.163 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[SCOPE] CMD <:GX95#> "
[2021-11-25T03:30:24.163 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] flushIO "
[2021-11-25T03:30:24.173 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] flushIO: error_type = -4 "
[2021-11-25T03:30:24.182 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[SCOPE] RES <0> "
[2021-11-25T03:30:24.182 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[SCOPE] CMD <:GX96#> "
[2021-11-25T03:30:24.182 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] flushIO "
[2021-11-25T03:30:24.192 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] flushIO: error_type = -4 "
[2021-11-25T03:30:26.194 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[SCOPE] RES <> "
[2021-11-25T03:30:26.195 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] Error -4 "
[2021-11-25T03:30:26.196 CST INFO ][ org.kde.kstars.indi] - LX200 OnStep : "[ERROR] Communication error on Preferred Pier Side (:GX96#), this update aborted, will try again... "
[2021-11-25T03:30:26.196 CST DEBG ][ org.kde.kstars.ekos.mount] - Mount status changed from "Idle" to "Error"
[2021-11-25T03:30:26.245 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] flushIO "
[2021-11-25T03:30:26.245 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] flushIO: error_type = 0 "
[2021-11-25T03:30:26.245 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[SCOPE] CMD <:GU#> "
[2021-11-25T03:30:26.245 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] flushIO "
[2021-11-25T03:30:26.255 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[DEBUG] flushIO: error_type = -4 "
[2021-11-25T03:30:26.263 CST DEBG ][ org.kde.kstars.indi] - LX200 OnStep : "[SCOPE] RES <nNp/EW057> "

One thing I don't like and I may change the behavior of is that returning false from the function sets the state to ERROR. Which per docs is technically correct. However, practically isn't entirely correct. Yes, communication error, but with the bounds checking in there now, and bailing, I'm not sure I'd say that the telescope is in an error state, and I worry about things bailing out. I may also change the Communication errors from LOG_ERROR to LOG_WARN (Still would show up for users). Anyone's thoughts on either of those changes?

Actually a quick check in KStars, I'm going to change that, because there are a couple of places it bails out if that changes that it won't restart jobs. (Slewing is one, I'm not completely sure about it's effect on imaging.)
Last edit: 2 years 4 months ago by james_lan. Reason: Clarify expected error/timeout on flushIO log part
2 years 4 months ago #78014

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

  • Posts: 161
  • Thank you received: 39
For reference as well: My esp8266 is at 2.7.1 and I haven't noticed esp8266 problems with it for OnStep or other projects. I think that's what all mine were built with. (That version is because I haven't bothered to upgrade or downgrade when I last installed it.)

Though I mostly haven't tested with a rotator, except simulated via USB.
2 years 4 months ago #78015

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

  • Posts: 452
  • Thank you received: 71
James,
Sorry I have some translation problems.
After 10 minutes of reading and google translation ending in total nonsense.
I more or less understand the rest but when it comes to "bail out" I have not idea what it could mean.
Any other wording for that?

Sorry
2 years 4 months ago #78019

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

  • Posts: 65
  • Thank you received: 4
Looks like bailed out is used to describe leaving.

To bail out of a plane with a parachute you are leaving the plane.
2 years 4 months ago #78023

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

  • Posts: 161
  • Thank you received: 39
Sorry for the confusion!

To best explain my use of it, would be to return, escape, abort or stop (almost always early/generally before it's done/prematurely)

I'll note to try to avoid it in the future, because searching google I can understand your confusion! Several I didn't even think of, as a native speaker. Hopefully my explanation being a bit verbose above didn't confuse you or anyone else.
The following user(s) said Thank You: Alain Zwingelstein
2 years 4 months ago #78024

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

  • Posts: 161
  • Thank you received: 39
So in multiple day+ long tests, I see plenty of network timeouts, but 0 crashes, even while accessing it with multiple things. About 6-ish per hour at 2 second timeouts on my network.

I did go ahead and change to LOG_WARN and to return true to ReadScopeStatus. (Focusers/Rotators and such are still LOG_ERROR) so the scope doesn't go into error status.

Unless anyone sees a problem I'll see about a PR to main tonight.

NOTE: The logs will have a combination of INFO/WARN/ERROR. I mostly kept the wording the same, but I'm not sure I like it: This update aborted, will retry...  (Kept the same for easy find/replace.)
Mount will not change state due to the LOG_ERRORs. (To prevent stopping captures, sequeneces, etc.)
Mount will not disconnect.


TODO (related or discovered due to this):
Convert the Focusers & such that are in functions other than ReadScopeStatus to others.
One issue is that the scope doesn't register as disconnect when on the network, I believe this is the case with the existing network code as well. (But you were more likely to have a crash than notice that.)
LX200 adjustable timeout. This is a bit trickier than I thought needing to touch a lot more things, so I'm going to make it separately. (This is IMO better than just OnStep, and will get all the LX200 functions we use, plus it should benefit anyone using a network adapter for an lx200, TeenAstro or others.)
Alain's investigations into the rotator differences on SWS vs direct.
Park: I'm not sure I'm understanding the process right (I don't use it normally), but when I set a position it's now slewing to it.

Question: Should I raise the network timeout from 2 sec to 3 sec or higher?

I see little reason to not keep the serial at 0.1 sec, I don't see errors with it, even on the slowest platform we have. There is one edge case: serial to wifi or bluetooth to serial might be slower, but only if it's setup as a serial port, as opposed to accessing the serial port over a network. I don't have a bluetooth serial module to test right now. (and I've had horrible luck with them.) That should be resolved with the adjustable timeout patch later on.
2 years 4 months ago #78128

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

  • Posts: 452
  • Thank you received: 71
James,
No issue with the PR.
2 years 4 months ago #78132

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

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

Thanks for looking into this in more detail, and finally solving the crashes.

Just to be clear, does the PR include only the different timeouts for network vs. serial?
Or does it also include checking the presence of the devices we know will cause timeouts if they a not there (specifically the return of :FA (focuser1), :fA (focuser2), and :GX98 (rotator)?

If the PR does not include those, then I really think these should be included.
2 years 4 months ago #78143

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

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

I am testing your latest PR and so far do not notice any issue.
I am running it on two OnStep configuration:
- Without any Focuser / Rotator
- With a Focuser
Even the strange jump when Parking / Unparking is not there anymore.
I will leave those running some time but it looks like you fixed it.

Thanks you very much for your work
The following user(s) said Thank You: james_lan
2 years 3 months ago #78312

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

  • Posts: 161
  • Thank you received: 39
The PR included that difference in timeouts, as well as a bunch of verification so that if there's a timeout it will warn, and abort the update.

It will probe and detect focusers and rotators, as has always been done. (Which on serial should amount to the 0.1 sec timeout, or 2 sec on network.) So yes, those will cause timeouts on startup.

I did add a little gating based on version to something with rotators. Up to V3 lacks the commands. rI rM rT and has no equivilent (at least in the current version and prior versions I looked at.) That and checking for OnStepX focusers (when version is OnStepX or unknown) are the only gating like that. As for the most part the commands are pretty consistent across versions.
2 years 3 months ago #78348

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

  • Posts: 452
  • Thank you received: 71
@James,
till no issues after one night running of two instances of OnStep on Kstars.

How did you set-up your testing environment?
I am using QTCreator to run OnStep in Debug mode, not allways easy on a single screen machine but helps a lot.
2 years 3 months ago #78353

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

Time to create page: 1.184 seconds