I had some free time lately and I decided to start a small side project to solve one of the issue I face sometimes when using kstars, crashing.
To be clear, I don't recall having any crash on my PC (arch) but I get a lot of them on my raspberry pi and most of the time they seem to be random, this has caused me some issues in the past, the most dangerous IMO:
- scope hitting the tripod cause the mount continue tracking after
- sessions interrupted in half
So to the point, what I am providing?
Not much at the moment, for now I am just monitoring kstars every 15s and notify people via telegram if the process stops.
I have some other ideas for the next year like expanding to different notifications type (email, sms), restarting indi and do some recovery actions (parking) and other things that may be needed, but in the meanwhile, if you want to be notified if kstars crashes on your Linux/MacOS/raspberry you can try it
Hi John! If you are thinking of a kernel watchdog, this, in this state is somewhat similar, but with the exception that restarting a service, for kstars, specifically, cannot fully recover from a crash.
My idea is to add a bunch of custom logic to this program with time so it will eventually fit everybody's need, and eventually, one day, being able to restore a sessione to a pre-crash state
It basically handles a shutdown if it loses its heartbeat and can execute a custom script. I think its aimed mainly at performing a clean shutdown in the event of a crash.
In my opinion what what be quite useful would be a script to restart Kstars / Ekos loading the sequence that was executing at the point of failure. The sequence is already smart enough to figure out where it got to and pick up from there. Probably needs some basic logic like try x times then just shutdown and would need to be careful about restarting when constraints have been violated (although the scheduler may handle this already). There may also be things to worry about concerning restarts around things like Meridian Flips.
That is neat! I wasn't aware og such thing. I think by default the watchdog covers what I'd like to implement.
My solution tho, wants to be something that works if any if kstars/indi goes down and as you said, I'd like to have some smart introspection to be able to restart the session from where it left. I think having a dedicated program instead of a bunch of scripts may help with a couple of things