> ## 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.

# GPIO output

> The ados-gpio service that drives a status buzzer or LED on a GPIO line: its command socket, beep bounds, the extension methods and how to turn it off.

`ados-gpio` owns the host's GPIO output lines and drives a status buzzer or LED on request. It runs on every profile and is on by default; on a ground station the beeper and status lines are part of its normal behaviour.

It is safe by default:

* It drives no line until it receives an explicit command.
* Every beep is bounded, so a line is never held high indefinitely, and every beep schedule ends with the line low.
* On shutdown it drives every line it owns low.
* On a host with no GPIO chip, line writes fail and are reported back as errors; the service stays up so a later command, or a controller plugged in later, is served.

## Turn it off

`hardware.gpio_out_enabled` in `/etc/ados/config.yaml` controls the service (default `true`). The installer mirrors it into the `/etc/ados/gpio-rust-enabled` marker that the `ados-gpio` unit starts on, on every install and upgrade. Set it to `false` and the next installer run removes the marker, leaving the unit inert.

## Command socket

The service listens on `/run/ados/gpio-cmd.sock`: one newline-terminated JSON request per connection, one JSON reply, then the connection closes.

| Request | Reply |
| - | - |
| `{"op": "set", "chip": 0, "pin": 17, "level": "high"}` | `{"ok": true, "chip": 0, "pin": 17, "level": "high"}` |
| `{"op": "beep", "pin": 18, "on_ms": 120, "off_ms": 80, "cycles": 3, "freq_hz": 2700}` | `{"ok": true, "phases": 6}`, returned once the schedule is accepted, before the beep finishes. |
| `{"op": "status"}` | `{"ok": true, "lines": [{"chip": 0, "pin": 17, "level": "high"}]}` |

A failure is `{"ok": false, "error": "E_..."}`. Bad JSON, an unknown op or a missing field is refused without touching hardware.

The current line states are also written to `/run/ados/gpio-output.json`.

### Beep bounds

A beep request outside these bounds is clamped, not rejected, so the operator still gets a bounded beep:

| Bound | Limit |
| - | - |
| Carrier frequency | Up to 5 kHz (software PWM) |
| One on or off phase | Up to 5 s |
| Cycles | Up to 64 |
| Whole schedule | Up to 30 s |

## From an extension

An extension drives the lines through the plugin host, which forwards each call to this socket:

| Method | Capability |
| - | - |
| `gpio.output.set` | `hardware.gpio_out` |
| `gpio.buzzer.beep` | `hardware.gpio_out` |

See [Extensions](https://docs.altnautica.com/drone-agent/plugins.md) for how capabilities are granted.

## The crate

The timing and command parsing are published as the [`ados-gpio`](https://crates.io/crates/ados-gpio) crate, so other projects can use the same bounded beep schedules on Linux GPIO character devices.


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