# Headsets, addresses and the connection Frame Control can manage more than one Steam Frame, and each headset can be reached at more than one address: a LAN IP at home, another at the office, its mDNS name (`frame.local`), its Tailscale IP or MagicDNS name. The **Devices** tab (key 5) lists them, and the connection pill in the header shows what the app is doing to reach the one in use, step by step, as it happens. The code is in three modules, all stdlib-only Python on your computer: | Module | What it does | |---|---| | `ui/frame_devices.py` | The registry: headsets, their addresses, networks; importing and updating `~/.ssh/config`; pinned host keys | | `ui/frame_network.py` | Which network this computer is on, and Tailscale's state | | `ui/frame_link.py` | The connector: finds the headset, keeps the SSH connection, publishes each stage; the Devices API | ## Headsets Each headset keeps its own SSH alias, as Set Up Connection has always written it: the first is `frame`, the next `frame-2`, and so on. Terminal's `ssh frame-2` and the helper scripts (`FRAME_ALIAS=frame-2 scripts/push.sh …`) work for each one. - **Nothing to migrate by hand.** On first start, the app imports every `# >>> steam-frame (ALIAS) >>>` block in `~/.ssh/config` as a headset, with the block's HostName as its first address. It also copies the host key your `known_hosts` already trusts for that address into the app's own `~/.ssh/frame-control_known_hosts`, so nobody is asked to trust it again. - **Add a headset** runs Set Up Connection (`scripts/connect.sh` on macOS, `ui/frame_connect.py --alias NAME` elsewhere) in a terminal with a new alias. When it writes its block, the app picks the headset up by itself. If Set Up Connection runs again and finds a headset somewhere new, that address is added at the top of its list. - **Use this headset** (or the switcher in the header, or the app's **Frame → Headset** menu) moves the whole app to another headset; every panel reloads from it. - **Remove** forgets a headset. Its `~/.ssh/config` block stays unless you tick the box; either way it isn't imported again unless Set Up Connection changes it. - A plain `FRAME_ALIAS` that Set Up Connection never configured still works: the app shows it as not set up and lets ssh's own config decide where it goes. ## Addresses Each address has a kind (LAN, mDNS, Tailscale or Other, guessed from the address and changeable), an optional label, the networks it has worked on, and when it last worked with its round-trip time. When connecting, the app **tries all addresses at once** (TCP to the SSH port) and ranks them: 1. addresses that worked on the network this computer is on now; 2. mDNS names; 3. Tailscale addresses, if Tailscale is running here; 4. addresses not tried on this network yet; 5. addresses that only ever worked on other networks; 6. Tailscale addresses while Tailscale is off. Your order on the Devices tab breaks ties. The best-ranked address that answers wins; one that answers first waits up to 0.35 s for a better-ranked one that is still trying. If SSH to the winner fails in a way another address could fix (a different device answered there, or the link dropped), the next one that answered is tried. Every success records the network on that address, so next time on that network it's tried first. **Test now** probes every address and tries SSH on each one that answers, without disturbing the connection in use: "SSH works", "answered as a different headset", "refused this computer's key", or why it didn't answer. **Find on Tailscale** lists your tailnet's devices (likely headsets first, from `tailscale status --json`, including the Mac app's own CLI) with buttons to add their MagicDNS name or IP. **Find on this network** asks mDNS for SteamOS devkit services and checks `ALIAS.local` and `frame.local`. ## Networks A network is told apart by its default gateway: the router's IP address plus its hardware (MAC) address, read with `route`/`arp` (macOS), `ip route`/`ip neigh` (Linux) or `route print`/`arp -a` (Windows). That works on wired networks, and on macOS 14 and later, which hides the Wi-Fi name from apps without Location permission. Where the system does share the Wi-Fi name, it's shown, and you can name any network yourself ("Home Wi-Fi") on the Devices tab. The app rereads the gateway every 5 seconds and Tailscale's state every 30 seconds. Changing networks reconnects. ## The connection, stage by stage The connector runs in the server (`frame_link.Link`) and moves through: 1. **Checking this computer's network**: gateway, Wi-Fi, this computer's IP, Tailscale. 2. **Finding the headset**: each address resolving, trying, answered in N ms, no answer, refused, or can't be found. 3. **Opening SSH** to the address that answered. 4. **Checking the headset's identity**: the host key must match the one pinned for this headset. 5. **Logging in** as the headset's user. 6. **Connected** via network N, address A, round trip T; or **failed** at a stage with the reason in plain words and a countdown to the next try (5, 10, 20, then every 30 seconds). Retry now skips the wait. Stages 3 to 5 come from following `ssh -v` as it runs. On macOS and Linux the connection is an SSH ControlMaster that every command shares; when it dies (the headset slept or left the network) the connector notices and starts again. On Windows, where OpenSSH can't share a connection, the same handshake runs once and each command then connects on its own; a command that can't reach the headset makes the connector start again. Once connected, every `ssh`, `scp` and `rsync` the app runs gets `-o HostName=
-o HostKeyAlias=frame-control-