SC losing connection with focuser

A place to report problems and bugs in SharpCap
Forum rules


If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs

Please also read about Troubleshooting USB Issues before posting.

*** Please do not post license keys - please report any problems with licensing to 'admin' by private message ***

Please include the following details in any bug report:

* Version of SharpCap
* Camera and other hardware being user
* Operating system version
* Contents of the SharpCap log after the problem has occurred.
[If SharpCap crashes, please send the bug report when prompted instead of including the log]
Post Reply
mjcanelson
Posts: 10
Joined: Sat Nov 25, 2023 8:24 pm

SC losing connection with focuser

#1

Post by mjcanelson »

During sequence operation SharpCap has been losing connection to the focuser. This is
a MyFocuserPro2. This is a recent problem and has been happening with both the
2014 and 2022 driver for the CH340 serial chip. I've also had a similar problem with
losing connection to the AM5 mount. I've reinstalled the ASCOM platform and all
ASCOM drivers without any improvement. For the AM5 drops it appears to be an
RPC call error.
Attachments
Log_2024-04-22T17_25_36-13448.log
(645.71 KiB) Downloaded 11 times
User avatar
admin
Site Admin
Posts: 13408
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SC losing connection with focuser

#2

Post by admin »

Hi,

from the log, I can see an error at 02:35:22 where an autofocus scan is about to begin but SharpCap finds that the focuser ASCOM driver is not in the connected state when trying to begin the scan. The previous mention of the focuser at 02:29:39 shows that it was connected at that point. There are basically three ways this could have happened

1) Something triggered the disconnection from the SharpCap side - manually unticking the connected box, or some sequencer step for instance. I don't think this is likely from what I can see in the log

2) Another application also connected to the focuser ASCOM driver triggered the disconnection

3) The ASCOM driver set itself as disconnected - perhaps because of the communications issues you have mentioned. Unfortunately any information about this would be in the ASCOM driver log (if any) - there is nothing in the SharpCap log. I suspect that this is what happened...

I went to have a look to see if I could find the code for the myFP2 ASCOM driver, but although I found the project on SourceForge, I couldn't find the source code page. I remember bumping into this project when I was building an Arduino focuser a year or so back and deciding it looked so 'overgrown' with no clear path to getting it working that I moved on to other arduino implementations (actually I took another one and tweaked it to fit my needs - see https://github.com/rwg0/Arduino-Focuser)

You could try putting a 'focuser connect step' into your sequence before the autofocus run, which would attempt to reconnect to the focuser if the connection has dropped. This may or may not succeed - depending on how broken the connection is...

I don't see anything relating to the AM5 issue in that log, so I guess that occurred in a different session. The 'RPC' error usually indicates that communication between processes or between devices over the network failed, so that would either mean that

* The AM5 ASCOM driver in SharpCap failed to talk to a ZWO mount control process on the PC

of

* The ZWO mount control process (or ASCOM driver if no mount control process) failed to communicate with the AM5 itself.

If you are connecting wirelessly to any device (mount, focuser, etc) and have the option to switch to a wired connection then the wired option will almost always be far more robust.

cheers,

Robin
mjcanelson
Posts: 10
Joined: Sat Nov 25, 2023 8:24 pm

Re: SC losing connection with focuser

#3

Post by mjcanelson »

I've used the MOUNT CONNECT trick to get past the disconnects on the AM5. However, when this
happens on the MYFP2 SC is unable to reconnect. I get either an I/O error or a message about
no access to the device. The only way to get SC reconnected is to disable/enable the driver or
restart SC. Obviously this isn't possible while a sequence is running during the night.

I'll check out the other arduino focuser, but at this point I have MYFP2's on 4-5 telescope here.

Cheers,
Matt
User avatar
admin
Site Admin
Posts: 13408
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SC losing connection with focuser

#4

Post by admin »

Hi Matt,

I saw the IO error entry in the log, but there wasn't any descriptive text to say what had caused it, it was hard to make much useful out of it. It sounds as though perhaps the connection is being lost somehow and then the ASCOM driver is not cleaning up properly when SharpCap disconnects and reconnects, meaning that copy 1 of the ASCOM driver still has the port open and the new copy that SharpCap has created cannot open it.

If I could find the source code to the ASCOM driver I could work out if that was a likely scenario or not.

cheers,

Robin
mjcanelson
Posts: 10
Joined: Sat Nov 25, 2023 8:24 pm

Re: SC losing connection with focuser

#5

Post by mjcanelson »

I haven't been able to find the source code either which is rather odd. The
project is supposed to be open source. Certainly the Arduino part is. I turned
tracing on in the ASCOM driver to get some sort of log. Sadly it isn't terribly
helpful and looks like it blind to what's really happening. I suspect the real
issue is buried in ASCOM somewhere.

I've included the ASCOM log in case it helps
Attachments
ASCOM.myFP2ASCOM.txt
(11.54 KiB) Downloaded 9 times
User avatar
admin
Site Admin
Posts: 13408
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SC losing connection with focuser

#6

Post by admin »

Hi,

interesting that the first error in the ASCOM log is 'A device attached to the system is not functioning.', followed by 'Serial port is not connected'. I suspect that the failure to talk to the arduino is happening at a fairly low level (driver? USB?) to lead to the device not functioning error. The timing of the error in the ASCOM log doesn't match up with a device removed entry in the SharpCap log. I do see what looks like the focuser device being removed and reconnected in the SharpCap log at 03:23:16, but I suspect that might have been you pulling the plug and reconnecting to try to get things working again...

I'm glad I'm not the only one who can't make sense of the Sourceforge repository for the MyFocuserPro2 - it feels like it's in need of a good cleanup (and transferring to Github...). The 'device not functioning' message does rather suggest that the issue is not at the ASCOM driver level though...

cheers,

Robin
User avatar
admin
Site Admin
Posts: 13408
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SC losing connection with focuser

#7

Post by admin »

The lack of source code to the ASCOM drivers intrigued me, so I carried on digging. It appears it is not available...

https://sourceforge.net/p/arduinoascomf ... /79803561/

Of course, you could decompile the ASCOM driver with various tools available to convert .NET DLLs into C# source code. The install of the driver shows a license agreement of the 'Creative Commons - No Derivative Works' kind (https://creativecommons.org/licenses/by-nd/3.0/), which certainly would not prevent decompiling the application to see how it works. I guess the whole thing comes under the 'fauxpen source' category, which is annoying... With commercial software you have some expectation of the vendor fixing bugs as they have taken your money, in open source you can fix them yourself, but with this model you are sadly stuck with limited options :(

cheers,

Robin
mjcanelson
Posts: 10
Joined: Sat Nov 25, 2023 8:24 pm

Re: SC losing connection with focuser

#8

Post by mjcanelson »

Robin,
Thanks for taking the time to look into this. I just built another MYFP2 and will run it for a while
to see if the problem is hardware or software.

Cheers,
Matt
mjcanelson
Posts: 10
Joined: Sat Nov 25, 2023 8:24 pm

Re: SC losing connection with focuser

#9

Post by mjcanelson »

Fixed. Something was broken deep down in Windoze. No surprise. Reinstall didn't fix it, but
reinstall/repair did.
User avatar
admin
Site Admin
Posts: 13408
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: SC losing connection with focuser

#10

Post by admin »

Hi,

good to hear you got it sorted!

cheers,

Robin
Post Reply