HealthResult::goal_pwm (API_VERSION 62): the Goal PWM robotd last wrote
while bus.battery_voltage_based_pwm_limit is on, absent when off.
robotctl monitor shows it on the power row beside the battery, as
"pwm 81% (718)", and only when robotd sends it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`nfc.read` on nfcd's socket reads the next tag touched, or one already on
the reader, and answers with its UID and NDEF text/URI records. It waits,
quacks and keeps the tag from being acted on just as a write does, so a
pairing or mode tag can be checked without it pairing or switching. A tag
that moves mid-read is read again on the next poll until the wait runs out.
API_VERSION 61: a v60 nfcd answers nfc.read METHOD_NOT_FOUND, by name.
btd carries it; mediad does not. every_call() gains NfcWrite, which it was
missing, and NfcRead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main took v57 (a join's progress). Type 5 tag writing keeps refusing
MIFARE Classic; pad-map's cfg.skill keeps soccer's bumper kicks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The brain gains two states, both driven by robotd and wanted by the brain:
- Laser: tracking is on whenever the duck could chase (not tired, not
napping, petted or playing ball). A followed dot interrupts any
standing or walking state; the chase ends 2 s after the dot goes, and
costs twice a walk's energy. Below 0.2 the laser goes off and the duck
naps; it comes back above 0.45.
- BallPlay: picked from the standing pool when rested and off cooldown,
less often the more bored of the ball. No ball in 20 s backs off 3 min,
doubling per miss up to 30. A game ends on 3-8 kicks, 1-3 min shrunk by
boredom, the ball lost for 15 s, or tiredness; then 4-8 min of rest.
While robotd drives either, autod sends a zero twist and a centred head,
which robotd reads as nobody asking. A game somebody else started is
stood aside for, and the brain's own is switched off when the pad takes
over.
The on/off switch moves into robotd (robot.autonomous, read back in
robot.mode and robot.state; part of v59), so the NFC autonomous_mode tag
can switch it — nfcd cannot write robotd.toml. [autonomous] enabled is
now only where each boot starts; robotctl autonomous on|off switches it
now. autod stands the robot up on the switch's rising edge, and once per
boot for the switch at boot. padd learns it from robot.mode. mapd starts
mapping the first time it sees the duck switched on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The October brain, brought up to main. Beyond the conflicts:
- The pad's handoff (silent until touched, lets go after pad_idle_s) is
now pad_map::engage, since main moved padd's mapping into pad-map. A pad
nobody was touching going away no longer sits the robot down: the brain
was driving, not the pad.
- autod walks at the pad's [pad_drive] full stick rather than the removed
robotd_params::drive constants.
- [map]'s template values are commented out like [laser] and [soccer]:
they never shipped live, so they do not belong in EVER_SHIPPED.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the robot it walked to the ball and never kicked, while LB/RB did —
so the kick was never asked: the ball never sat in the kick spot
(±4 × ±2.5 cm) for settle_ms in one go.
Two ways that happens, both handled. The gait sways the trunk a
centimetre or two a step even standing, and every sway out of the spot
restarted the settle: now the spot is left only past twice the
tolerances. And the last centimetres ask for less speed than the gait
walks, so the robot stops just short: within twice the tolerances for
`[soccer] stall_ms` (1.5 s) it now kicks from there.
`robot.state`'s soccer block gains `spot_m`, the ball's offset from the
kick spot, shown by `robotctl soccer` — what to read when it stands at
the ball and does not kick.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
net.connect answers once, after up to 55s. While it runs, net.status now
carries `joining: {ssid, step, elapsed_seconds, timeout_seconds}`, with
step one of scanning, associating, authenticating, key_rejected,
addressing. configd's connect fills it: the scan first, then the
device transitions it already subscribes to. A Join handle clears the
slot on drop, so every return path clears it.
duckctl wifi connect polls it every 2s on the same BLE session and
prints each step change; robotctl net status shows it. FakeNet walks
the same steps and can hold a join at one, which is how the tests see
a join in flight.
API v57: additive, absent from an older configd.
Assisted-by: Claude:claude-opus-5-5
nfc.write refused every Type 5 tag. A blank one is also the tag no phone
app will format unless it knows the maker (manufacturer 0x48 here: not
NXP, not ST), so the robot was the only writer left and it said no.
vtag now writes with WRITE SINGLE BLOCK. A formatted tag keeps its
capability container; a blank one gets a 4-byte container granting read
and write, sized from GET SYSTEM INFO or MLEN 0 when the tag keeps its
size to itself. Block 0 goes last, and the message is read back.
Assisted-by: Claude:claude-opus-5-5
`nfc.write { text, timeout_s }` (API v55) has nfcd write the text onto the
next NTAG touched to the head, or one already on the reader, as one NDEF
text record, then read it back. The robot quacks when it took. While a
write waits, a touched tag is written rather than acted on, and the tag
just written is not then read as a touch, so writing a pairing tag does
not pair.
nfcd serves it on its own socket, /run/nfcd/nfc.sock (group robot, 0660),
from threads that hand each write to the poll loop, which owns the reader.
`robotctl nfc-flash <text>` asks it there; btd now holds a fourth socket
and permits nfc.write over BLE, so `duckctl nfc-flash <text>` does the same
from a laptop. mediad refuses it: someone has to be at the robot to touch
a tag.
Only Type 2 is written. The capability container decides: a MIFARE Classic
or an e-ink refuses its READ, an unformatted or read-only tag says so, a
text longer than the tag is refused, all before any page is written. Pages
0-3 and the configuration pages are never written, so a write cannot lock
a tag. The WRITE's four-bit ACK is taken loosely — a reader may not frame
it — and the read-back is what says the tag holds the text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two switches in robotd, set by `robot.soccer {active, autonomous}`:
- soccer mode: the pad's LB/RB run kick_left/kick_right whatever they
are bound to, and D-pad down starts autonomous play instead of
body + head;
- autonomous: the robot turns until it sees the purple ball, walks to
it, steps sideways until the ball is in front of the foot on its
side, kicks, and looks again. Any pad button takes it back to manual,
and that press does nothing else. A pushed stick wins over it, as
over the laser.
mediad finds the ball (`media.ball`, beside `media.laser`, sharing its
look loop): purple is the hue with both chromas above grey; passing
cells on a 4x4 grid are grouped into blobs, and a blob is the ball when
big enough, filled and round — a ball cut by the frame's edge keeps its
centre and radius from its uncut sides. Every look carries the most
purple colour seen, passed or not, for tuning. robotd projects the
centre onto the plane a radius above the floor with the laser's own
projection, now shared, and carries it by odometry through the last
steps where the ball is under the beak.
The pads learn soccer mode from `robot.mode`, which they already poll
each second — so an NFC tag switching it reaches the pad. Soccer and
laser tracking switch each other off. `[soccer]` holds the detector
thresholds, the kick spot and the gains, all live; `robotctl soccer
on|auto|off` switches it and is the tuning view; the web console draws
the ball.
API_VERSION 54: `robot.soccer`, `robot.mode`'s `soccer`,
`robot.state`'s `soccer` block, `media.ball` / `media.ballSeen`.
Colour thresholds are a first guess; to be tuned on camera images.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While the EEPROM holds something that is not a valid code, export uses
no key at all, so a key installed beside it would be reported as
installed and never used. Refuse with the EEPROM's error instead, and
document that such a robot stays reachable over Bluetooth with its
label PIN.
Assisted-by: Claude:claude-opus-5-5
The EEPROM line is now <label serial>:md1:<first name>:<64 hex>, with
the code from offset 19, and the QR printed on the robot carries that
whole line. A colon after the serial with no code, or a code with no
colon (the previous layout), is an error rather than a code read one
byte off. `robotctl system setup-code` shows the same line, so a dev
board's QR goes through the same app path as a factory label; at
error correction L that is version 5, 82 columns at worst.
Assisted-by: Claude:claude-opus-5-5
The factory writes the setup code into the robot's ID EEPROM with an
external programmer, after the 18-digit label serial:
md1:<first name>:<64 hex>, the same string as the QR printed on it.
robotd-params::label decodes it.
configd's unit runs `robotctl system setup-code export` before it
starts: it takes the EEPROM's code (or a dev board's installed key),
refuses one whose id is not this robot's first name, and leaves the key
in /run/credstore. btd and duck-gateway are ordered after configd and
ImportCredential=ble-psk, so secure mode follows the robot with no
drop-in; without a key btd serves the PIN path and the gateway exits
cleanly. The gateway gains an [Install] section.
`robotctl system setup-code` shows the code and where it came from;
`install` is now for dev boards with nothing in the EEPROM. The factory
doc's sequence becomes: read the first name, generate a random key,
program the EEPROM, print the QR, verify against the printed label.
Assisted-by: Claude:claude-opus-5-5
The half-block glyph stops short of the cell's middle in macOS Terminal's
font, so every dark module above a light one came out thinner and a
phone would not read the code. Draw one module per row as two spaces
painted with the background colour, which fills the whole cell whatever
the font, at error correction L so the code stays within 80 columns.
Assisted-by: Claude:claude-opus-5-5
Comments across uyvy, mediad, robotctl and the console said the head
camera "is mounted a quarter turn off". That is the Zero 3W; the beta
boards' GC2093 is upright, and robotd_params::board owns the mount.
mediad/src/camera.rs also still said the GC2093 had no calibration,
though CameraIntrinsics::beta ships for beta and face-board-v1.
Wording only, plus a duck-detect test for the landscape letterbox —
the beta boards' real case, which had none.
Assisted-by: Claude:claude-opus-5-5
Ported from the prototype runtime, rebuilt for the daemon split.
mediad finds the dot (`media.laser`, a local subscription on media.sock):
it scans frames the tee already hands out, at the stream's own
auto-exposure, so the video is untouched. It looks at `search_hz` until
it sees a dot and `track_hz` while it does, and publishes a direction —
a ray in the upright camera frame, intrinsics and board mount undone —
plus the colour of the best candidate whether it passed or not.
robotd projects that ray onto the floor through head FK, the IMU and
odometry, points the head with the existing look_at IK and walks to the
spot. Each half is taken only while no client wants it: a pushed stick
always wins, and with no dot in sight the robot does what it was told.
`robotctl laser-track on|off` switches it, and its live view is the
tuning tool. `[laser]` in `robotctl configure` holds the thresholds,
rates and walking gains; every key applies live, `enabled` included.
API_VERSION 52: `robot.laserTrack`, `robot.state`'s `laser` block,
`media.laser` / `media.laserDot`.
Assisted-by: Claude:claude-opus-5-5
The id in a setup code (md1:<id>:<key>) was whatever an operator passed
to btd's --secure-robot-id and the gateway's ROBOT_ID, so nothing on the
robot could print a QR for it. Use the robot's first name instead: the
duck-xxxx default name derived from the SoC serial. It moves from
configd into robotd-params::serial so configd, btd, duck-gateway and
robotctl all derive the same one, and a rename changes none of them.
robotctl system setup-code install reads the 64 hex characters on
stdin, refuses a missing data mount and an existing key without --force,
and commits the file root-only and atomically; it never prints the key.
robotctl system setup-code shows the md1: line and a QR on the terminal.
The robot never generates its key: the station does, per
factory-provisioning.md.
btd --secure-robot-id, duck-gateway --robot-id, ble-gateway.env and
scripts/generate-ble-dev-credential.sh are gone. A btd drop-in still
passing --secure-robot-id fails to start after this; remove the flag.
Assisted-by: Claude:claude-opus-5-5
With two pads in pairing mode the robot refuses rather than guesses, and
says so with a count and, from BlueZ, a sentence naming them. A client had
nothing structured to offer, so the phone app could only say "switch the
others off" — not an option when the other pad is somebody else's.
PadPairResult::Failed gains `candidates`: for `ambiguous`, the pads that
were in pairing mode (one face per pad, the ones pairing by `mac` would
choose between); empty, and absent on the wire, for every other reason.
API v51. Additive both ways: an older configd's refusal parses with an
empty list, and a refusal with nothing to list serialises as before.
Assisted-by: Claude:claude-opus-5-5
- robotctl monitor's camera caption read camera.json the same way health
did, so a stopped camera kept its last rate on the border. It now
shows "camera · stopped" once the file is older than
CAMERA_STATS_MAX_AGE.
- camera_stats_age_at(path, now) is the one file-age helper;
webrtc_peers_at uses it, so the clock-step rule lives once, and it
has its own test.
- The capture pool is eight, not four: CAPTURE_BUFFERS plus the four
v4l2src adds when downstream proposes no pool, and bufcnt:8 on an idle
board. The comment and media-bringup.md now say so, and record the
30 s WebRTC session that held 30 fps on the beta board with the cap.
Assisted-by: Claude:claude-opus-5-5
Both sides took API_VERSION 50. main's is released in 0.18.6, so it keeps
v50 (the remote-session check) and the impact guard moves to v51.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mediad rewrites /run/mediad/camera.json only while frames arrive, so a
camera that stalls leaves its last rate behind, and health printed a
dead camera as "10.0 fps (target 30)". Past CAMERA_STATS_MAX_AGE it now
reads "camera stopped — no frame for 312s (was 10.0 fps, ...)", and
--json carries camera_stopped_secs.
Assisted-by: Claude:claude-opus-5-5
A client answers this refusal differently from every other: it asks its
user whether to drop the other sessions, and on yes sends the same call
with interrupt_sessions. Matching the message would break on the first
rewording, so it gets code 16 when the session check is the only one
that failed. robotctl exits REFUSED for it, as for PREFLIGHT_FAILED.
Assisted-by: Claude:claude-opus-5-5
An emotion is two files in [emotions] dir (default /var/lib/robot/emotions): <name>.json, the
keyframes in the microduck_emotions format, and <name>.wav. robot.do <name> plays it, so it goes
on a pad button like any skill (robotctl pad bind y sad), from every client, with no new call.
While one plays, the loop puts its frame in place of the clients' head, body pose and mouth, with
a zero twist, for that tick: the same policy and safety as the sticks, and the clients' values
back when it ends. Started only on a robot the policy drives with no move in flight; a fall,
limp-fall, Start or a rest ends it and cuts its sound. "skill": "sit" sits the robot down.
The names are listed wherever robot.do's are (the refusal, pad bindings, the subscribe answer
robotctl pad bind checks). scripts/duck-sim reads them from ~/.cache/duck-sim/emotions. Docs: an
Emotions section in the cheat sheet, a row in robotd-design 4.5.
Assisted-by: Claude:claude-opus-5-5
(cherry picked from commit 9bcdc89f6e)
The gear-breakage fix is ROBOTIS's impact guard firmware (V3): a servo that hits
something brakes, then holds softly until the goal comes back past it. To test it
on robots:
- The startup register check sets every servo's Current Limit to 1000 mA (factory
1750) and Goal Current with it. A servo refuses that EEPROM write with torque on,
as on a standing robot an update restarts, so it then waits for the next start.
- The loop names, once a start, every servo whose firmware is not V3, from the vet
book's identity read.
- robot.state carries `impact_guard` per joint (register 66: armed, braking,
holding; null off V3), so `robotctl monitor --json --hz 50` records it. The read
is one 1-byte fast sync read, after the goal positions are written and only on
ticks with a subscriber: a robot nobody records runs the bus it always did.
API v50.
Assisted-by: Claude:claude-opus-5-5
A release that failed its gate and stayed live was journalled as
Outcome::Aborted, which means nothing changed, and `robotctl update log`
printed it as "refused". With auto-rollback off that is now the common
failure, and the switch did happen. It gets its own Outcome::Stuck.
API_VERSION 49: an older client cannot parse a log holding one; an older
updaterd skips the line. duckctl warns of the reconnect on a stuck reply
too, since the daemons restarted.
Assisted-by: Claude:claude-opus-5-5
`[update_gate] auto_rollback` in robotd.toml, default false, a row in
`robotctl configure`. It gates every path that reverts without being
asked:
- the health gate after `update apply`, `select` and `rollback`;
- the boot counter on a trial that never confirmed;
- `robot-boot-check` handing over to `robot-rescue`.
Off, the gate still runs and decides. A release that fails stays live,
reported `Stuck` with `robotctl update rollback <component>` in the
reason; the trial is cleared, and the journal entry is aborted rather
than rolled back, so `known_bad` does not blacklist it. The boot check
names the failed units and the manual `robot-rescue --reboot`, and exits
2. `--dry-run` is unchanged, since the OS slot gate reads it.
Releases now reach robots as tested Yocto images, and a separate daemon
update is the dev-board case, where an unasked revert replacing the
code under whoever holds the robot does more damage than it prevents.
A soft deprecation: the code stays, tested, one setting away.
`updaterd` reads the key from `robotd_config` (new, defaults to
/etc/robot/robotd.toml), both layers, at the moment of deciding, like
`allow_community` and the board. Test fixtures turn it on where they
test what a revert does.
Assisted-by: Claude:claude-opus-5-5
Unplugging servos on a running robot made `robot.health` unhealthy
("N consecutive bus read failures"), while the same robot rebooted was
degraded and named the missing servos. Unhealthy is the verdict that
blames the release: the health gate reverts on it.
A failed sync read cannot say whether a servo went quiet or the read
path is broken. So once a run of failed reads reaches
`max_consecutive_errors`, and every 5 s while it lasts, the loop pings
every servo and the IMU board (`RobotIo::census`). If something is
silent, health is degraded and names it, in the startup wording. If
everything answers, or the ping fails, it stays unhealthy. A good read
clears the census.
`BusHealth::missing` and `ImuHealth::missing` now carry the runtime
census too. API_VERSION 47 -> 48; same fields and shapes, so an older
reader prints the read failures without the names. `robotctl health`
names them on the bus line.
Assisted-by: Claude:claude-opus-5-5
`--allow-dev-daemon` was a command-line flag only, so it could not be
found in `robotctl configure`'s editor. It is now the first row,
`allow_dev_daemon` under `[dev board]`: SPACE/ENTER toggles, u reverts
to off, ^f finds it, and it saves with the robotd.toml edits and adds
updaterd to the restart offer.
Not a key in the editor's model, which is robotd.toml's: the row is a
`dev_daemon::Switch` over the same marker the flag writes. No
updater.toml (a laptop, a simulated duck) means no row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Making a board take branch builds meant copying team.dev.pub into
/etc/robot/trusted_keys under exactly the right name, sed-ing
allow_dev_keys in updater.toml, and restarting updaterd. On the Yocto
image both live in /etc, which an A/B OS update replaces, so the board
quietly stopped being a dev board at the next OS update.
updaterd now carries the dev public key built in (always dev-only), and
dev keys count when `allow-dev-builds` exists in its state_dir, under
/var/lib/robot, which survives OS updates. `sudo robotctl configure
--allow-dev-daemon on|off` writes or removes it and restarts updaterd.
allow_dev_keys = true in updater.toml still works, so provisioned boards
are unchanged; the shipped config keeps it false and nothing ships the
marker.
Needs an updaterd from a release that carries this: an older one
ignores the marker.
Docs: updater-design.md §5.4 owns the mechanism; install-dev,
cheatsheet-dev, dev-push, architecture, deploy READMEs, config comments,
--ref help text, xtask keygen and the dev.yml note point at the command.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The boot check slept until 180 s after boot and looked once. On a Yocto
board every member is up by 16 s, so a healthy boot waited nearly three
minutes for a verdict nothing needed it to wait for — and the OS's own
gate, which copies the deadline, held the OS update page on "rebooting"
for as long.
The timer now starts the script a second in, and it looks every 2 s
until the first of: a member that did not come up (hand over at once;
the predicate is unchanged), every member `active` for 10 s straight
(the release came up — about 25 s in on a Yocto board), or the deadline.
The deadline is `[update_gate] boot_deadline_s` in robotd.toml, 60 s by
default. It is when a boot that never settles is judged, by restart
count, and updaterd's 10 s RestartSec needs about 45 s to show a crash
loop. The script clamps it to 20-300 rather than robotd-params refusing
it, since every daemon reading the file exits on a refused value.
`robotctl configure` says it applies at the next boot.
`--dry-run` now exits 3 where it would have handed over, so
microduck-slot-health can ask the same question instead of copying it.
Assisted-by: Claude:claude-opus-5-5
ignored_note had been put between `run`'s doc comment and `run`, so the
editor's doc described the note instead. And the tests' stray key was
policy.footstep_control, which the footsteps branch knows — they failed
there. A made-up policy.moonwalk is unknown everywhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a layered robot, adoption leaves keys this build does not know in the
base (/etc/robot/robotd.toml), so that is exactly where a stale key from
another branch sits — and the editor only named the user layer's. The base's
are now named with the base's path.
The note is yellow, not the red of an error, and stays in a footer line of
its own instead of vanishing on the first keypress: it is not something the
editor can fix. `--list` prints it in yellow on a terminal, plain otherwise.
adopt_base_edits' doc no longer claims the editor reads the user layer
strictly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robotd already ignores keys this build does not know (named at warn), but
the editor, pad_bindings and the editor's resolved hints parsed strictly.
A key left behind by another branch — policy.footstep_control — meant a
robot that walked fine and a `robotctl configure` that would not open, and
a pad.bind that served the default bindings instead of the file's.
Params::parse is now the one parse every reader goes through. The editor
names the ignored keys on open (status line, stderr for --list) and keeps
them in the file for the branch that reads them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a policy change goes live and a slot or skill starts or stops
running a community policy, robotd writes a `policy` event naming
org/name@revision. It is written at the swap, not when the request is
accepted, so a load that failed to build is never recorded.
Official changes are not logged: the events list is capped, and the
question the book answers is which stranger's network a duck ran.
`robotctl vetbook` gives the new kind its own icon in the diary.
Assisted-by: Claude:claude-opus-5-5
A robot now only fetches policies from pollen-robotics on the Hub.
`[policy] allow_community` in robotd.toml, false by default, lets
`policy.fetch` download from any other org. Refused, it answers
PERMISSION_DENIED naming the key, before any request is made.
The gate is in updaterd's fetch, the one place every transport and
client reaches. updaterd reads the key before each fetch, as it does
the board, so `robotctl configure` applies it live with no restart.
It gates the download only. A slot already pointing at a community
policy keeps running, so turning the key off never changes what a
robot runs at its next start. policy-channel-design.md section 9.2.
Assisted-by: Claude:claude-opus-5-5
Sharing the vet book now asks whether to list the duck in the gallery, the
microduck-vetbook Space's new front page: search by duck or owner, sort by
any stat, filter by mood and badge, a tile opens the card and the owner's
name their Hugging Face profile.
- API v45: vetbook.share takes { listed }; absent or null means unlisted, so
an older client still shares as before, and an older updaterd ignores it.
- updaterd writes share.listed into the book and, when listed, the
microduck-vetbook-gallery tag on the dataset card. The Space finds books by
the tag and believes only share.listed. Sharing unlisted removes both.
- robotctl: s asks y (list) / n (share unlisted) / esc first; the result
popup says whether the duck is listed.
- Space: gallery.py (book -> row, tested), a Hub listing refreshed every
5 minutes with only changed commits re-read, owners' avatars, /api/ducks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`sudo robotctl endurance` walks, stands and sits at random within half a
metre of where it started, and every 10 s logs the charge, every thermal
zone, the CPU clock and throttle, servo temperature and current, and
odometry to /var/lib/endurance/<hostname>-<time>/. It runs as the
robotctl-endurance unit so the ssh session can close; `status` and `stop`
manage it, `--dry-run` logs without moving (the idle-drain baseline).
scripts/endurance-plot.py draws a run on the laptop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>