Docs

lx200

A transport-agnostic Go library for the Meade LX200 command protocol family.

lx200  

A transport-agnostic Go library for the Meade LX200 command protocol family: the :CMD#-framed serial and TCP dialect spoken, with vendor extensions, by 10Micron, ZWO AM-series, Rainbow Astro RST, OnStep, and many other telescope mounts.

The library is dependency-light and agnostic about ASCOM and Alpaca. Import it to drive a mount in-process. The Alpaca Telescope wrapper lives in a separate module.

Source: github.com/mikefsq/lx200 , MIT.

import "github.com/mikefsq/lx200/tenmicron"

m, err := tenmicron.Connect("10.0.1.51:3492") // 10Micron over TCP
ra, _ := m.RA()
m.SetTargetRA(12.5)
m.SetTargetDec(45.0)
m.SlewToTarget()

Mounts  

Mount Package Transport Validation
10Micron GM-series tenmicron TCP Against hardware
Rainbow Astro RST-135, RST-300 rst USB-serial Against hardware
ZWO AM3, AM5, AM5N, AM7 am5 USB-serial or WiFi/TCP From the INDI driver and vendor protocol; in progress
OnStep, OnStepX onstep USB-serial or WiFi/TCP From the INDI driver and vendor protocol; in progress

Each per-mount package is an LX200 client: it embeds the core connection and adds only its vendor-specific status, tracking, park, and site commands.

Design  

Framing. Every LX200 reply takes one of four shapes, selected by the primitive called. Blind expects no reply, as with :Q# and :Mn#. Ack reads one byte, 0 or 1, for the :Sr and :Sd set commands. Get reads until # for the :Gx# queries. Slew handles :MS#, where 0 means the slew started and anything else is a #-terminated fault. Commands are serialized and bounded by a read deadline.

Capabilities. Mount is the contract every per-mount type satisfies. Features that not all mounts share are small optional interfaces a consumer type-asserts for, so a driver advertises exactly what the hardware supports. Those cover park and unpark, find-home, side-of-pier, alt/az, pulse-guide, per-axis move, track-rate select, site geometry, and the UTC clock.

Transports. TCP and serial are both supported. A TCP-only build never links the serial library.

bridge  

The bridge package runs the protocol in reverse. It is an LX200 TCP server that answers :CMD# for a star atlas, fronting any lx200.Mount, so Stellarium and SkySafari can drive a mount the library already speaks to. It sits alongside the Alpaca Telescope wrapper as a second consumer of the same mount.

Flashing RST firmware  

rst/boot and cmd/rstflash replace the vendor’s Windows-only firmware downloader, which is Microchip’s stock PIC32UBL (AN1388) host, rebranded. The protocol was reverse-engineered from the vendor tool and is validated on hardware: an RST-135E flashed from firmware 220406 to 260319.

rstflash -check RST-135E_260319.hex   # parse and summarise the file, opens no port
rstflash -info                        # report the bootloader version
rstflash RST-135E_260319.hex          # erase, program, verify, prompts first

The controller enters its bootloader only when powered on with PREV and NEXT held. Nothing in software puts it there.

  Warning

Flashing erases the application firmware before writing. An interrupted flash leaves the mount unbootable until a flash completes; retry with PREV and NEXT held.