Pairing safety#
The ESP-Mosaico asks you before it pairs an adapter, keeps a fingerprint of the adapter it paired, and refuses a clock that jumps too far. The S3 build does not change: its pairing prompt is behind CONFIG_OBD_BLE_PAIR_CONFIRM, off by default.
The three rules#
The saved adapter used to be known by its Bluetooth address alone. A device that copies that address could connect with no question, and the Bluetooth stack paired it again by itself when it claimed to have lost its key. Three rules close that on the Mosaico. The S3 build does not change.
Adapter fingerprint. On the first link after you say yes to an adapter, the board saves a fingerprint in NVS. It is one 32-bit hash each for the address type, the advertised name, service UUIDs and maker id, the serial line it uses, and the ATI and AT@1 replies. The car’s protocol is kept too, as a soft field. The VIN is not part of it. No raw reply is stored or logged, only an 8-digit hash id. On every later link the board compares. A match changes nothing. A difference keeps the drive logged, marks it
"adapter_check": {"result": "changed"}in its session file, and gives the R.E.V learner and the pattern model none of its rows. When parked, the board asks “This adapter looks different. Use it?” Use it saves the new fingerprint. Not this one drops the link and leaves the saved adapter alone for 10 minutes. While driving the link is never cut, and the question waits until you park. Fields that change on their own are left out or compared only when both sides have them: the signal, the advert flags, the bytes after the maker id, which packet kind carried a field (advert or scan response), case and spaces in the replies, and a missing AT@1 reply. A different protocol alone (the adapter moved to another car) is noted, not counted as a change.No silent re-pair. In ESP-IDF 6.1 the NimBLE stack starts a new pairing by itself when the adapter refuses the saved key (
BLE_RESTART_PAIRis fixed at 1 inesp_nimble_cfg.h), and theBLE_GAP_EVENT_REPEAT_PAIRINGevent the old code handled never reaches a central. So the board copies the saved key when the link comes up and compares it after encryption. A new key is a re-pair. When parked, the board holds the link with no data and asks “The adapter asks to pair again. Allow?” Allow keeps the new key. Don’t allow, or no answer in 30 s, puts the old key back, drops the link and waits 10 minutes. While driving, the board puts the old key back, keeps the link, marks the rows and logs “Re-pair refused (driving)”. The event handler follows the same table. The session file counts the events.Clock jump guard. When the clock came from Wi-Fi, a new network time more than 24 hours ahead or more than 10 minutes behind is refused, and the events say “Clock sync refused: N min ahead” (or behind). A clock set by hand, an estimated clock and no clock at all are not guarded. The 2026 to 2099 range check stays.
make -C tests/host guard checks the fingerprint, both decision tables and the question, and audits the glue in the sources. make -C tests/host clock checks the jump guard. Pairing with a real LELink has not been checked on this board yet.
Pairing asks you first#
Four changes were merged after the board check, at 06ddf1d. Each is built and host-checked, not yet seen on the board.
Pairing asks you first, and only at a strong signal. On the bench, the board kept trying a neighbour’s adapter at -88 to -90 dBm: 35 connect attempts in about 16 minutes, all failed. With no saved adapter, the old rule took any device that looked like an OBD adapter at -90 dBm or better and saved the first one that answered. Now a new adapter is offered only at -70 dBm or better (
CONFIG_OBD_BLE_PAIR_MIN_RSSI), and nothing is saved until you say yes. The Mosaico shows “OBD adapter found: <name>, signal strong. Use this adapter?” with “Not this one” and “Use this adapter”, and counts down 30 s. The automatic search never replaces a saved adapter. The paired adapter still connects down to -90 dBm, so it works at the edge of range. All of this sits behind one Kconfig switch,CONFIG_OBD_BLE_PAIR_CONFIRM. It is on by default for the Mosaico and off for the ESP32-S3, which keeps its tested rule until the owner tests the new prompt on an S3. With the switch off, the pairing code is compiled out, and the S3 image equals the 4aeff43 S3 image except the build time, the ELF SHA-256 and the image’s checksum and hash (host-checked on the Mac by a section-by-section compare, 68 bytes of the .bin differ, all in those fields). For the S3 the prompt is planned for a later release: “Use <name>?” and “Strong. Tap = use it”, with a BOOT tap within 5 s as the yes. To try it, addCONFIG_OBD_BLE_PAIR_CONFIRM=ytosdkconfig.defaults.esp32s3.make -C tests/host pairchecks the rule with the switch off and on.Driving starts only when the car’s computer answers. The same neighbour’s adapter kept putting the board into Driving for short spells, a median of about 4 s and at most 14 s, because connect attempts counted as Driving. Now the board is Driving only once the car’s computer answers and rows are logged. Searching, connecting and an adapter in a parked car with the engine off keep it Parked.
Model names on the screen. The model’s file shows as “ev-frozen” for E.V and “active-estimator” for R.E.V, where the screen showed a 12-character hash before. The hash stays in the logs, the session files and the USB door.
No text smaller than 16 px. The screen used 12 px and 14 px text in places. NHTSA’s driver-interface guidance (DOT HS 812 360)[14], following ISO 15008, asks for capital letters of at least 16 arcminutes for urgent text and 12 arcminutes for the rest, with 20 arcminutes as the best size. On this 2.16 inch, 480 × 480 screen, 16 px text has capitals about 1 mm tall. At about 65 cm from your eyes, that is about 5 arcminutes. So 16 px is the smallest size the screen uses, and even that is small for a driver. That is why the Drive screen and the alarm banner keep a few big items. The alarm banner’s headline is now 32 px. The Board page now scrolls.