<table><tr><td style="">murveit added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D25060">View Revision</a></tr></table><br /><div><div><p>Here are the logs:</p>
<p><a href="https://drive.google.com/file/d/1-4Yzdek2NP9UewZaO8XlYV5d4Pc0d2tZ/view?usp=sharing" class="remarkup-link" target="_blank" rel="noreferrer">https://drive.google.com/file/d/1-4Yzdek2NP9UewZaO8XlYV5d4Pc0d2tZ/view?usp=sharing</a><br />
<a href="https://drive.google.com/file/d/1smQr9hJ9DLj5HdR1eMH9tW01ePD_yPeI/view?usp=sharing" class="remarkup-link" target="_blank" rel="noreferrer">https://drive.google.com/file/d/1smQr9hJ9DLj5HdR1eMH9tW01ePD_yPeI/view?usp=sharing</a></p>
<p>Here's the message:</p>
<p>Sure, here's the email I sent to Rob to start this off.<br />
It should have most of the details, and I'm also attaching the two gzipped logs (KStars and PHD2) from that night and also below you can see my commentary about the logs.<br />
Finally, I was not running the scheduler, and was running with pulse guiding. Auto-star was unchecked, and guiding with PHD2 failed after a meridian flip (because KStars insisted on a particular lock position which was not valid any more).<br />
I was running head of the tree kstars from early last week. The issue results from the set_lock_position messages KStars was sending to PHD2.</p>
<p>Please let me know if there's something else I've forgotten to say,<br />
Thanks,Hy</p>
<hr class="remarkup-hr" />
<p>Rob,<br />
Thanks for getting back to me. I wanted to describe an issue I had (and overcame) related to PHD2 and Ekos this past week.As I understand it, you're the one "in charge" of the KStars/PHD2 interface.<br />
In short, all 5 times this week, my capture session aborted after an automated meridian flips failed late at night, where the reason for aborting was that PHD2 failed to settle after the flip. Upon a closer look at the log, I determined that the real reason it failed was that EKOS was sending PHD2 "set_lock_position" messages changing it's guide star position away from the coordinates on the guide image where it had selected a star, to the coordinates where the guide star used to be, pre meridian flip. (Note--that set_lock_position message is not found in the log before the meridian flip).<br />
Looking at the code, I saw that the "set_lock_position" message was conditioned on not having the "auto star" checkbox set, and sure enough I found that I had "auto star" unchecked in my guide tab. So, I fixed my issue by keeping the "auto star" EKOS checkbox checked, and my flip succeeded last night.<br />
That said, I think the behavior of the system is probably wrong. E.g. Does not having "auto star" checked imply that one cannot do unsupervised meridian flips? Even if that was the case, sending the 'set_lock_position' to PHD2 with the pre-meridian-flip guide star coordinates is never the right thing to do--i.e. the image has inverted, so whatever star was in that position is not there anymore. (Honestly, I wasn't even aware of that checkbox until I saw the reference in the code.)<br />
I'm arguing that the 'auto star' checkbox is confusing, and perhaps should be 'greyed out and not used' when combined with PHD2. One can manually choose a guide star with PHD2's settings/UI if one wants. Having a 2nd control for that in EKOS makes things more complicated, and in this case probably does the wrong thing.<br />
Since I'm sure you understand the code and various scenarios people use much better than I do, I didn't just send you a PR, but rather wanted to talk this through with you to make sure I'm not missing something. However, if you agreed there was an issue, and preferred I send you a change for review, I'd be happy to do it. (I'd also be very happy to have you do it).<br />
Let me know what you think, or if you have any further questions.Hy</p>
<p>In case you' want to see the details, I'm attaching my log where I diagnosed this issue. Note--I was running a branch of the master branch from last week--that code should be basically the head of the tree from around this past Monday, except that is also had a version of the change I just submitted related to fitsviewer and indiccd (see <a href="https://phabricator.kde.org/R321:c72edccbcdd475facd228718d0267b5c8d705ed7" class="remarkup-link" target="_blank" rel="noreferrer">https://phabricator.kde.org/R321:c72edccbcdd475facd228718d0267b5c8d705ed7</a>) which should be unrelated to PHD2 and guiding. There are some extra debug log messages in the log related to the capture of the GUIDE and NORMAL ccd images.<br />
I gzip'd the log files. Here's my commentary about what happened.<br />
Early in the log, PHD2 is running fine, and it's guide star coordinate is around 1207,43[2019-10-25T23:49:51.131 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: request: "{\"id\":27,\"jsonrpc\":\"2.0\",\"method\":\"get_lock_position\"}"<br />
[2019-10-25T23:49:51.208 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: response: "{\"jsonrpc\":\"2.0\",\"result\":[1207.04,43.53],\"id\":27}\r\n"</p>
<p>This repeats many times, varying a little, I suppose because of dithering, and here's the last one before the meridian flip:[2019-10-26T01:42:52.398 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: request: "{\"id\":1783,\"jsonrpc\":\"2.0\",\"method\":\"get_lock_position\"}"<br />
[2019-10-26T01:42:52.438 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: response: "{\"jsonrpc\":\"2.0\",\"result\":[1207.06,41.11],\"id\":1783}\r\n"</p>
<p>The meridian flip starts and guiding is stopped:[2019-10-26T01:47:08.565 PDT INFO ][ org.kde.kstars.ekos.mount] - Meridian flip: slewing to RA= "02h 31m 50s" DEC= " 61° 49' 54\""<br />
[2019-10-26T01:47:08.566 PDT DEBG ][ org.kde.kstars.ekos.mount] - Setting meridian flip status to 4<br />
[2019-10-26T01:47:08.566 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: request: "{\"id\":1786,\"jsonrpc\":\"2.0\",\"method\":\"stop_capture\"}"<br />
[2019-10-26T01:47:08.567 PDT DEBG ][ org.kde.kstars.ekos.mount] - Slewing to RA= "02h 31m 50s" DEC= " 61° 49' 54\""<br />
[2019-10-26T01:47:08.573 PDT DEBG ][ org.kde.kstars.indi] - ISD:Telescope sending coords RA: "02h 31m 50s" ( 2.53077 ) DE: " 61° 49' 54\"" ( 61.8319 )<br />
[2019-10-26T01:47:08.596 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: response: "{\"jsonrpc\":\"2.0\",\"result\":0,\"id\":1786}\r\n"<br />
[2019-10-26T01:47:08.597 PDT INFO ][ org.kde.kstars.ekos.guide] - "Autoguiding aborted."<br />
...[2019-10-26T01:47:10.619 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: event: "{\"Event\":\"GuidingStopped\",\"Timestamp\":1572079630.577,\"Host\":\"raspberrypi\",\"Inst\":1}\r\n"<br />
[2019-10-26T01:47:10.620 PDT INFO ][ org.kde.kstars.ekos.guide] - "PHD2: Guiding Stopped."<br />
[2019-10-26T01:47:10.960 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: event: "{\"Event\":\"LoopingExposuresStopped\",\"Timestamp\":1572079630.960,\"Host\":\"raspberrypi\",\"Inst\":1}\r\n"<br />
[2019-10-26T01:47:10.961 PDT INFO ][ org.kde.kstars.ekos.guide] - "PHD2: Looping Exposures Stopped."</p>
<p>The meridian flip slewing and alignment completes successfully, and EKOS restarts guiding[2019-10-26T01:49:03.067 PDT INFO ][ org.kde.kstars.ekos.align] - "Target is within acceptable range. Astrometric solver is successful."<br />
[2019-10-26T01:49:03.072 PDT INFO ][ org.kde.kstars.ekos.capture] - "Post flip re-alignment completed successfully."<br />
[2019-10-26T01:49:03.077 PDT INFO ][ org.kde.kstars.ekos.capture] - "Performing post flip re-calibration and guiding..."[2019-10-26T01:49:03.083 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: request: "{\"id\":1787,\"jsonrpc\":\"2.0\",\"method\":\"guide\",\"params\":[{\"pixels\":2,\"time\":10,\"timeout\":45},false]}"<br />
[2019-10-26T01:49:03.102 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: event: "{\"Event\":\"LockPositionLost\",\"Timestamp\":1572079743.099,\"Host\":\"raspberrypi\",\"Inst\":1}\r\n"<br />
[2019-10-26T01:49:03.103 PDT INFO ][ org.kde.kstars.ekos.guide] - "PHD2: Lock Position Lost."<br />
[2019-10-26T01:49:03.112 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: response: "{\"jsonrpc\":\"2.0\",\"result\":0,\"id\":1787}\r\n"<br />
[2019-10-26T01:49:03.145 PDT INFO ][ org.kde.kstars.indi] - ZWO CCD ASI1600MM Pro : "[INFO] CCD FOV rotation updated to 5.81971 degrees. "<br />
[2019-10-26T01:49:06.281 PDT DEBG ][ org.kde.kstars.indi] - processBLOB()<br />
[2019-10-26T01:49:06.281 PDT DEBG ][ org.kde.kstars.indi] - processBLOB() mode 2<br />
[2019-10-26T01:49:06.286 PDT INFO ][ org.kde.kstars.fits] - Reading FITS file buffer<br />
[2019-10-26T01:49:06.361 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: event: "{\"Event\":\"LoopingExposures\",\"Timestamp\":1572079746.290,\"Host\":\"raspberrypi\",\"Inst\":1,\"Frame\":1}\r\n"<br />
PHD2 eventually finds a guide star.<br />
[2019-10-26T01:49:06.903 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: event: "{\"Event\":\"LockPositionSet\",\"Timestamp\":1572079746.903,\"Host\":\"raspberrypi\",\"Inst\":1,\"X\":706.572,\"Y\":664.507}\r\n"[2019-10-26T01:49:06.903 PDT INFO ][ org.kde.kstars.ekos.guide] - "PHD2: Lock Position Set."<br />
[2019-10-26T01:49:06.915 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: event: "{\"Event\":\"LoopingExposures\",\"Timestamp\":1572079746.903,\"Host\":\"raspberrypi\",\"Inst\":1,\"Frame\":1}\r\n"<br />
[2019-10-26T01:49:06.916 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: event: "{\"Event\":\"StarSelected\",\"Timestamp\":1572079746.905,\"Host\":\"raspberrypi\",\"Inst\":1,\"X\":706.572,\"Y\":664.507}\r\n"<br />
[2019-10-26T01:49:06.916 PDT INFO ][ org.kde.kstars.ekos.guide] - "PHD2: Star Selected."<br />
Looking at the PHD2 log, we see it was set to 706, 66401:49:06.903 00.000 3019972624 setting lock position to (706.57, 664.51)<br />
...01:49:13.857 00.001 3019972624 Changing from state CALIBRATED to GUIDING<br />
...01:49:13.886 00.000 3019972624 setting lock position to (705.90, 664.56)</p>
<p>But for some reason, EKOS asks PHD2 to change its lock position back to 1207, 41 (about where it was before the flip)[2019-10-26T01:49:17.577 PDT DEBG ][ org.kde.kstars.ekos.guide] - PHD2: request: "{\"id\":1791,\"jsonrpc\":\"2.0\",\"method\":\"set_lock_position\",\"params\":[1207.06005859375,41.11000061035156,false]}"</p>
<p>PHD2 receives this requests and changes it's pre-flip lock position01:49:17.766 00.211 3019972624 evsrv: cli 0x22a5480 request: {"id":1791,"jsonrpc":"2.0","method":"set_lock_position","params":[1207.06,41.11,false]}<br />
01:49:17.766 00.000 3019972624 SetCurrentPosition(1207.06,41.11)</p>
<p>Settling eventually fails and the mission is aborted.[2019-10-26T01:51:08.093 PDT INFO ][ org.kde.kstars.ekos.guide] - "PHD2: Settling failed (Guiding stopped)."<br />
[2019-10-26T01:51:08.095 PDT INFO ][ org.kde.kstars.ekos.guide] - "PHD2: Settling failed, aborted."</p>
<p>it restarts several times after, but always EKOS insists on the lock position from before the flip, and PHD2 always fails there.<br />
I did get guiding running that night, by restarting PHD2 and KStars/EKOS (even though I didn't have the "auto star" checkbox checked).</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R321 KStars</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D25060">https://phabricator.kde.org/D25060</a></div></div><br /><div><strong>To: </strong>lancaster, mutlaqja<br /><strong>Cc: </strong>wreissenberger, murveit, kde-edu, narvaez, apol<br /></div>