Software - ASCOM Telescope Driver/On-Step Firmware

The current stable OnStep ASCOM driver, version 2.0.6, is available to download here.
The prior stable OnStep ASCOM driver, version 1.50, is available to download here.
Revision history is at the bottom of this webpage.
The ASCOM Platform should be installed before my driver.

The OnStep firmware is available to download from GitHub here I recommend using the latest release branch, which is version 2.22 currently. The master branch is less well tested, but if you want to try the latest features it's the way to go.

The WiFi and Ethernet add-ons' firmware, which provide a Web Server and IP command channel that work with OnStep, are in the ~/addons directory of OnStep.

The ASCOM telescope dialog:

Here's a summary of the features/command set currently implemented for the On-Step controller:
Return values generally indicate failure (0) or success (1).
Command length is limited to 20 chars, 2 for the command frame ":#" + 2 for the code "CC" + a maximum of 16 for the parameter "P": ":CCPPP...#". Cr/lf chars can be sent along with your command, but are ignored.

Date/time commands
Set date :SCMM/DD/YY#Reply: 0 or 1
Get date :GC# Reply: MM/DD/YY#
Set time (Local) :SLHH:MM:SS#Reply: 0 or 1
Get time (Local, 12hr format):Ga#Reply: HH:MM:SS#
Get time (Local, 24hr format):GL#Reply: HH:MM:SS#
Set time (Sidereal) :SSHH:MM:SS#Reply: 0 or 1
Get time (Sidereal) :GS# Reply: HH:MM:SS#

Site/Location commands
Set UTC Offset(for current site):SGsHH# Reply: 0 or 1
Get UTC Offset(for current site):GG# Reply: sHH#
The UTC Offset value is the number of hours to add to your Local Time (Standard Time) to get Universal Time.
Set Latitude (for current site):StsDD*MM# Reply: 0 or 1
Get Latitude (for current site):Gt# Reply: sDD*MM#
Set Longitude (for current site):SgDDD*MM# Reply: 0 or 1
Get Longitude (for current site):Gg# Reply: DDD*MM#
Set site 0 name :SMsss...# Reply: 0 or 1
Set site 1 name :SNsss...# Reply: 0 or 1
Set site 2 name :SOsss...# Reply: 0 or 1
Set site 3 name :SPsss...# Reply: 0 or 1
Get site 0 name :GM# Reply: sss...#
Get site 1 name :GN# Reply: sss...#
Get site 2 name :GO# Reply: sss...#
Get site 3 name :GP# Reply: sss...#
Select site n (0-3) :Wn# Reply: [none]

Slewing/Movement commands
Set target RA :SrHH:MM:SS# * Reply: 0 or 1
Get target RA :Gr# Reply: HH:MM:SS# *
Set target Dec :SdsDD:MM:SS# *Reply: 0 or 1
Get target Dec :Gd# Reply: sDD*MM'SS# *
Set target Azm :SzDDD:MM:SS# *Reply: 0 or 1
Set target Alt :SasDD:MM:SS# *Reply: 0 or 1
Get telescope RA :GR# Reply: HH:MM:SS# *
Get telescope Dec :GD# Reply: sDD*MM'SS# *
Get telescope Azm :GZ# Reply: DDD*MM'SS# *
Get telescope Alt :GA# Reply: sDD*MM'SS# *
* = Defaults to high precision mode, in low precision mode "HH:MM.M", "sDD*MM", or "DDD*MM" are used as appropriate.
Set horizon limit :ShsDD# Reply: 0 or 1
Get horizon limit :GhsDD# Reply: sDD#
Set overhead limit :SoDD# Reply: 0 or 1
Get overhead limit :GoDD# Reply: sDD#
The horizon limit sets how far below (or above) the horizon the telescope will point for a goto:
Valid range (in degrees) is +30 to -30.
The overhead limit helps keep the telescope tube from hitting the tripod etc. during a goto:
Valid range (in degrees) is 60 to 90.
Move telescope (to current Equ target):MS#Reply: e *2
Move telescope (to current Hor target):MA#Reply: e *2
*2 = Error codes for the MS and MA commands are as follows:
e=0 (no error), e=1 (below horizon), e=2 (no object), e=4 (position unreachable), e=5 (not aligned), e=6 (outside limits)
Stop telescope :Q# Reply: [none]
Move telescope east (at current rate) :Me#Reply: [none]
Move telescope west (at current rate) :Mw#Reply: [none]
Move telescope north (at current rate):Mn#Reply: [none]
Move telescope south (at current rate):Ms#Reply: [none]
Stop moving east :Qe# Reply: [none]
Stop moving west :Qw# Reply: [none]
Stop moving north :Qn# Reply: [none]
Stop moving south :Qs# Reply: [none]
Pulse guide (at current rate):
nnnn=time in mS
(from 20 to 16399mS)
:Mgdnnnn# Reply: [none]
Set rate to Guide :RG# Reply: [none]
Set rate to Centering :RC# Reply: [none]
Set rate to Move :RM# Reply: [none]
Set rate to Slew :RS# Reply: [none]
Set rate to n (0-9)*3:Rn# Reply: [none]
*3 = Slew rates are as follows.
All values are in multipules of the sidereal rate:
R0=0.25X, R1=0.5X, R2(RG)=1X, R3=2X, R4(RC)=4X, R5=8X(RM), R6=16X, R7(RS)=24X, R8=40X, R9=60X
(for the -Dev-Alpha branch of OnStep:
R0=0.25X, R1=0.5X, R2(RG)=1X, R3=2X, R4=4X, R5(RC)=8X, R6(RM)=24X, R7=48X, R8(RS)=1/2 MaxRate, R9=MaxRate)
Get distance bars (indicates slew):D#Reply: \0x7F#
Pier side :Gm# Reply: N#, E# or W#

Tracking rate commands
Set sidereal rate RA :STdd.ddddd# Reply: 0 or 1
Get sidereal rate RA :GT# Reply: dd.ddddd#
Track sidereal rate RA (default):TQ# Reply: [none]
Track sidereal rate reset :TR# Reply: [none]
Track rate increase 0.02Hz :T+# Reply: [none]
Track rate decrease 0.02Hz :T-# Reply: [none]
Track solar rate RA :TS# Reply: [none]
Track lunar rate RA :TL# Reply: [none]
Track king rate RA :TK# Reply: [none]
Tracking enable :Te# Reply: 0 or 1
Tracking disable :Td# Reply: 0 or 1
Refraction rate tracking :Tr# Reply: 0 or 1
No refraction rate tracking :Tn# Reply: 0 or 1
Tracking rate adjustment is as follows:
The sidereal rate is default and is always selected on power-up. The T+ and T- commands can adjust any of the rates; however only the sidereal rate, if selected, remembers the adjusted rate through a power cycle.
Refraction rate tracking adjusts the RA rate dynamically to best compensate for refraction in a given region of the sky; again this works for any of the rates. This setting isn't remembered between power cycles, but the OnStep firmware can be compiled so that this setting defaults to enabled.

Sync. command
Sync. with current target RA/Dec:CS#Reply: [none]
Sync. with current target RA/Dec:CM#Reply: N/A#
Note: Sync's that are not allowed fail silently. This can happen due to slews, parking, or exceeded limits.

Library commands
Select catalog no. :Lonn# Reply: 0 or 1
Move Back in catalog :LB# Reply: [none]
Move to Next in catalog :LN# Reply: [none]
Move to catalog item no.:LCnnnn# Reply: [none]
Move to catalog name rec.:L$# Reply: 1
Get catalog item id. :LI# Reply: name,type#
Read catalog item info.
(also moves forward)
:LR# Reply: name,type,RA,Dec#
Write catalog item info.
ssss=name, ttt=type code:
:LWssss,ttt# Reply: 0 or 1
Clear current record :LD# Reply: [none]
Clear current cataLog :LL# Reply: [none]
Clear all catalogs :L!# Reply: [none]
The LI# and LW# commands also set/get target coordinates (as with :Gr#, :Sr#, :Gd#, :Sd#)
Library record storage is in EEPROM. A catalog name record is like any other except the name must start with a '$'. A special search can then be done with the :L$# command to move to that record. It's up to the user to not waste EEPROM with more than one name record per catalog. When the default PEC table size of 824 bytes is used, the first 1024 bytes are devoted to settings. The remaining EEPROM is used for catalog records. Each record is 16 bytes.
It's often best to divide up large Libraries into several smaller catalogs due to serial interface speed limitations.

Anti-backlash commands
Set RA (Azm) backlash amount (in ArcSec) :$BRnnn#Reply: 0 or 1
Set Dec (Alt) backlash amount (in ArcSec):$BDnnn#Reply: 0 or 1

Periodic error correction commands
Turn PEC on :$QZ+# Reply: [none]
Turn PEC off :$QZ-# Reply: [none]
Clear PEC data :$QZZ# Reply: [none]
Start recording PEC :$QZ/# Reply: [none]
Save PEC data/settings to EEPROM:$QZ!#Reply: [none]
Get PEC status returns:
I-Ignore PEC,
P-Playing PEC, p-Getting ready to play PEC,
R-Record PEC, r-Getting ready to record PEC
:$QZ?# Reply: s#
Readout PEC data :VRnnnn# Reply: sddd#
Readout PEC data at current index (while playing/recording),
also returns index
:VR# Reply: sddd,ddd#
Write PEC data :WRnnnn,sddd# Reply: 0 or 1
PEC works as follows:

In-memory values are byte sized integers (corrections) that hold the number of steps to be applied (recorded/played) at a rate of one correction per second. Up to 824 bytes are available for storage (i.e. 824 seconds for a worm rotation). My G11 uses just 240 bytes (360 tooth worm gear, one revolution every 4 minutes).

After the data buffer is cleared ($QZZ), the next record session stores the guiding corrections without averaging. Subsequent recording of the guiding corrections use a 2:1 weighted average favoring the buffer. Data in the buffer is played back one second before the record time in the cycle to help compensate for guiding correction latency.

When reading and writing PEC data the units used are steps.

The save to EEPROM command allows the results to be recovered after a power cycle. This command takes several seconds to complete and should only be issued after you park or home the mount (stop tracking). NOTE: PEC isn't supported in Alt/Azm mode, yet.

Alignment commands
Align, write model to EEPROM:AW# Reply: 0 or 1
Align, one-star*4:A1# Reply: 0 or 1
Align, two-star*4:A2# Reply: 0 or 1
Align, three-star*4:A3# Reply: 0 or 1
Align, accept*4 :A+# Reply: 0 or 1
*4 = The one star alignment is implemented to correct RA/Dec offset. Two star alignment adds a second star to measure/correct for polar axis Altitude misalignment and cone error. Three star alignment adds a third star to measure/correct for polar axis Azimuth misalignment. These are saved when Set park is called and maintained when Parking/Unparking the mount. The sync. equatorial coordinates command refines the model for a local area of the sky, this refinement is lost when the power is cycled unless another Set park is called. The intended use of these commands is as follows...
Call A1. {or A2/A3.}
Set RA/Dec target (for A2/A3 near the Meridian/Celestial Equator, telescope west of the mount, for minimal offset in RA due to being Left/Right of the pole).
Slew to target.
Use move commands to center target.
Call A+. (records offsets, corrects RA/Dec)

Continue for 2 or 3 star:
Set RA/Dec target (near the Meridian/Celestial Equator, telescope east of the mount, for minimal offset in RA due to being Left/Right of the pole).
Slew to target.
Use move commands to center target.
Call A+. (records offset, corrects error in polar altitude and cone error)

Continue for 3 star:
Set RA/Dec target (near 45 deg. Dec. and +6 HA, telescope east of the mount, to isolate/maximize remaining effects).
Slew to target.
Use move commands to center target.
Call A+. (records offset, corrects error in polar azimuth and RA/Dec axis perpendicularity error)

Park commands
Set park position :hQ# Reply: 0 or 1
Move to park position :hP# Reply: 0 or 1
Restore parked telescope to operation:hR#Reply: 0 or 1

Home commands
Set home (CWD) :hF# Reply: [none]
Move to home (CWD) :hC# Reply: [none]

Reticule/Accessory Control
Increase reticule Brightness:B+# Reply: [none]
Decrease reticule Brightness:B-# Reply: [none]

Misc. commands
Set baud rate:
1=56.7K, 2=38.4K, 3=28.8K,
4=19.2K, 5=14.4K, 6=9600,
7=4800, 8=2400, 9=1200
:SBn# Reply: 0 or 1
Precision toggle :U# Reply: [none]
Get firmware date :GVD# Reply: MM DD YY#
Get firmware time :GVT# Reply: HH:MM:SS#
Get firmware number :GVN# Reply: 1.0b4#
Get firmware name :GVP# Reply: On-Step#
Get statUs returns:
N-Not slewing, H-At Home position,
P-Parked, p-Not parked, F-Park Failed,
I-park In progress, R-PEC Recorded
G-Guiding in progress, S-GPS PPS Synced
:GU# Reply: sss#

ASCOM Driver revision history:
v2.0.6 The setup dialog now uses the timeout setting when connecting over IP. The timeout setting default is now set correctly after install. The timeout default is now 3s instead of 2s. v2.0.5 Slight UI improvements. Passes through more exceptions on connect.
v2.0.4 Fixes certain calls to syncToCoordinates() and slewToCoordinates() not setting targetRA/targetDec.
v2.0.3 Added DTR control support and 3 second delay for Mega2560 reset if enabled.
v2.0.2 Changed default timeout to 2 seconds. Changed timeout range and constraints to 1000 to 5000 ms.
v2.0.1 Changed range of meridian limits to +/- 180
v2.0.0 Added :GE# error reporting for failed commands along with numerous minor fixes reqd for the ASCOM conformance checker.

v1.50 Fixes Alt/Az gotos, again.
v1.49 Allows very low rate guides, fixes Alt/Az gotos.
v1.48 Extends backlash range to 3600 arc-sec for OnStep's that support it.
v1.47 Fixes goto rate slider bug.
v1.46 Added support for indicating that OnStep is performing refraction or not.
v1.45 Added support for sub arc-second RA/Dec coordinates.
v1.44 Added support for fractional MaxRate settings.
v1.43 Added support for checksum protocol (partially error correcting) comms.
v1.42 TcpClient.noDelay set to true. Added a thread sleep for 10ms to give data some time to be sent before closing.
v1.41 OnStep connection no-longer shows build date for consistancy across my ASCOM drivers.
v1.40 Fixed tracking rate selection. Added support for MoveAxis(). Switched to ":Q#" command for AbortSlew().
v1.39 Improved data validation in setup dialog.
v1.38 Fixed exception handling code.
v1.37 Added support for new goto error codes. Additional tracking rates should work from within ASCOM (not much support for this in client software though.) Some comms timeout changes in settings dialog.
v1.36 Fix to disable/hide Meridian limits for Alt/Azm mounts.
v1.35 Better exception handling in setup dialog.
v1.34 Added code to allow changing meridian limits (if OnStep supported,) ":hQ#" (set park) command fix.
v1.33 Added code to allow processing :A4# to :A9# commands.
v1.32 Added serial comms code to send empty command to clear OnStep buffer on error.
v1.31 Adds adjustable timeouts and retry for network connections (download here.)
v1.30 Fixes timeouts for network connections.
v1.29 Adds error detection to network connections, adds retry to serial connections.
v1.28 This update just adds a better description to the UTC Offset field to help new users setup correctly.
v1.27 Adds network connection support, adds UTC Offset fractional hour support.
v1.24 Fixes a country/region bug in the set date/time routine.
v1.22 Switches to using ASCOM Profile stores for settings. Applications accessing the driver no-longer need to be run as Administrator. Sky Planetarium, for other reasons, still does need Administrator rights on modern Windows systems though. If using POTH, for example, be sure to run all applications accessing OnStep under the same user (if one is run as Admin. run them all as Admin.) Any settings from prior versions will be lost with this update since the method of storing them has changed.

v1.21 Should fix any locale/country related issues. Adds ability to set MaxRate for goto speed control.

v1.20 Adds the ability to set/get guide rates using ASCOM's GuideRateRightAscension/GuideRateDeclination functions. Also fixes bugs in SiteLatitude and SiteLongitude functions. For use with: OnStep version 1.0b9 or later and Sky Planetarium 3.31 or later.

v1.18 This version should work with both 32 and 64 bit software. Fixes problems with multi-threaded software accessing this ASCOM driver, much more stable than prior versions. Adds support for a minor LX200 protocol change in OnStep 0.99b17 that breaks tracking on/off control, this was implemented in this driver in such a way as to be backward compatible with prior OnStep versions. Latest release now has improved handling of UTC Offset and tool tips to help with manually setting parameters in setup dialog.

Version 1.09 and later supports OnStep version 0.99x11 (and later) protocol changes. It should be backwards compatible with older firmware but the prior version (version 1.07) is still available here if you need it.