Skip to content

robot console

Eric Busboom edited this page Sep 24, 2026 · 1 revision

Robot-console compatibility

The relay pool (7444) and /names API (7445) that let robot-console use mbregistry in place of the old mbrelay server.

Robot-console compatibility

Robot-console was written against the legacy mbrelay relay server. mbregistry serves the same contract, so robot-console needs no changes. It finds relays over mDNS exactly as before; only the ports differ, and those are advertised.

Legacy mbrelay.service mbregistry
mDNS _mbrelay._tcp _mbrelay._tcp (same)
Pool port (SRV) 8760 7444
Names API (TXT registry=) 8761 7445

Both listeners run inside mbregistry run. The pool only serves this host's own relays, never a peer's.

The relay pool (TCP 7444)

On each new TCP connection:

  1. The pool picks a free local relay: role contains RELAY or BRIDGE, connected, unlocked. It takes a relay lock on it.
  2. It resets and normalizes the relay to factory defaults and verifies it. It then sends the board's announcement line (e.g. DEVICE:RADIOBRIDGE:relay:<name>:<id>) followed by \r\n.
  3. After that the connection is a raw, transparent byte pipe to the relay until the client disconnects.
  4. On disconnect it restores the relay's stored defaults and releases the lock. Reconnecting resets the relay. Pool connections have no BREAK, and clients rely on this behaviour instead.

If no relay is free, the client gets one comment line and the connection closes:

# ERROR: no relay available (3 devices, 3 in use)

Hosts without relays should run mbregistry run --no-relay-pool. That also stops them from advertising _mbrelay._tcp.

The names API (HTTP 7445)

Maps a robot name to its radio (channel, group). Always on, no authentication.

Request Effect Response
GET /names/<name> Look up. If the name is unknown, derives and stores it. There is no read-only peek. 200 {"channel": n, "group": n, "source": "derived"|"registry"}
PUT /names/<name> with body {"channel": 12, "group": 4} Explicit assignment 200, same shape
DELETE /names/<name> Drop the explicit entry; re-derives 200, same shape (the fresh derived value)
  • Names must be five letters, [zvgpt][uoiea][zvgpt][uoiea][zvgpt]. Anything else gets 400.
  • PUT accepts channel 0-83 and group 0-255, the range the relay's !CG accepts. Out of range gets 400, never a silent clamp.
  • Every write (including the first derive-on-GET) replicates to all peered hosts.
  • mbrelay names get/set/clear/list edit the same registry through the local daemon, not over HTTP.

Checking a host

From another machine on the LAN:

avahi-browse -rt _mbrelay._tcp            # expect port 7444, TXT registry=7445
curl -s http://<host>:7445/names/<name>   # {"channel": ..., "group": ..., "source": ...}
nc <host> 7444                            # expect a DEVICE:RADIOBRIDGE:... banner, then type ? for status

Every new nc connection should show a fresh banner and factory-default tuning.

If robot-console was running during a host's cutover and its relay link seems stuck on the old port, restart robot-console. That forces a fresh mDNS discovery.

Clone this wiki locally