indi icon indicating copy to clipboard operation
indi copied to clipboard

Driver "indi_lacerta_fmc_focus" (!) (for Firmware version 3.1): relative positioning inward causes out of range position

Open timpeKH opened this issue 2 years ago • 8 comments

When the driver "indi_lacerta_fmc_focus" (indilib1 2.0.0) runs on a remote server and a client connects to it from another machine via network, then a relative positioning command in inward direction ("focus in") causes a command (according to log: DEBUG 232.861839 sec : CMD [: M -1 #]). This command is ignored by the device itself and interestingly the Lacerta MFOC hand control panel is not affected. But the absolute position within the INDI control panel gets wrong (4294967295 is 0xFFFFFFFF is -1). This yields an inability to command any other position unless the "sync" command is used to correct the wrong absolute position.

It is probably relevant to note that this issue does not occur when the device is connected locally and the device driver is run as a local service.

It is further of interest to note that the root cause of this bug is probably also responsible for another bug for another driver. Pls. see also https://github.com/indilib/indi/issues/1834 for the driver "indi_lacerta_mfoc_focus". As opposed to this bug the driver "indi_lacerta_mfoc_focus" seems to crash completely due to the negative number in the position command. Further the firmware of the latter driver is not capable to re-connect until the hardware hand control panel was switched off and on again.

To Reproduce

  1. Run driver "indi_lacerta_fmc_focus" on a remote server (e.g. Astroberry or Rasbberry/Ubuntu server running an indiserver)
  2. Connect from a local client to the remote indiserver via KStars -> Tools -> Device -> Device Manager -> Client => external indiserver
  3. Open INDI Contorl Panel
  4. Enter relative position command as in the following screenshot (e.g. 500 steps or any other sensible number without making the hardware running into motion limits): Step_01_Screenshot_2023-02-05_16-59-36
  5. The result should look as on the following screenshot - note the absolute position (!): Step_02_Screenshot_2023-02-05_16-57-55

Expected behavior Correct inward position movement of focuser device

Desktop (please complete the following information):

  • Host running indiserver process: Raspberry Pi4, 8GB, Ubuntu Server 22.04 LTS arm64, indilib1 2.0.0
  • Client: Tuxedo Laptop XUbuntu 22.04 LTS amd64 with KStars Build 2023-01-31T10:34:48Z

Although there is not much to see I attach a log file. Please note the line "DEBUG 63.338030 sec : CMD [: M -1 #]" which seems to be the consequence of the relative positioning command inward . RPI4_Server_indi_lacerta_mfoc_fmc_focus_16-45-04.log

timpeKH avatar Feb 05 '23 18:02 timpeKH

@chkettu Can you please take a look? was this introduced in #1826 ?

knro avatar Feb 06 '23 04:02 knro

Yes, I'll take a look - but can't compile/test until end of february (due to a stay in a health rehabilitation clinic).

What I can say is, that it looks like an old issue (copied from the former mfoc driver). But yes, has to be (and will be) fixed. ;)

chkettu avatar Feb 06 '23 13:02 chkettu

@chkettu: take all the time you need - your health is more important. This is a hobby instrument and I really appreciate if you have look when you're doing well again! Although I did not compile the indi libraries by myself so far (used the convenient Ubuntu packages) I am willing to assist with testing if this can be of any help. I could also learn how to compile the libs from source if needed.

timpeKH avatar Feb 11 '23 21:02 timpeKH

merge request opened - should be fixed with next release!

chkettu avatar May 07 '23 16:05 chkettu

@chkettu: Thanks for looking into this issue. I tested it. The previous behaviour has stopped. But the relative positioning does not work correctly yet: The "Direction" button in the INDI Control Panel is not recognized correctly. When moving in direction "Focus In", the focuser moves endless in "Focus Out" direction. The number of steps is ignored and the motion ends in the hard stops where the stepper motor then hangs. This behaviour is repeatable. The relative positioning works correctly only in "Focus Out" direction.

timpeKH avatar Jun 04 '23 21:06 timpeKH

P.S.: I tested with the release from 31. may 2023.

timpeKH avatar Jun 04 '23 21:06 timpeKH

I'm going to check with latest release.

chkettu avatar Jun 05 '23 06:06 chkettu

I recently purchased a Lacerta MFOC with firmware 3.1.01 and found a similar behavior. When attempting to make a relative position change in the "Focus In" direction, the hand controller will refuse and alert that the desired position is above the maximum value (actually it should be decreased when moving "in"). I had a look at the driver code and found a problematic line which is responsible for the calculation of the new position. I was able to write a fix, I can now correctly move in and out with relative changes. For more details see #1924.

singraber avatar Aug 21 '23 21:08 singraber

This issue has been inactive for 60 days and is being marked as stale.

github-actions[bot] avatar Mar 30 '24 01:03 github-actions[bot]

This issue has been closed due to inactivity.

github-actions[bot] avatar Apr 06 '24 02:04 github-actions[bot]