Skip to content

alpaca

tested on simulator

Tier Tier 2
Protocol ASCOM Alpaca REST, Alpaca UDP discovery
Covers telescope mounts, focusers, cameras and power boxes, observatory domes
Hazard default medium
Conformance full
Tested with Alpaca server simulator on an httpx mock transport, discovery over local UDP

Estimated reach. Hundreds of models, every ASCOM device reachable through ASCOM Remote. Alpaca is the network form of ASCOM, the standard driver interface for astronomy gear on Windows. ASCOM Remote exposes every installed ASCOM driver over Alpaca, and a growing number of mounts, focusers and observatory controllers use Alpaca natively on Linux and embedded boards. The count is a model estimate.

The alpaca driver controls ASCOM Alpaca astronomy devices through httpx. One device file is one device, picked by device_type and device_number.

Supports

TypeReadSetActions
telescoperight_ascension, declination, altitude, azimuth, sidereal_time, slewing, at_park, at_home, trackingtrackingabort_slew, park, unpark, find_home, slew_to_coordinates with right_ascension and declination, slew_to_alt_az with azimuth and altitude
focuseris_moving, temperature, max_stepposition in stepshalt
cameraccd_temperature, camera_state, image_ready, percent_completed, cooler_powercooler, target_temperature, gainstart_exposure with duration and light, abort_exposure, stop_exposure
switchswitch_0, switch_1, ...switch_0, switch_1, ...
domeazimuth, altitude, shutter, slewing, at_park, at_homeabort_slew, park, find_home, open_shutter, close_shutter, slew_to_azimuth with azimuth

Right ascension and sidereal time read in degrees, hours times 15, so 90 deg slews to 6 h. A switch channel is a bool or a number by channel type. Other members need a map.

MapMeaning
{ property: coolerpower, unit: percent }Any property, with the protocol unit and an optional scale
{ property: shutterstatus, states: [open, closed, opening, closing, error] }Integer state as an enum
{ switch: 3 }Switch 3
{ property: tracking, param: Tracking }Set a property with PUT
{ method: move, param: Position, integer: true, readback: position }Set through a method, read back from a property
{ method: slewtoazimuth, wait: slewing, params: { azimuth: { name: Azimuth, unit: deg } } }Action. wait names a property that stays true while the action runs
{ device: dome, number: 0, ... }Any of these on another device of the same server

Behavior

  • connect() checks for API version 1 and every device the file uses, then sets Connected on each. close() leaves Connected set unless disconnect_on_close: true.
  • A non-zero ASCOM ErrorNumber fails the command with the error named, such as 0x408 not allowed while parked.
  • A wait action polls until the member is false and returns done, or returns started after action_wait.
  • A fractional value for an integer member such as focuser position is blocked.
  • A stop sends AbortSlew to telescopes and domes, Halt to focusers and AbortExposure to cameras. InvalidWhileParked from a parked mount counts as safe. park_on_stop: true also parks. Switches and tracking change only through the file's safe_state.
  • openhal discover broadcasts on UDP port 32227 and lists each server's devices read-only.

Setup

Install with uv tool install --compile-bytecode "halkit[alpaca] @ git+https://github.com/sohan-bhat/OpenHAL" and start ASCOM Remote or the device's own Alpaca server.

KeyDefaultMeaning
hostrequiredServer host
port11111HTTP port
schemehttphttp or https
device_typetelescopeAny Alpaca type
device_number0Device number on the server
timeout5 sPer request
action_wait8 sPoll time for wait actions, at most 9 s
park_on_stopfalsePark telescopes and domes on a stop
disconnect_on_closefalseClear Connected on close

Example device file

openhal/drivers/alpaca/examples/eq-mount.hal.yaml drives a mount. Set the host and site limits. Slews need confirm-each-time and an unparked, tracking, still mount.

Known limitations

  • No camera image download, since imagearray can be tens of megabytes.
  • Absolute focusers only.
  • No MoveAxis or pulse guiding.
  • OpenHAL checks only the file's declination and altitude limits, so keep the mount's own horizon limits set.

Hazard defaults

medium. A slewing mount can hit the pier, a tripod leg or a person, and a dome rotates with force.

Sources