TransponderDevice contractv1

Power and firmware

A device can send battery readings, accept signed firmware, or do both. A maker with its own updater can use Transponder for agent interactions and keep distributing firmware independently.

On this page

Choose an update route

  1. Read the protected identity after pairing. If it declares negotiation (identity flag 0x10), establish a session and check for the firmware update feature (bit 9, 0x0200) in WELCOME. A device can offer this feature by itself. Use Control and Status for the session and Media for firmware bytes. Context zero works before the owner selects an agent. A microphone, display, active voice call and face profile are optional. See Establish a session.
  2. Recognize a legacy device by its handshake. An identity without 0x10 uses the four-byte context exchange. Legacy flag 0x08 indicates that the app can query firmware. Enable both legacy notification subscriptions, including Microphone, even with context zero. Subscribing does not start capture. If a peer advertises negotiation but the version ranges do not overlap, end the session and report the mismatch.
  3. Ask the running device. Send FIRMWARE_QUERY, then read target, layout, installed release and capacity from FIRMWARE_INFO. The device ID survives reboot, but its bytes do not encode the hardware model or firmware release. With an absent service or missing response, show “Firmware details unavailable” or the maker’s known support route. A Bluetooth name, a timeout and a missing capability give no basis for sending someone to the S3 updater.
  4. Select a release. Offer Bluetooth installation when a signed package matches the target and layout, is strictly newer than the running release, and fits the reported capacity. A compatible package can come from the app bundle or a file. Zero capacity means there is no writable inactive slot available now. It can also be transient while a newly booted image is awaiting confirmation. Read the information again after startup.

Reference device compatibility

The current public BSOD S3 release is v27, target 2, layout 1. It uses the legacy handshake. Firmware releases and contract versions are numbered independently. The examples below describe this release and the compatible app’s selection rules.

What the device reportsRoute
Original BSOD S3, factory v6, target 2, capacity 0Open the manual updater in desktop Chrome and connect over USB. Its Web Serial preflight verifies the running product, chip and flash layout. On a supported factory layout it installs v27 and provisions two slots for future Bluetooth releases.
Early S3 with an inactive slot, e.g. stock target 3, v7, capacity 4,194,304A strictly newer signed target 3 file that fits can install over Bluetooth. This was verified on hardware from v7 to v8. The public target 2 v27 package reaches an eligible older BSOD target 3 through the USB updater. A target 2 image cannot be sent as a target 3 Bluetooth update.
Unified BSOD S3, target 2, layout 1, positive capacityIf the installed release is older than v27 and the 1,327,856-byte image fits, the bundled v27 release is eligible over Bluetooth. At v27 the device is current. Its next Bluetooth update requires a newer signed target 2 release.
BSOD S3 at v27 with capacity 0Retry the query after startup. If capacity stays zero on a single-slot device, the current public USB release is the same version. The web updater skips it. Provisioning through that route requires a strictly newer compatible release.
RP2350, ESP32-C6, CoreS3 or another maker’s hardwareUse the reported target and layout with a matching published package, or the maker’s own update route. The BSOD Waveshare S3 USB release does not apply to these devices.
Negotiated device without bit 9, unknown model, or no valid firmware responseOmit Bluetooth installation. Report an unavailable session or missing firmware details when appropriate. Leave hardware-specific provisioning to a flow that can positively identify the product.

For example, an early S3’s FIRMWARE_INFO payload 0100 0300 01000000 07000000 00004000 decodes to format 1, target 3, layout 1, release 7 and a 4 MiB slot. Compare all four device values to the release. The number 7 alone cannot tell you whether USB is necessary.

Legacy transition

New device designs should implement the negotiated contract. The legacy feature set is frozen. Keep the existing service for deployed hardware while its upgrade path still depends on it: a factory v6 S3 can migrate over USB to public v27, and v27 still needs a legacy-compatible host to accept a future Bluetooth release. An unpublished development build cannot serve as that upgrade. Before retiring legacy support, distribute a signed successor, keep a compatible host available through migration, and verify the path from the fielded version through reboot. Full compatibility rules are in Versions and capabilities.

Power history

POWER_HISTORY (kind 22) travels device → app on Status, with header flags 0, ID=boot nonce, seq=first sample sequence (>0). Payload begins with current device uptime seconds (u32), followed by 1–16 packed records of exactly 18 bytes each. Sample sequences increase by one. Host receipt time and the uptime delta let the host timestamp a buffered observation even if the device was disconnected.

Offset in recordTypeValue
0u32Sample uptime seconds. Must be ≤ current uptime and at most 172,800 seconds older.
4, 6u16 eachBattery millivolts (0–6,000), USB millivolts (0–7,000).
8u8Bit values 1 reading valid, 2 battery present, 4 USB present, 8 charging, 16 discharging, 32 charge percentage valid. Reserve upper two bits.
9u8Charge 0–100, or 255 unknown. Value 255 requires percentage-valid clear.
10, 11u8 eachBrightness percent (0–100) and frames per second (0–60).
12, 13u8 eachCapture/playback duty and requested-fast-radio duty, 0–100 percent over the measured interval.
14, 16u16 eachActual BLE interval in 1.25 ms units (0–3,200), peripheral latency in events (0–499).

Buffer recent samples within your memory budget. Prefer syncing during idle radio time. Retransmission after reconnect is safe because the app deduplicates by device, boot and sample sequence. Voltage and gauge history alone do not measure current. Omit the capability if your hardware cannot provide this profile.

Signed firmware updates

This profile is specific to the Transponder firmware distribution chain. The shipping app trusts a pinned P-256 release key and a fixed target registry. Other makers can implement the core contract without enrolling firmware, signing with this key or changing bootloaders. Independent signing keys and automatic vendor registration are outside v1. Do not impersonate a registered board or advertise its update target on unrelated hardware.

KindDirectionID / seqPayload
25 FIRMWARE_QUERYApp → device0 / 0Empty. Query active firmware and writable inactive slot size.
26 FIRMWARE_INFODevice → app0 / 0u16 info format 1, u16 registered target, u32 layout (1), u32 installed release, u32 writable inactive-slot capacity in bytes (0 means currently unavailable).
27 FIRMWARE_BEGINApp → devicefresh nonzero operation / 0Exact 128-byte signed manifest.
28 FIRMWARE_CHUNKApp → device, Mediaoperation / image byte offset512 bytes per chunk except the final partial chunk. Advance only on durable STATUS.
29 FIRMWARE_FINISHApp → deviceoperation / 0Empty. Validate the complete image in storage.
30 FIRMWARE_CANCELApp → deviceoperation / 0Empty. Abort before activation.
31 FIRMWARE_STATUSDevice → appoperation / 0u8 phase, u8 error, two zero bytes, u32 committed offset, u32 total size, u32 candidate release.
32 FIRMWARE_ACTIVATEApp → deviceoperation / 0Empty. Activate only a verified, ready image.

Phases 0 idle, 1 receiving, 2 verifying, 3 ready, 4 cancelled, 5 failed, 6 activating. Errors 0 none, 1 unsupported, 2 busy, 3 manifest, 4 signature, 5 target, 6 storage, 7 offset, 8 checksum, 9 timeout. On failure preserve a bootable image and restore access to other features. Never start while capture, pending audio, playback or a face transfer owns shared storage. The reference receiver expires inactive transfers after 120 seconds.

The package is the 128-byte manifest followed by exactly the declared number of image bytes. Offsets 0–7 are ASCII PETOTA1 followed by zero. The manifest version (u16 at 8) is 1. Fields at offsets 10, 12, 16 and 20 are target (u16), layout (u32), nonzero release (u32) and image size (u32). Bytes 24–55 hold the SHA-256 image digest. Bytes 56–63 are zero. Bytes 64–127 hold the P-256 signature (32-byte r then 32-byte s, each big-endian) over the first 64 bytes using SHA-256. Known targets are 1 RP2350, 2 ESP32-S3 external/unified, 3 ESP32-S3 stock legacy target, 4 ESP32-C6 stock, 5 ESP32-C6 external, 6 CoreS3. A registry entry alone does not mean a release exists for it.

Validate signature, manifest, target, layout, actual inactive-slot capacity and newer release before offering an update. The app caps imported images at 4 MiB and rejects a mismatched digest. Keep a single outstanding chunk. A repeated BEGIN with the same ID/manifest returns the last committed offset. A different operation must not replace an active transfer. Ignore holes and acknowledge duplicate committed chunks without rewriting them.

Verify the reboot

  1. Record the protected device ID, boot nonce, selected target and expected release before ACTIVATE. After the receiver reports ready, request activation once. The transfer reaching 100% confirms only that the bytes were sent.
  2. Reconnect to the same authenticated device. Check that the boot nonce changed. Read the new identity and establish a fresh session using its advertised handshake. A release may introduce negotiation.
  3. Send FIRMWARE_QUERY again. Verify the expected running release, target and layout, and a positive inactive-slot capacity. If startup confirmation is pending, keep checking. A return to the prior release means the candidate did not stay active.
  4. Report success after verification. If the pet never reconnects, report that startup is unconfirmed. The BSOD USB provisioner obtains the equivalent proof from the running firmware over serial, including the expected capacity of its new layout.