This script set `Privacy = device`, inherited from microduck_runtime, then changed to `off` after
a board was seen failing every pairing with `DHKey check failed (0x0b)`. Measured again on
2026-08-18 on 50:37:CD:16:2A:39 — freshly flashed Armbian, stock aic8800 driver, none of this
tree installed — the polarity runs the other way: with `device` a `bluetoothctl connect` bonds
first try, /dev/input/js0 appears, the pad survives a power cycle and streams axis events. With
`off` written into the same file on the same card, the identical flow leaves `Paired: no` and the
connect gives up with `le-connection-abort-by-local`, never reaching SMP at all. The same card
was then confirmed on a second Zero 3W.
Both observations are kept, in `configure_bluetooth` and in `configd::bluez`, because they are
different failures needing different answers: a board that fails at the DHKey check is one to try
`off` on, and a board that fails before SMP is one to try `device` on. Take a capture before
changing the value either way.
The board-test fixture now asserts `device` and exercises the upgrade case in the direction that
matters — a board carrying `off` is corrected. `robotctl`'s pairing-failure hint, the
`pair-a-gamepad` page, the cheatsheet and `pad-stack-report` no longer name a value as the one
that works.
What does not change: the reboot. Restarting bluetooth here still leaves the kernel holding hci0
with "No default controller available", confirmed again on the same day — which is the one step
microduck_runtime's installer gets wrong, since it restarts the service and leaves the board
without an adapter.
Assisted-by: Claude:claude-opus-5
Every firmware pattern in this script assumed the kernel prefixes those lines
`Bluetooth: hci0:`, which is true of the in-tree drivers and of nothing else.
A board whose Bluetooth comes from a vendor module logs `aic_btusb: ... fw_ver
0x1a2b` and matches none of them, so the section that names the firmware said
nothing while the answer was two lines away.
So there is a last tier, unfiltered: the last six kernel lines mentioning
Bluetooth at all, labelled as not having matched anything. The fingerprint then
points at the chip line, which is from sysfs and does not care what the driver
calls itself.
Assisted-by: Claude:claude-opus-5
The first run on real hardware, two pads on one board. Both fingerprints came
out byte-identical, which is the tool working. Four of its lines were wrong, or
wrong enough to mislead, and one guess was simply not true.
The bond. It reported `IRK` and nothing else for a pad the very next line showed
connected over LE, because the transport it calls definitive was a lookup of
three section names — `[LongTermKey]`, `[LinkKey]`, `[IdentityResolvingKey]` —
and BlueZ 5.82 evidently writes the LE key under none of them for these bonds.
A curated list cannot tell "stored under another name" from "not stored", so it
no longer curates: every section name in the file is printed verbatim, and the
transport is derived from that. Three spellings count as an LE key, because the
peripheral's own key has its own name and that name was changed once.
The controller firmware. Empty on a board an hour into its boot, run as root:
the kernel's Bluetooth lines were in neither `journalctl -k -b` nor `dmesg`, so
the section that names the hardware said nothing at all. Two answers. Sysfs
gives the driver and the device-tree compatible, which name the radio, need no
root and outlive any log; and when the log has no lines from this boot, earlier
boots are read and each line says so. The three places tried are named rather
than reported as "no lines", which reads as a script that did not look.
`btmgmt` ends its settings line with a space, and it reached the fingerprint —
where trailing whitespace is invisible in the one diff this exists to produce.
Trimmed in `field` now, rather than at the two call sites I happened to think of.
The input dump keeps `S: Sysfs=`, which was the answer to a question the module
list had left open on that board: `hidp` is loaded and `uhid` is not, yet the
pad arrives over LE — so `uhid` is built into the kernel, and the sysfs path is
what says so.
And the joystick node line printed the whole handler list, including `dmcfreq`.
That is the Rockchip memory-frequency governor, which listens to input events
and drives nothing. It is not a pad's driver and does not belong on a line that
claims to name one.
Assisted-by: Claude:claude-opus-5
`pad status` answers five questions about a pad and none of them is which
protocol it is connected over, what firmware it is running, or what BlueZ and
the kernel underneath it are. So the question "these two robots behave
differently with the same pad" had no command: it was eight tools run twice and
read side by side, and half of them are the ones nobody remembers the flags
for.
`pad-stack-report.sh` runs them, in one pass, and logs the result. Kernel and
BlueZ, the adapter's HCI version, the controller firmware the kernel loaded at
boot — which no Bluetooth command reports and which differs between two boards
flashed from different images — whether the bond on disk holds a long-term key
or a link key, what `hcitool con` says the live link is, the pad's PnP revision,
and what the kernel put on the input bus for it.
Transport is reported with its evidence rather than as a verdict on its own.
The bond is the only definitive part: a long-term key means the pad bonded over
LE, a link key means BR/EDR. The live link and the service list are inferences,
and are printed so a disagreement between them is visible instead of resolved.
`--fingerprint` exists because a diff full of timestamps is a diff nobody
reads. It prints the same collection pass reduced to the values that must match
between two boards — no clock, no addresses, no battery level — so two of them
diff to nothing when the stacks are the same. Both modes come out of one pass,
which is what keeps them from disagreeing.
Nothing is required for it to run. A missing `hcitool`, an unreadable
`/var/lib/bluetooth`, no `btmgmt`: each prints as a line saying so, because
"absent" against a value on the other board is exactly the finding this is for.
Root gets the adapter version, the bond keys and the pad's device ids, so it is
worth the sudo, and the report says which of the three it did not get.
Delivery follows `pad-link-test.sh`: scp it from a clone. A diagnostic that
ships in the release is a diagnostic you cannot run on the board whose release
is the suspect.
Assisted-by: Claude:claude-opus-5