ASCOM Device Hub throws NullReferenceException

Dual Motor Focus Controller (DMFC)
Post Reply
Andreas
Posts: 3
Joined: Fri Nov 26, 2021 7:35 pm

ASCOM Device Hub throws NullReferenceException

Post by Andreas »

Dear Pegasus Astro Team,

I purchased and received a Dual Motor Focus with a Motor Focus Kit v2. Installing the FTDI driver (CDM21228_Setup.zip) and Focus Focus Controller 4.4.5 software so far works really fine. I can connect to the Dual Motor Focus and move the motor. Focus Controller shows me Model DMFC v3.5 and Firmware 4.0
I installed the ASCOM Pegasus Focus Driver v2.16 and I tried with ASCOM Platform 6.5 SP1 and 6.5 SP2 RC. In both versions I can choose ASCOM.PegasusAstro.Focuser in the setup, but when I push the Connect Focuser Button a Focuser Connector Error Window occurs with the message

Code: Select all

CheckDotNetExceptions ASCOM.PegasusAstro.Focuser Connected Get System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei ASCOM.PegasusAstro.Focuser.get_Connected() (See Inner Exception for details)
This happens regardless when I select AUTO or PA5VAGLA (COM3) as the Device ID in the properties of the driver setup.

Can you please give me a hint, how I can solve this?
Thank you for your kind support.

As additional information I attach trace of ASCOM.PegasusAstro as appendix 1 and ASCOM.DriverAccess as appendix 2.
And strangely the additional ASCOM tool Conformance Checker can run the motor, but shows two errors, which might not have to do with the issue but I attach as appendix 3.

Appendix 1 ASCOM.PegasusAstro trace

Code: Select all

20:49:03.857 Focuser                   Starting initialisation
20:49:03.909 Focuser                   Completed initialisation
20:49:03.915 InterfaceVersion Get      2
20:49:03.916 Connected Get             False
Appendix 2 ASCOM.DriverAccess trace

Code: Select all

20:49:03.847 AscomDriver               Successfully created TraceLogger
20:49:03.847 AscomDriver               Device ProgID: ASCOM.PegasusAstro.Focuser
20:49:03.847 AscomDriver               Device type: Focuser
20:49:03.848 ProgID                    ASCOM.PegasusAstro.Focuser
20:49:03.853 IsComObject               False
20:49:03.909 GetInterfaces             Found interface: ASCOM.DeviceInterface.IFocuserV2, ASCOM.DeviceInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=565de7938946fba7
20:49:03.915                           
20:49:03.915 InterfaceVersion Get      GET InterfaceVersion - .NET
20:49:03.915 InterfaceVersion Get        2
20:49:03.915 Connected Get             Issuing Connected command
20:49:03.915                           
20:49:03.915 Connected Get             GET Connected - .NET
20:49:03.927 TargetInvocationException Get System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei ASCOM.PegasusAstro.Focuser.get_Connected()
   --- Ende der internen Ausnahmestapel[FC]berwachung ---
   bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   bei System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
   bei System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   bei ASCOM.DriverAccess.MemberFactory.CallMember(Int32 memberCode, String memberName, Type[] parameterTypes, Object[] parms) in C:\ASCOM Build\Export\ASCOM.DriverAccess\MemberFactory.cs:Zeile 220.
20:49:03.938 Connected Get               Throwing Default DriverException: 'CheckDotNetExceptions ASCOM.PegasusAstro.Focuser Connected Get System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei ASCOM.PegasusAstro.Focuser.get_Connected() (See Inner Exception for details)'
20:49:03.944 Dispose .NET              This is a .NET object, attempting to call its Dispose method
20:49:03.944 Dispose .NET                Got Dispose Method Info, Calling Dispose
20:49:03.949 Dispose .NET                Successfully called Dispose method
Appendix 3 Conformance Checker

Code: Select all

Start-up ASCOM Device Conformance Checker - Version 6.5.7933.18877 - 64bit mode
Start-up ASCOM Platform 6.5 SP1 6.5.1.3234
 
 
CheckForUpdates Checking for Conform updates with 10 second timeout
18:34:19.639 CheckForUpdates                   INFO     This version of Conform is:           6.5.7933.18877
18:34:19.755 CheckForUpdates                   ERROR    WebException: Die Verbindung mit dem Remoteserver kann nicht hergestellt werden.
 
 
ConformanceCheck ASCOM Device Conformance Checker Version 6.5.7933.18877, Build time: 20.09.2021 11:29:18
ConformanceCheck Running on: ASCOM Platform 6.5 SP1 6.5.1.3234
 
ConformanceCheck Driver ProgID: ASCOM.PegasusAstro.Focuser
 
Error handling 
Error number for "Not Implemented" is: 80040400
Error number for "Invalid Value 1" is: 80040404
Error number for "Value Not Set 1" is: 80040402
Error number for "Value Not Set 2" is: 80040403
Error messages will not be interpreted to infer state.
 
18:34:29.429 Driver Access Checks              OK       
18:34:30.187 AccessChecks                      OK       Successfully created driver using late binding
18:34:30.455 AccessChecks                      OK       Successfully connected using late binding
18:34:30.478 AccessChecks                      INFO     The driver is a .NET object
18:34:30.484 AccessChecks                      INFO     The AssemblyQualifiedName is: ASCOM.PegasusAstro.Focuser, ASCOM.PegasusAstro.Focuser, Version=6.16.7981.24
18:34:30.491 AccessChecks                      INFO     The driver implements interface: ASCOM.DeviceInterface.IFocuserV2
18:34:31.234 AccessChecks                      INFO     Device does not expose IFocuser interface
18:34:31.454 AccessChecks                      INFO     Device exposes IFocuserV2 interface
18:34:31.676 AccessChecks                      INFO     Device does not expose IFocuserV3 interface
18:34:31.795 AccessChecks                      OK       Successfully created driver using driver access toolkit
18:34:31.912 AccessChecks                      OK       Successfully connected using driver access toolkit
18:34:32.046 AccessChecks                      OK       Successfully disconnected using driver access toolkit
 
Conform is using ASCOM.DriverAccess.Focuser to get a Focuser object
18:34:32.207 ConformanceCheck                  OK       Driver instance created successfully
18:34:32.382 ConformanceCheck                  OK       Connected OK
 
Common Driver Methods 
18:34:32.464 InterfaceVersion                  OK       2
18:34:32.509 Connected                         OK       True
18:34:32.543 Description                       OK       Pegasus Astro Focus Controller
18:34:32.579 DriverInfo                        OK       Driver for Pegasus Astro FocusCube, Prodigy MF and DMFC
18:34:32.613 DriverVersion                     OK       2.16
18:34:32.649 Name                              OK       Pegasus Astro Focus Controller
18:34:32.684 CommandString                     INFO     Conform cannot test the CommandString method
18:34:32.695 CommandBlind                      INFO     Conform cannot test the CommandBlind method
18:34:32.706 CommandBool                       INFO     Conform cannot test the CommandBool method
18:34:32.716 Action                            INFO     Conform cannot test the Action method
18:34:32.728 SupportedActions                  OK       Driver returned an empty action list
 
Properties 
18:34:32.856 Absolute                          OK       True
18:34:32.876 IsMoving                          OK       False
18:34:32.884 MaxStep                           OK       999999
18:34:32.893 MaxIncrement                      OK       999999
18:34:32.909 Position                          OK       42223
18:34:32.918 StepSize                          OK       1
18:34:32.927 TempCompAvailable                 OK       True
18:34:32.936 TempComp Read                     OK       True
18:34:32.946 TempComp Write                    OK       Successfully turned temperature compensation on
18:34:32.954 TempComp Write                    OK       Successfully turned temperature compensation off
18:34:32.974 Temperature                       OK       22
 
Methods 
18:34:33.036 Halt                              OK       Focuser halted OK
18:34:33.084 Move - TempComp False                      Moving to position: 142223
18:38:45.453 Move - TempComp False                      Asynchronous move found
18:38:45.502 Move - TempComp False             OK       Absolute move OK
18:38:45.518 Move - TempComp False             INFO     Returning to original position: 42223
18:42:57.581 Move - TempComp True                       Moving to position: 142223
18:47:10.254 Move - TempComp True                       Asynchronous move found
18:47:10.301 Move - TempComp True              OK       Absolute move OK
18:47:10.312 Move - TempComp True              INFO     Returning to original position: 42223
18:51:22.558 Move - TempComp True              ERROR    TempComp is True but no exception is thrown by the Move Method - See Focuser.TempComp entry in Platform help file
18:51:22.589 Move - To 0                                Moving to position: 0
18:53:10.057 Move - To 0                                Asynchronous move found
18:53:10.105 Move - To 0                       OK       Moved to 0
18:53:10.121 Move - Below 0                             Moving to position: -10
18:53:10.169 Move - Below 0                             Asynchronous move found
18:53:10.201 Move - Below 0                    OK       Moved to 0
18:53:10.217 Move - To MaxStep                          Moving to position: 999999
19:35:05.804 Move - To MaxStep                          Asynchronous move found
19:35:05.853 Move - To MaxStep                 OK       Moved to 999999
19:35:05.885 Move - Above Maxstep                       Moving to position: 1000009
19:35:06.526 Move - Above Maxstep                       Asynchronous move found
19:35:06.590 Move - Above Maxstep              ERROR    Moved to 1000009, 10 steps from MaxStep 
 
Conformance test complete 
 
Your driver had 2 errors, 0 warnings and 0 issues 
mldee
Posts: 2
Joined: Sat Nov 27, 2021 9:27 am

Re: ASCOM Device Hub throws NullReferenceException

Post by mldee »

I am getting exactly the same error, with the same DMFC, and Win 10 v20H2. It is happening on 4 different PC's . I can connect and run the focuser standalone, but when I try to connect to the ASCOM diagnostic, as NINA gives dot net error message and will not connect, I get an "access to port com 3 is denied, etc, etc. ASCOM 6.5SP1, Focus cont 4.5.5, CDM1228
Attachments
Pegasus ASCOM diagnostic.jpg
Pegasus ASCOM diagnostic.jpg (61.77 KiB) Viewed 7373 times
Andreas
Posts: 3
Joined: Fri Nov 26, 2021 7:35 pm

Re: ASCOM Device Hub throws NullReferenceException

Post by Andreas »

Hello mIdee,
thanks for the reply. I immediately tried, what happens on my computer when I run the Device Connection Tester. That strangely works.
PegasusAstro.JPG
PegasusAstro.JPG (60.24 KiB) Viewed 7369 times
To help you, I also can reproduce your screenshot, when I have the Focus Controller running and connected at the same time. So please try to close it or perhaps verify, if COM3 is correct. For example here:
Focus Controller.jpg
Focus Controller.jpg (69.46 KiB) Viewed 7369 times
mldee
Posts: 2
Joined: Sat Nov 27, 2021 9:27 am

Re: ASCOM Device Hub throws NullReferenceException

Post by mldee »

Thank you for your prompt reply. I then started looking at my Ascom Diagnostic again and discovered that if I ran it without running the Pegasus software first, it gave the same good response as your pic! I then tried Nina without running the Pegasus app and Voila! everything worked.
So it turned out that if I had not used the Pegasus app, all would have been well.
The good thing I suppose is that I have managed to update everything to the latest versions during my struggles.
Thanks again for your assistance and suggestions.

Mike
Warwick, Australia
User avatar
Evans
Site Admin
Posts: 504
Joined: Wed Dec 02, 2020 3:06 pm
Contact:

Re: ASCOM Device Hub throws NullReferenceException

Post by Evans »

Hello,
Only one software can connect (access to device) to the device at the same time.
About the current driver, there is a bug in the response of the driver so the next one will have more user friendly error messages.
Andreas
Posts: 3
Joined: Fri Nov 26, 2021 7:35 pm

Re: ASCOM Device Hub throws NullReferenceException

Post by Andreas »

Thank you. With the idea from Mike I downloaded NINA. Also on my computer it is working. Waiting for a clear night now.
Just one note: I didn't mention that I intended to use Sharpcap. But that gave me even more nonsense error messages than ASCOM device hub.
Best regards,
Andreas
Post Reply