Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ASCOM.Driver/OpenAstroTracker/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ASCOM OpenAstroTracker")]
[assembly: AssemblyDescription("ASCOM multi-interface server for OpenAstroTracker")]
[assembly: AssemblyDescription("ASCOM multi-interface server for OpenAstroTech Mounts")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("OpenAstroTech")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright © 2020-2025, OpenAstroTech")]
[assembly: AssemblyCopyright("Copyright © 2020-2026, OpenAstroTech")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -21,7 +21,7 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("6.6.7.3")]
[assembly: AssemblyFileVersion("6.6.7.3")]
[assembly: AssemblyVersion("6.6.8.0")]
[assembly: AssemblyFileVersion("6.6.8.0")]

[assembly: ComVisibleAttribute(false)]
47 changes: 35 additions & 12 deletions ASCOM.Driver/OpenAstroTracker/README.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
+--------------------------------------------------------------------------+
| |
| OpenAstroTracker ASCOM Driver V6.6.7.3 Pre-Release |
| Published: 23. June 2025 |
| OpenAstroTracker ASCOM Driver V6.6.8.0 Pre-Release |
| Published: 11. March 2026 |
| |
+--------------------------------------------------------------------------+

This is the latest ASCOM driver available for the OAT and OAM. It allows
This is the latest ASCOM driver available for the OAT, OAM and OAE. It allows
various client programs to communicate with the OAT using both standard
LX200 Meade protocol commands, as well as proprietary OAT extensions to
that protocol.
LX200 Meade protocol commands, as well as proprietary OpenAstroTech extensions
to that protocol.

The driver is compatible with ASCOM 6.5 and 7.0.
The driver is compatible with ASCOM 6.5 and 7.x.

The driver also contains controls for the OAT and OAM so that it can be
The driver also contains controls for OpenAstroTech mounts so that they can be
initialized, configured, slewed, unparked, homed, focused and parked
from the driver Properties dialog.

* Tested on MKS Gen L V2.1, Arduino Mega and ESP32. No other variants of
Arduino have been tested, or are officially supported.
* Tested with V1.10.4 firmware.
* Tested with V1.11.0 firmware.
* Tested with V1.13.12 firmware (RECOMMENDED).
* It will probably work with earlier version (down to V1.6.32 and later).


Support
-------
* For any issues or questions arising from the use of this driver, or any
other OAT-related questions or to interact with the OAT community,
please visit our Discord server.
other OpenAstroTech mount-related questions or to interact with the
OpenAstroTech community, please visit our Discord server.


Testing
-------
* 6.6.8.0 Not tested.

* 6.6.7.3 Not tested.

* 6.6.7.2 Conformance Test (2025-Apr-20)
Expand Down Expand Up @@ -75,8 +75,31 @@ So... keep your towel handy and supervise operations.

Release History
---------------
- 6.6.8.0 : Pre-Released 2026-03-10
Cached profile to reduce disk reads
Removed an access mutex that was superfluous since we were already using
lock {} at a lower level
Fixed the :SC# command to return "1"
Fixed sending the :Q# command (did not have trailing #, which probably
caused the spurious NINA exception)
Cached the NovaS31 COM object from ASCOM, instead of instantiating and
tearing it down all the time.
Protected the version against multi-threaded race condition.
Saved the tracking state per axis (probably not needed, but safer).
Optimized SideOfPier calculation to make far fewer calls to the mount
and fixed a numerical wrap issue.
Made the drivers UTCDate return the UTC date from the mount.
Fixed the PollUntilZero function to have a timeout of 60s instead of
waiting for all eternity in case of protocol issue. Also made it poll
every 500ms instead of 1000ms.
Split the exception handling for connection vs. other issue in the
Setup dialog
Fixed a few Index-Out-of-range bugs in the Setup Dialog.
Added checks to :GX# processing to make sure we got a full answer.

- 6.6.7.3 : Pre-Released 2025-06-23
Added support for ASCOM driver to get and set time and date from and to mount.
Added support for ASCOM driver to get and set time and date from and
to mount.

- 6.6.7.2 : Pre-Released 2025-04-20
FindHome and AtHome implemented.
Expand Down
59 changes: 33 additions & 26 deletions ASCOM.Driver/OpenAstroTracker/SharedResources.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// ================
// Shared Resources
// ================
Expand Down Expand Up @@ -66,27 +66,20 @@ public enum LoggingFlags
private static double latitudeDefault = 30;
private static double longitudeDefault = -97;
private static double elevationDefault = 1;
private static Mutex _commandMutex;
private static readonly Mutex _commandMutex;
private static ProfileData _cachedProfile;
private static readonly object _profileLock = new object();

static SharedResources()
{
_commandMutex = new Mutex(false, "CommMutex");
EnsureLogger();
}

//
// Public access to shared resources
//
public static Mutex OATCommandMutex
{
get
{
if (_commandMutex == null)
{
_commandMutex = new Mutex(false, "CommMutex");
}
return _commandMutex;
}
}
public static Mutex OATCommandMutex => _commandMutex;

private static void EnsureLogger()
{
Expand Down Expand Up @@ -116,19 +109,26 @@ private static void EnsureLogger()

public static ProfileData ReadProfile()
{
using (Profile driverProfile = new Profile())
lock (_profileLock)
{
driverProfile.DeviceType = "Telescope";
return new ProfileData
if (_cachedProfile != null)
return _cachedProfile;

using (Profile driverProfile = new Profile())
{
TraceState = Convert.ToBoolean(driverProfile.GetValue(driverID, traceStateProfileName, String.Empty, traceStateDefault)),
TraceFlags = (LoggingFlags)Enum.Parse(typeof(LoggingFlags), driverProfile.GetValue(driverID, traceFlagsProfileName, String.Empty, traceFlagsDefault)),
ComPort = driverProfile.GetValue(driverID, comPortProfileName, string.Empty, comPortDefault),
BaudRate = long.Parse(driverProfile.GetValue(driverID, baudRateProfileName, string.Empty, baudRateDefault)),
Latitude = Convert.ToDouble(driverProfile.GetValue(driverID, latitudeProfileName, string.Empty, latitudeDefault.ToString())),
Longitude = Convert.ToDouble(driverProfile.GetValue(driverID, longitudeProfileName, string.Empty, longitudeDefault.ToString())),
Elevation = Convert.ToDouble(driverProfile.GetValue(driverID, elevationProfileName, string.Empty, elevationDefault.ToString()))
};
driverProfile.DeviceType = "Telescope";
_cachedProfile = new ProfileData
{
TraceState = Convert.ToBoolean(driverProfile.GetValue(driverID, traceStateProfileName, String.Empty, traceStateDefault)),
TraceFlags = (LoggingFlags)Enum.Parse(typeof(LoggingFlags), driverProfile.GetValue(driverID, traceFlagsProfileName, String.Empty, traceFlagsDefault)),
ComPort = driverProfile.GetValue(driverID, comPortProfileName, string.Empty, comPortDefault),
BaudRate = long.Parse(driverProfile.GetValue(driverID, baudRateProfileName, string.Empty, baudRateDefault)),
Latitude = Convert.ToDouble(driverProfile.GetValue(driverID, latitudeProfileName, string.Empty, latitudeDefault.ToString())),
Longitude = Convert.ToDouble(driverProfile.GetValue(driverID, longitudeProfileName, string.Empty, longitudeDefault.ToString())),
Elevation = Convert.ToDouble(driverProfile.GetValue(driverID, elevationProfileName, string.Empty, elevationDefault.ToString()))
};
return _cachedProfile;
}
}
}

Expand All @@ -146,6 +146,11 @@ public static void WriteProfile(ProfileData profile)
driverProfile.WriteValue(driverID, elevationProfileName, profile.Elevation.ToString());
currentLogFlags = profile.TraceFlags;
}
// Update cache after successful write so subsequent ReadProfile calls skip the registry
lock (_profileLock)
{
_cachedProfile = profile;
}
}

#region single serial port connector
Expand Down Expand Up @@ -241,7 +246,9 @@ public static string SendMessage(string message)
case ExpectedAnswer.DoubleHashTerminated:
retVal = SharedSerial.ReceiveTerminated("#");
retVal = retVal.TrimEnd('#');
retVal = SharedSerial.ReceiveTerminated("#");
// Protocol returns two #-terminated strings (e.g. :SC returns "1#Updating Planetary Data#").
// Return the first string (success indicator); read and discard the trailing info string.
SharedSerial.ReceiveTerminated("#");
break;
}

Expand Down Expand Up @@ -349,7 +356,7 @@ public static bool Connected
}
}

get => SharedSerial.Connected;
get { lock (lockObject) { return SharedSerial.Connected; } }
}


Expand Down
Loading