Ascom MyfocuserPro2 freezing NINA

Issue #959 resolved
Dave Wilkes created an issue

focuser randomly freezes NINA completly

I had tested it indoors for various movements but when I tried to get an auto focus it will sometimes take 3 or 4 images and start to build a graph then will stop and NINA is unresposive. Only way to get anywhere is to stop NINA using task manager

I have 2 of these focusers and it happens on both

Comments (17)

  1. Dave Wilkes reporter

    also looked another log and there are sveral mentions of E:\Projects\nina\NINA.Core\Utility\CoreUtil.cs:line 118 the end bits change on each line

    I dont have an E:\ and never have!

  2. Stefan B repo owner

    Hi,

    looking at your logs it seems like your log level is set to ERROR only. I recommend to set it to INFO instead.

    However you can already see two errors inside:
    CheckDotNetExceptions ASCOM.myFocuser2ASCOM1.Focuser Position Get System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.

    those are driver issues and need to be adressed by the driver vendor

  3. Stefan B repo owner

    Additionally the E:\ drive is nothing on your side, but rather the source code file during compile time - which is on my E drive.

  4. Stefan B repo owner

    Finally to add to this check out the details for the Exception: https://docs.microsoft.com/en-us/dotnet/api/system.threading.abandonedmutexexception?view=net-5.0

    ”An abandoned mutex indicates a serious programming error. When a thread exits without releasing the mutex, the data structures protected by the mutex might not be in a consistent state. Prior to version 2.0 of the .NET Framework, such problems were hard to discover because no exception was thrown if a wait completed as the result of an abandoned mutex. For more information, see the Mutex class.”

  5. Dave Wilkes reporter
    • changed status to open

    unfortunastley this isn’t resolved so I have raised it with the developer of the driver. His initial comment was that it was NINA’s Mutex that was the issue but he is looking at the logs

  6. Stefan B repo owner

    That is a weird claim when the stack trace clearly shows the exception to be inside the focuser driver. Furthermore NINA doesn’t use a Mutex anywhere. The only place where a Mutex is used is inside the Synchronization Plugin, but that won’t ever affact the location in the stack trace and you would have to need it installed anyways.

  7. Stefan B repo owner

    Can you post the complete error? This sounds like something from the driver that is just passed through.

  8. Dave Wilkes reporter

    below after moving to position 20000

    ----------------NINA - Nighttime Imaging 'N' Astronomy----------------

    -------------------Running NINA Version 1.11.0.1176-------------------
    -------------------------2021-10-31T11:23:53--------------------------
    ---------------------.NET Version 4.0.30319.42000---------------------
    ---------------------Oparating System Information---------------------
    ---------------------------Is 64bit OS True---------------------------
    ------------------------Is 64bit Process True-------------------------
    ---------------------------Platform Win32NT---------------------------
    --------------Version Microsoft Windows NT 10.0.19043.0---------------
    ---------------------------Major 10 Minor 0---------------------------
    ----------------------------Service Pack -----------------------------

    DATE|LEVEL|SOURCE|MEMBER|LINE|MESSAGE
    2021-10-31T11:23:54.6192|INFO|CameraChooserVM.cs|GetEquipment|62|Found 0 ASI Cameras
    2021-10-31T11:23:54.7286|INFO|CameraChooserVM.cs|GetEquipment|77|Found 0 Altair Cameras
    2021-10-31T11:23:55.1817|INFO|CameraChooserVM.cs|GetEquipment|89|Found 0 Atik Cameras
    2021-10-31T11:23:55.2442|INFO|CameraChooserVM.cs|GetEquipment|103|Found 0 FLI Cameras
    2021-10-31T11:23:56.3379|INFO|CameraChooserVM.cs|GetEquipment|123|Found 0 QHYCCD Cameras
    2021-10-31T11:23:56.5098|INFO|CameraChooserVM.cs|GetEquipment|141|Found 0 ToupTek Cameras
    2021-10-31T11:23:56.5881|INFO|CameraChooserVM.cs|GetEquipment|153|Found 0 Omegon Cameras
    2021-10-31T11:23:56.8223|INFO|CameraChooserVM.cs|GetEquipment|165|Found 0 RisingCam Cameras
    2021-10-31T11:23:56.9005|INFO|CameraChooserVM.cs|GetEquipment|177|Found 0 MallinCam Cameras
    2021-10-31T11:23:56.9318|INFO|CameraChooserVM.cs|GetEquipment|190|Found 0 SVBony Cameras
    2021-10-31T11:23:56.9318|INFO|CameraChooserVM.cs|GetEquipment|200|Found 0 SBIG Cameras
    2021-10-31T11:23:56.9629|INFO|CameraChooserVM.cs|GetEquipment|223|Found 0 Canon Cameras
    2021-10-31T11:23:57.9005|INFO|PluginLoader.cs|LoadPlugin|307|Successfully loaded plugin Connector version 1.0.2.0
    2021-10-31T11:23:57.9786|INFO|PluginLoader.cs|LoadPlugin|307|Successfully loaded plugin Darks Customs version 1.2.1.0
    2021-10-31T11:23:58.0098|INFO|ApplicationVM.cs|CheckASCOMPlatformVersion|68|ASCOM Platform 6.5 installed
    2021-10-31T11:23:58.6819|INFO|PluginLoader.cs|LoadPlugin|307|Successfully loaded plugin Ground Station version 1.7.5.0
    2021-10-31T11:23:59.5879|INFO|PluginLoader.cs|LoadPlugin|307|Successfully loaded plugin Hocus Focus version 1.11.0.4
    2021-10-31T11:24:00.3223|INFO|Dockable3DViewVM.cs|LoadModel|410|Attempting to load telescope model Default
    2021-10-31T11:24:00.3852|INFO|Dockable3DViewVM.cs|LoadModel|425|Telescope model Default loaded
    2021-10-31T11:24:00.4163|INFO|PluginLoader.cs|LoadPlugin|307|Successfully loaded plugin Scope 3D View version 1.1.3.0
    2021-10-31T11:24:00.5098|INFO|PluginLoader.cs|LoadPlugin|307|Successfully loaded plugin Three Point Polar Alignment version 1.5.0.0
    2021-10-31T11:24:00.5411|INFO|PluginFetcher.cs|RequestAll|41|Fetching plugin manifests from https://nighttime-imaging.eu/wp-json/nina/v1/plugins/manifest
    2021-10-31T11:24:01.3067|INFO|PluginFetcher.cs|RequestAll|56|Found 33 valid plugins at https://nighttime-imaging.eu/wp-json/nina/v1/plugins/manifest
    2021-10-31T11:25:13.3976|INFO|FocuserVM.cs|ChooseFocuser|289|Successfully connected Focuser. Id: ASCOM.myFocuser2ASCOM.Focuser Name: myFocuserPro2ASCOM Driver Version: 2.8.0
    2021-10-31T11:25:34.0098|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 21250
    2021-10-31T11:25:52.0900|INFO|FocuserMediator.cs|BroadcastUserFocused|52|User Focused notification received - Temperature 18.25
    2021-10-31T11:25:52.4632|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 40000
    2021-10-31T11:29:09.4006|INFO|FocuserMediator.cs|BroadcastUserFocused|52|User Focused notification received - Temperature 18.25
    2021-10-31T11:29:09.5880|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 20000
    2021-10-31T11:34:02.8223|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 21250
    2021-10-31T11:34:17.9789|INFO|FocuserVM.cs|Disconnect|382|Disconnected Focuser
    2021-10-31T11:34:18.1036|INFO|AscomDevice.cs|Disconnect|219|Disconnecting from ASCOM.myFocuser2ASCOM.Focuser myFocuserPro2ASCOM
    2021-10-31T11:34:28.0391|INFO|FocuserVM.cs|ChooseFocuser|289|Successfully connected Focuser. Id: ASCOM.myFocuser2ASCOM.Focuser Name: myFocuserPro2ASCOM Driver Version: 2.8.0
    2021-10-31T11:34:50.2598|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 20000
    2021-10-31T11:35:02.2129|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 21250
    2021-10-31T11:35:13.9317|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 20000
    2021-10-31T11:36:24.5098|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 18750
    2021-10-31T11:36:38.1192|INFO|FocuserVM.cs|MoveFocuserInternal|197|Moving Focuser to position 20000
    2021-10-31T11:39:53.2945|ERROR|AscomDevice.cs|Serial port Exception|293|An unexpected exception occurred during GET of Focuser.TempComp:
    2021-10-31T11:39:53.4195|INFO|AscomDevice.cs|GetProperty|268|Retrying to GET Focuser.TempComp - Attempt 2 / 3
    2021-10-31T11:42:40.4631|ERROR|AscomDevice.cs|CheckDotNetExceptions ASCOM.myFocuser2ASCOM.Focuser Position Get System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
    at System.Threading.WaitHandle.ThrowAbandonedMutexException()
    at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
    at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)
    at ASCOM.myFocuser2ASCOM.Focuser.get_Position() (See Inner Exception for details)|293|An unexpected exception occurred during GET of Focuser.Position:
    2021-10-31T11:42:40.5725|INFO|AscomDevice.cs|GetProperty|268|Retrying to GET Focuser.Position - Attempt 2 / 3
    2021-10-31T11:43:20.4317|ERROR|AscomDevice.cs|CheckDotNetExceptions ASCOM.myFocuser2ASCOM.Focuser Position Get System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
    at System.Threading.WaitHandle.ThrowAbandonedMutexException()
    at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
    at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)
    at ASCOM.myFocuser2ASCOM.Focuser.get_Position() (See Inner Exception for details)|293|An unexpected exception occurred during GET of Focuser.Position:
    2021-10-31T11:43:20.5414|INFO|AscomDevice.cs|GetProperty|268|Retrying to GET Focuser.Position - Attempt 2 / 3
    2021-10-31T11:45:32.0564|ERROR|AscomDevice.cs|CheckDotNetExceptions ASCOM.myFocuser2ASCOM.Focuser Position Get System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
    at System.Threading.WaitHandle.ThrowAbandonedMutexException()
    at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
    at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)
    at ASCOM.myFocuser2ASCOM.Focuser.get_Position() (See Inner Exception for details)|293|An unexpected exception occurred during GET of Focuser.Position:
    2021-10-31T11:45:32.1658|INFO|AscomDevice.cs|GetProperty|268|Retrying to GET Focuser.Position - Attempt 2 / 3
    2021-10-31T11:46:13.6260|ERROR|AscomDevice.cs|CheckDotNetExceptions ASCOM.myFocuser2ASCOM.Focuser Position Get System.Threading.AbandonedMutexException: The wait completed due to an abandoned mutex.
    at System.Threading.WaitHandle.ThrowAbandonedMutexException()
    at System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)
    at System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext)
    at ASCOM.myFocuser2ASCOM.Focuser.get_Position() (See Inner Exception for details)|293|An unexpected exception occurred during GET of Focuser.Position:
    2021-10-31T11:46:13.7354|INFO|AscomDevice.cs|GetProperty|268|Retrying to GET Focuser.Position - Attempt 2 / 3

  9. Dale Ghent

    Again, this is an exception that is being thrown by the myFocuser2 driver. NINA’s ASCOM client framework is merely relaying it and logging the fact that it occurred.

    Dave, these issues are quite clearly contained within the driver. We cannot fix these; that code is outside NINA’s purview. There is nothing for us to debug or fix here.

  10. Stefan B repo owner

    That is an error coming from the driver itself after calling the getter for Focuser.TempCom.

    For me this looks like you have som serial port communication failures which lead to the issues and to the abandoned mutexes inside the driver.

  11. Dave Wilkes reporter

    Thank you Stefan I am in the middle here and just passing info onto Robert Brown he has not seen this issue before and uses NINA himself. he has enabled a higher level of logging on the driver and i will send your comments onto him.

    thanks for your input

  12. Dave Wilkes reporter

    Two issues, resolved one and work around other The dll for the Ascom driver was not being updated/overwritten so no matter what changes were made to the driver it had no influence on the main issue. once the dll had been deleted and a new version installed the origonal issue has now been resolved. thanks for your patience and input

  13. Log in to comment