I am using SGP for a six months and I am really satisfied with it, its a nice piece of software. But last week I finaly manage to liven up arduino based JOLO focuser. It works through ASCOM driver and in MaximDL everything works fine.
But I really prefere SGP, so I tried hard to make it working, unfortunately I fail…
Does anyone have a clue what is going on? Is there a hope?
I am able to connect device without problem, but when I try go to some position or coarse the focuser,somethimes it works once or twice, but then nothing happened and connection is lost. Situation is recorded in log file.
There are a lot of errors in the log, all of which are coming from the ASCOM driver. I’d recommend looking into the ASCOM driver if you have the code or getting in touch with the ASCOM maintainer.
Also the version of SGP you’re using is quite old, I’d recommend upgrading.
Thanks for replay.
Sorry about the old version of SGP, now I am updated to newest version, but problem is still here.
I am not a professional code writer, but maybe I found some leads. I installed Serial port monitor and I am watching the communication on COM port which is connected to focuser. Here is what happened when I order to move the focuser in MaximDL:
Public Function CommandString(ByVal Command As String, Optional ByVal Raw As Boolean = False) As String Implements IFocuserV2.CommandString
CheckConnected("CommandString")
Dim commandToSend As String = Command
If Not (Raw) Then
commandToSend = Command + Constants.vbLf
End If
Dim answer As String
SyncLock lockObj
Try
ComPort.Write(commandToSend)
answer = ComPort.ReadTo(Constants.vbLf)
Catch ex As System.TimeoutException
Throw New ASCOM.DriverException("Serial port timeout for command " + Command)
Catch ex As System.InvalidOperationException
Throw New ASCOM.DriverException("Serial port is not opened")
End Try
Return answer.Trim(Constants.vbLf)
End SyncLock
End Function
The SyncLock structure should prevent a second call to CommandString sending a message to the hardware before the first one has finished.
I’d also add a considerable amount of logging to the driver, it makes it far easier to find out what is going on.
Chris
PS this is totally untested, no errors at edit time but that’s it, not even compiled.
Guys, I don’t know what to say…
Thank You so much Chris!
What a day! My third child was born five minutes after midnight and now my almost home made focuser seems to work! Now its time for some beer… a lot of them.
Solution is so simple, I tried to implement mutex in code, but it was too much for me, as usually I took the hammer to kill the mosquito…
Thanks again, I will report how it will work after mechanical assembly.