> ## Documentation Index
> Fetch the complete documentation index at: https://docs.altnautica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Config over radio

> Read and change a radio-linked drone's radio and video config through its ground station, over the WFB link, when the drone has no IP path.

The WFB link carries no IP, so a drone reached only over the radio has no `/api/config` you can call. The config-over-radio channel fills that gap for one narrow job: reading a drone's config and changing its radio and video settings from the ground station.

It is off by default, on both ends, and it carries config requests only. It is never a general command proxy and never a flight-command path.

## How it works

One binary, `ados-tunnel-config`, runs on both ends and picks its role from the profile:

| End | Role |
| - | - |
| Ground station | **Injector.** Takes a config request from the ground station's REST route, splits it into MAVLink `TUNNEL` frames on the radio's auxiliary application lane, and waits for the drone's reply. |
| Drone | **Terminator.** Reassembles the request, calls its own local `/api/config`, and sends the reply back the same way. |

Every request carries a relay ticket minted from the per-pair secret the drone received at pairing, naming that drone and bound to the request's operation, key and value. The radio key is shared by the whole fleet, so this ticket is what proves the request came from the drone's own ground station. Each ticket is honoured once, and a drone with no secret refuses everything.

A write may touch only keys under `radio.` and `video.`. The trust-root keys, MAVLink routing and the channel's own gates are never writable this way.

## Enable it

Set these under `radio.tunnel` in `/etc/ados/config.yaml` on both the drone and the ground station:

| Key | Default | Effect |
| - | - | - |
| `radio.tunnel.enabled` | `false` | Opens the channel. With only this, requests are read-only. |
| `radio.tunnel.command_enabled` | `false` | Also allows config writes. A write is refused on the ground station before anything is sent unless this is on. |
| `radio.tunnel.rx_port` | `5820` | The local port the channel receives on. |

The `ados-tunnel-config` unit starts only when the `/etc/ados/tunnel-enabled` marker exists; the agent keeps it in step with `radio.tunnel.enabled`. The unit runs on the `drone` and `ground_station` profiles.

## Use it from the ground station

Both routes live on the ground station and answer `404 E_PROFILE_MISMATCH` on any other profile.

### Channel state

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -s -H "X-ADOS-Key: $ADOS_KEY" http://192.168.4.1:8080/api/v1/ground-station/relayed/config
```

Returns the channel's state sidecar (`/run/ados/tunnel-config.json`, written about once a second): `state` (`disabled`, `injector`, `terminator` or `bind_failed`), `enabled`, `command_enabled`, `carries: "config"`, `bearer: "aux"`, the ports, and the counters `rx_frames`, `tx_frames`, `requests`, `responses`, `rejected` and `timeouts`. An absent, stale or malformed sidecar is `404`, never an old reading. A `rx_frames` count that never moves means nothing arrives over the radio.

### Send a request

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -s -X POST -H "X-ADOS-Key: $ADOS_KEY" -H "Content-Type: application/json" \
  -d '{"request": {"op": "get", "key": "video.wfb"}, "timeout_ms": 8000}' \
  http://192.168.4.1:8080/api/v1/ground-station/relayed/config
```

| `request.op` | Fields | Effect on the drone |
| - | - | - |
| `get` | optional `key` | Reads the redacted config, narrowed to the dot-path subtree `key`. Name a subtree: the whole config is larger than the radio link carries in one reply. |
| `put` | `key`, `value` | Writes one dot-path key under `radio.` or `video.`. Needs `command_enabled`. |

Add `device_id` to name the drone. With exactly one drone registered on the ground station it can be left out; with more than one it is required.

A relayed reply is `200` with `{"is_error", "response"}`; `is_error` is `true` when the drone returned an error envelope.

| Status | Cause |
| - | - |
| 400 | No drone could be named, or another daemon-side refusal (carries the `E_*` code). |
| 401 | The ground station holds no relay secret for that drone. |
| 404 | Not a ground station (`E_PROFILE_MISMATCH`). |
| 409 | `E_TUNNEL_DISABLED` or `E_WRITE_DISABLED`: the channel or writes are off. |
| 503 | The channel's command socket is not there (the channel is not enabled). |
| 504 | `E_TIMEOUT`: no reply from the drone. |

## Related

> [card] [WFB-ng](https://docs.altnautica.com/drone-agent/wfb-ng.md)
>
> The radio link this channel rides on.

> [card] [Configuration](https://docs.altnautica.com/drone-agent/configuration.md)
>
> Every config key, and how to change it over the network.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.