Skip to content

Latest commit

 

History

374 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Astro

Go Reference License

Astro is a Go library and CLI implementing CCSDS and ECSS space communication standards, the protocols NASA, ESA, JAXA and other agencies use to talk to spacecraft.

29 standards, from channel coding up to mission operations. pkg/ takes no dependencies outside the Go standard library.

Documentation | Protocols | CLI | Conformance

Install

Requires Go 1.26 or later.

go get github.com/ravisuhag/astro                # library
go install github.com/ravisuhag/astro@latest     # CLI

Library

// A telemetry packet from application 100.
packet, _ := spp.NewTMPacket(100, []byte("temperature=22.5"))
encoded, _ := packet.Encode()

// Framed for the downlink: spacecraft 42, virtual channel 0.
frame, _ := tmdl.NewTransferFrame(42, 0, encoded, nil, nil)
frameBytes, _ := frame.Encode()

// Sync marker attached, ready for the radio.
cadu := tmsc.WrapCADU(frameBytes, tmsc.DefaultASM(), true)

That is the chain by hand. pkg/stack builds both ends of it from one configuration value, so the spacecraft and the ground station cannot drift apart.

Start with the Go quickstart, then build a downlink.

CLI

# Encode a telemetry Space Packet, then look at what you built
astro spp encode --apid 100 --type tm --data 68656c6c6f | astro spp inspect --input hex

# Encode with a CRC and check it
astro spp encode --apid 100 --type tm --data a1b2c3d4 --crc | astro spp validate --input hex --crc

22 commands, one per protocol: spp epp tm tc aos usdl pxdl cadu cltu pxsc ocsc sdls cop time xtce pus ldc rhc cfdp ltp bp sle.

Every one takes encode, decode, inspect and friends, reads stdin and writes stdout. Run astro manual for the reference built into the binary, or see the CLI docs.

Protocols

Every standard, its package, and its conformance statement: the protocol index.

Packets SPP | EPP, data link TM | TC | AOS | USLP | Proximity-1, coding TMSC | TCSC | PXSC | OCSC (reliability COP-1) security SDLS, files and DTN CFDP | LTP | BP | BPSec (ground SLE | CSTS) compression LDC | RHC, mission time codes | PUS | XTCE | ODM | TDM | ADM | CDM | NDM.

Each package ships a conformance statement saying what it implements clause by clause, and what it does not.

Examples

Fifteen runnable programs, each with a walkthrough under guides.

# The core chain
go run ./examples/downlink/          # telemetry, spacecraft to ground
go run ./examples/uplink/            # commands, with COP-1 reliable delivery
go run ./examples/lossylink/         # the same downlink under frame loss
go run ./examples/duplex/            # both directions, with the CLCW riding home
go run ./examples/composed/          # both ends from one configuration

# What the bytes mean
go run ./examples/pus/               # five ECSS services working together
go run ./examples/xtce/              # decoding from a mission database
go run ./examples/timecorrelation/   # a drifting clock turned into real time

# Moving more than a packet
go run ./examples/cfdp/              # a file, with the hole in it filled
go run ./examples/dtn/               # store and forward over BP and LTP

# High rate and protected
go run ./examples/aos/               # packets, a bitstream, and opaque blocks
go run ./examples/sdls/              # AES-GCM and AES-CMAC, plus three attacks
go run ./examples/compression/       # Rice coding and POCKET+

# Ground segment
go run ./examples/sle/               # an SLE session over a real TCP connection
go run ./examples/capture/           # writes a capture to practise debugging on

Contributing

Every standard astro has scoped now has a package, so a new protocol starts with a case for why it belongs. The scope note says what astro deliberately leaves out.

Read contributing (especially the rule about never coding a constant or field layout from memory) and adding a protocol. Open an issue to discuss your approach first.

License

Apache 2.0.

About

Astro is an Conformance-tested CCSDS and ECSS protocols library for building spacecraft and ground software.

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages