Stellar Link comes with a set of small example programs that talk to a running unit over its REST API and its ZeroMQ link service. They can be downloaded from https://get.stellar-systems.eu, or through the onboarding app available after purchase. They are meant to be read, run and copied into your own tools.
Python examples#
They need Python 3.11 or later; pyzmq and requests are the only dependencies (pyzmq ships
libzmq in its wheel). From the examples directory:
uv run stellarlink-chat --host <unit-address>
uv run stellarlink-monitor --host <unit-address>
uv run stellarlink-rf-sweep --host <unit-address>| Module | Purpose |
|---|---|
board.py | The reusable client: the REST API on port 8080 and the ZeroMQ link service on 5555/5556/5557. The part to reuse |
chat.py | Type a line, it goes through the modem, it comes back |
monitor.py | A terminal monitor of telemetry and received frames |
rf_sweep.py | Sweep the transmit level and measure what the link actually delivers (unique payloads sent and found again), not only whether it locks |
The unit client#
from pathlib import Path
from stellarlink_examples import Board
board = Board("<unit-address>")
print(board.version())
board.register_profile("chat_loopback", Path("profiles/chat_loopback.yaml"))
board.apply_profile("chat_loopback")
with board.frames() as rx: # subscribe BEFORE sending
board.send(b"hello from the ground segment")
frame = rx.next(timeout=5.0)
if frame:
print(frame.seq, frame.framing, frame.text())| Method | Purpose |
|---|---|
version() | GET /api/v1/version |
register_profile(name, path) | Upload a profile file with PUT /api/v1/profiles/{name} (kept on the unit's data partition) |
apply_profile(name) | Apply it |
chain() | The chain state |
set_rf_gain(rx_gain_db=…, tx_gain_db=…) | AD9361 gains |
send(payload) | Push one frame; the socket is opened once and kept |
frames() | Context manager subscribing to frame.rx; next() returns a Frame (seq, framing, payload, text()) |
telemetry(), telemetry_once() | The telemetry topic |
The chat#
chat.py uploads its own profile (profiles/chat_loopback.yaml, provided with the examples) and
applies it, then sends every line you type and prints what comes back. The profile selects the
modem's internal loopback, so every line printed back is your own, after a full trip through the
framer, modulator, channel emulator and demodulator.
profile 'chat_loopback' pushed from chat_loopback.yaml — registered in memory only
profile 'chat_loopback' applied
chain ready for 'pl-loopback' — anything you type goes out
>> hello from the ground segment
<< [block seq 4] hello from the ground segmentOptions: --host, --api-port, --tx-port, --rx-port, --profile <file>, --no-apply
(use the chain as it is), --raw (print bytes instead of text).
To chat over the air instead, condition the chain for an RF profile first and skip the apply:
curl -X POST http://<unit-address>:8080/api/v1/chain/condition \
-H 'content-type: application/json' \
-d '{"target":"air","profile":"rf_loopback"}'
uv run stellarlink-chat --host <unit-address> --no-applyThings to know:
- The first line after applying a profile may come back one character short: the leading byte can fall in the receiver's acquisition transient. Send it again.
- What arrives may be a whole block: unless the daemon's
[link] frame_slot_bytesmatches the profile'smtu_bytes, the payload is 4096 bytes holding your line and padding.Frame.text()strips the padding for display; a real client parsesFrame.payloadwith the framing its profile declares. - The radio status carries two receive gains:
rx_gain_db(the modem's digital gain) andrx_rf_gain_db(the AD9361 gain in dB). Read the one you set.
CCSDS terminal client#
A terminal application is also available for CCSDS work: it composes transfer frames (TM 132.0-B,
AOS 732.0-B, USLP 732.1-B, and TC 232.0-B inside a 231.0-B CLTU), sends them through the link
service, locates them in the received stream, decodes them and compares. It uses the
ccsds_tm_loopback profile. With no unit reachable it runs an offline round trip, which checks the
frame codec only, not a link.