×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Issue with Polar Alignment

Looks like this issue is unique to the Astroberry Focuser. At any rate, I added one more condition to prevent that, but the Astroberry Focuser should fix this also at its end. Ideally, once motion is complete, it should change state to OK and send the final value. Instead, it is doing that 3 times in a row, and hence the 3 captures. With the change in 2.9.4, it will only capture 1 time, but will display a warning for each attempted capture beyond that while still in progress.
The following user(s) said Thank You: Helge
5 years 11 months ago #24626

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

  • Posts: 983
  • Thank you received: 375
I will investigate the issue on the Astroberry Focuser side. As far as I remember it reports OK only after it finishes travel to the destination. I will double check this.

BTW. I think I observed the same behaviour in PiFace Focuser driver, but it does not capture 3 times in a row, even though the log contains 3 entries. Since I developed both drivers it might be the case that there are some similarities between them. I will double check this
The following user(s) said Thank You: Helge
5 years 11 months ago #24645

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

  • Posts: 13
  • Thank you received: 4

Replied by Ryan M on topic Issue with Polar Alignment

It seems that I am also experiencing this Windows-only bug where cfitsio returns with status 105/FILE_NOT_CREATED (resulting in the 'Error creating WCS file: "couldn't create the named file"' message in the log). I've spent an hour or two poking around the KStars, Qt, and cfitsio source code to try to determine why this is happening, but nothing has immediately jumped out at me. The error is definitely coming from cfitsio, but as for why, not to mention only on Windows, I'm not really sure. The file path in the log that HelgeMK posted certainly looks valid, and KStars does prepend a ! character to set cfitsio's "clobber" option, so I don't see any reason why it shouldn't be deleting and re-creating the file. Perhaps fits_read_errmsg() would provide more specific information as to where/why this error is being emitted?

My working hypothesis is that the existing temp file created by Qt isn't being removed properly by cfitsio for some reason, since I think that Linux systems will not complain about "creating" a new file if it already exists but is empty, whereas Windows systems will. That's really the only explanation I can come up with for the Windows-specific behavior we are seeing here. I have a somewhat limited ability to look into this right now as I'm at a week-long star party, but I'll try to build KStars from source with the equipment I have with me, so that I can make some tweaks and see if I can figure out a fix.
The following user(s) said Thank You: Jasem Mutlaq
Last edit: 5 years 10 months ago by Ryan M.
5 years 10 months ago #25909

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

  • Posts: 13
  • Thank you received: 4

Replied by Ryan M on topic Issue with Polar Alignment

I did some more investigation tonight, using a different Windows system hooked up to my Raspberry Pi 3B+ INDI server (using the telescope/CCD simulators and remote plate solving to eliminate any extra variables,) and I'm now thoroughly confident I've isolated the root cause. I won't go into the story of how I figured this all out, because it's pretty boring, but it has to do with the behavior of Qt's handling of temp files. There is a relevant bug report here which was marked as invalid due to "security concerns," since apparently introducing strange and overtly misleading platform-specific behavior is A-OK in Qt Land as long as it's marginally "safer" for one person somewhere in the world on at least one occasion.

Anyway, long story short, Qt maintains a chokehold on any temp files it creates, and will absolutely never, under any circumstances, close its file handle until the file is removed or the reference to it destroyed, even if you explicitly call close(). The worst part is that I'm not even joking. This is actually a real thing that somebody thought was a good idea, and then wrote this comment explaining why the method silently refuses to do the one thing that is literally the name of the method, and then returns success anyway. Unbelievable. On Mac/Linux, this doesn't matter, because UNIX-based systems will happily allow two simultaneously-active file handles to point to the same file, but Windows will refuse cfitsio access to the file since Qt still "owns" it, hence the Windows-only nature of the bug.

I suppose you could call remove() on the file rather than close(), but it seems to me like you'd be giving up any benefits that using Qt to manage the file would have offered (such as removing it when the process ends? Does Qt do that?) At that point it seems like it would just be a plain old vanilla temp file, and you might as well just use std::tmpnam() or something like that rather than jumping through the "create a file, then remove it, then create it again" hoops. I'll leave the implementation details to the maintainers, but hopefully with this information you'll be able to get the PA utility working for Windows users in 2.9.7. Cheers!

EDIT: The relevant code in KStars is at the top of Align::processPAHStage().
The following user(s) said Thank You: Jasem Mutlaq
Last edit: 5 years 9 months ago by Ryan M.
5 years 9 months ago #26363

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

Thanks for the detailed report! I push a change that replaces QTemporary file with simply a file with UUID. The changes should be in the Daily binary factory image here:
binary-factory.kde.org/job/KStars_Nightly_win32/

They usually build around 21:00 UTC
The following user(s) said Thank You: Ryan M
5 years 9 months ago #26364

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

  • Posts: 13
  • Thank you received: 4

Replied by Ryan M on topic Issue with Polar Alignment

Awesome! Great response time, by the way. I will run another test tonight using the nightly binary and confirm that the issue is resolved. Thanks a ton!
5 years 9 months ago #26365

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

  • Posts: 13
  • Thank you received: 4

Replied by Ryan M on topic Issue with Polar Alignment

I just tried the polar alignment process again with the nightly build and can confirm that the bug is resolved with today's changes. It now reaches the final "correction vector" screen properly, rather than failing after the third image is taken. Thanks for the fix!

5 years 9 months ago #26379

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

  • Posts: 5
  • Thank you received: 2
Hello, some nights ago I tried ekos PA routine with the same behavior you experienced. Either a failed third attempt with a wcs error or when I did a solve before PA I got the loop in the first image and the mount never slew.
I am compiling myself as I am on a RPi4. Did you solve your issue?
Thanks
4 years 6 months ago #42985

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

Time to create page: 0.840 seconds