> Documentation index: https://nao-rs.lukaloehr.com/llms.txt, a list of every page in this documentation.

# Reference

> The REST API, the MessagePack robot API and the command-line tools.

- [Robot API](https://nao-rs.lukaloehr.com/reference/api.md): TCP port 7700, MessagePack frames: handshake, heartbeat, every message.
- [REST API](https://nao-rs.lukaloehr.com/reference/rest-api.md): HTTP/JSON on port 7702: token, leases, every operation, generated from the OpenAPI document.
- [Command-line tools](https://nao-rs.lukaloehr.com/reference/cli.md): naoctl on the robot, nao-rs on your computer.

## Ports

| Port | Protocol | Served by | Purpose |
| --- | --- | --- | --- |
| 7700 | TCP | `hulk` | Robot API |
| 7702 | TCP | `hulk` | REST API (HTTP/JSON, local network only) |
| 7701 | UDP | `nao-rs-guard` | Death switch stop (`NAO-RS STOP`) |
| 22 | TCP | HULKs-OS | SSH, user `nao` |

## Files on the robot

| Path | What |
| --- | --- |
| `/run/nao-rs/deathswitch` | The death switch page |
| `/home/nao/hulk` | The nao-rs installation: `bin/hulk`, `bin/nao-rs-guard`, `bin/naoctl`, `etc/` |
| `/home/nao/hulk.prev` | The previous installation, kept for rollback |
| `/etc/systemd/system/hulk.service` | `hulk` on the nao-rs runtime |
| `/etc/systemd/system/nao-rs-guard.service` | The guard |
| `/etc/tmpfiles.d/nao-rs.conf` | Creates `/run/nao-rs` at boot |
| `/etc/systemd/network/50-nao-rs-wired.network` | The wired network: DHCP, `172.28.28.28/24`, link-local |
| `~/.config/nao-rs/rest-token` (user `nao`) | The REST API token |
| `/var/run/alfand/cputemp` | Last CPU temperature reading, in thousandths of a degree |
| `/media/internal/DeviceHeadInternalGeode.xml` | Head id and version (read only) |

## Logs

```bash
journalctl -u hulk -f            # the runtime and hulk
journalctl -u nao-rs-guard -f   # the guard: takeovers, UDP stops
```

## Related topics

- [Robot API](https://nao-rs.lukaloehr.com/reference/api.md)
- [Command-line tools](https://nao-rs.lukaloehr.com/reference/cli.md)
- Previous: [Verification and parity](https://nao-rs.lukaloehr.com/verification.md)
- Next: [REST API](https://nao-rs.lukaloehr.com/reference/rest-api.md)
