Go libraries and tools for ASCOM Alpaca astronomy devices: clients, device servers, simulators, and conformance checks.
Requires Go 1.23 or later. Uses only the standard library and supports Linux, macOS, and Windows.
From a checkout, serve all ten device types on HTTP port 11111:
go run ./cmd/alpacasimConnect your Alpaca application to 127.0.0.1:11111, or use its discovery
feature. Each device type has device number 0. Open
http://127.0.0.1:11111/setup for the device list and setup pages.
Discover servers from another terminal:
go run ./cmd/alpacadiscover -timeout 2sUseful simulator options:
| Flag | Purpose |
|---|---|
-port 11112 |
Change the HTTP port |
-discovery off |
Disable UDP discovery (enabled by default) |
-ipv6 |
Also answer IPv6 multicast discovery |
-quiet |
Disable per-request logging |
Discovery uses UDP port 32227. Clients on another machine need access to both the HTTP port and discovery port. Direct addresses work without discovery.
Add goalpaca to your Go module:
go get github.com/mikefsq/goalpacaRead a camera's sensor width:
package main
import (
"fmt"
"log"
"github.com/mikefsq/goalpaca/client"
)
func main() {
cam := client.NewCamera("127.0.0.1:11111", 0)
if err := cam.SetConnected(true); err != nil {
log.Fatal(err)
}
defer cam.SetConnected(false)
width, err := cam.CameraXSize()
if err != nil {
log.Print(err)
return
}
fmt.Println(width)
}The client supports all ten Alpaca device types and both JSON and ImageBytes camera transport. See client examples and API documentation.
See DRIVERS.md for device interfaces, hardware lifecycle, configuration, standalone binaries, and testing. The simulators provide working implementations without hardware.
| Package | Purpose |
|---|---|
alpaca |
Protocol types, errors, and ImageBytes encoding |
client |
Typed clients and discovery |
server |
HTTP serving, discovery, setup forms, and protocol validation |
registry |
Driver registration and construction from configuration |
devicemain |
Command-line entry point for standalone drivers |
sim |
Simulators for all ten device types |
conformance |
Device checks based on ConformU |
cmd/discover_proxy answers discovery for servers using goalpaca's registration
extension; see discovery relay setup. cmd/fault_proxy injects faults for testing client recovery; see its
usage guide.
Standalone drivers using devicemain accept -discover to scan attached hardware
and print JSON before configuration loading or device construction. The response
contains driver, supported, identity keys in preference order, and devices
with label and configuration values. Unsupported scanners return
supported: false; a supported scan with no matches returns an empty array.
Scan errors appear in JSON and cause a nonzero exit. Scanners receive a ten-second
context deadline and must leave devices already in use undisturbed. Custom
launchers can call devicemain.Discover for the same output contract.
This hardware scan is separate from -discovery and client network discovery.
go test ./...
go test -race ./...The suite covers protocol handling, clients, simulators, and ConformU-derived checks. Hardware drivers need their own tests for capabilities, limits, and failure handling.
MIT, © 2026 @mikefsq. Vendored ASCOM specifications retain their upstream MIT notices.