Files

9.9 KiB
Raw Permalink Blame History

Arnavi B2: operator-host USB bootstrap

Qualified 2026-09-26 on macOS, Artery CDC ACM 2e3c:5740, B2 model 231, firmware 0.01. The reader is integrated with independent equipment enrollment. A separate writer now applies a saved portable policy with private backup and readback. A VPS gateway and autonomous operation without the manufacturer cloud are not yet accepted.

Qualified wire operations

Request Purpose Expected response
>I 7\r\n Read model/device information Complete DI, DN, MN, SID0, SID1 lines
>D 15;0\r\n Read configuration >SF="<base64>"\r\n

These are application-level reads, although writing the request bytes to a serial port is necessary. Opening a tty also entails normal OS USB control traffic. No baud rate, tty settings, explicit modem line controls, configuration, firmware, relay or CAN state are changed by this reader.

DI carries model, firmware major and minor (optional fourth subtype field). DN is the device ID; MN is its 15-digit modem IMEI. Model must be 231. The USB serial string and tty path are discovery hints, never device identity.

The vendor labels SID0/1 as ICCID. In the initial observation B2 returned 12 digits for SID0 and 0 for SID1. Store the reported value and length without inventing a prefix or claiming a complete ICCID. 0 means no identifier was reported; it does not prove physical absence of a second SIM. SIM identifiers cannot replace the IMEI in device enrollment.

A 2026-09-28 slot-swap test on the same firmware returned a full 20-digit ICCID through the qualified I 7 read in both slots, matching the internal modem's CCID reply for the same physical MTS SIM. Thus short initial reports are not a universal firmware limit. Keep partial reports distinct from qualified complete identities; this one-card result does not establish all carriers, simultaneous two-SIM association or on-demand IMSI.

The subsequent two-card test established an important exception: with both cards inserted, each qualified I 7 read returned 12 digits for slot 1 and 20 for slot 2, despite both startup SID reports containing 20 digits. This repeated with the cards swapped and on a second read. A 20-digit MegaFon SID also differed from the modem's raw CCID (18 digits followed by ff). Never equate a reported SID's length with canonical completeness. Preserve each source separately and reject incomplete/mismatched identity as an automatic-write precondition. The startup stream consistently distinguished both tested cards.

Configuration framing

After JSON-string and base64 decoding:

body_length:u16be | crc16:u16be | record ...
record = 0x23 | parameter:u8 | value_length:u8 | value[value_length]

The observed CRC matches CRC-16/CCITT-FALSE over the body (polynomial 0x1021, initial 0xffff, no reflection, no final xor). Length must match exactly. Reject CRC errors, truncation, duplicate parameter numbers and unsupported record formats. Integers are big endian, unlike some INTERNAL telemetry fields. Strings may be empty, plain ASCII or carry a trailing NUL. B2 0.01 removes a supplied trailing NUL when writing the SIM 2 access strings. The overlay preserves unchanged raw records and emits changed text without a terminator.

The physical sample had 207 records, a 946-byte body and 950 total bytes. The complete parse and re-encode matched every source byte. Five parameters were absent from the downloaded UI schema, including the manufacturer's configuration host and port. Preserve raw ordered records, including unknown fields; never regenerate the full device configuration from a UI schema and defaults.

The configuration includes credentials. Configuration and Setting omit raw values from repr. Public summary uses an explicit allowlist. Raw responses, identity and configuration snapshots go only into a newly created 0700 session directory with 0600 files. Do not commit these artifacts or return them through ordinary product logs/API responses.

prepare_server_slot is an offline diff builder, not a write command. It changes only a selected slot's host, port and INTERNAL protocol fields, preserving other records and order. Preparing a buffer does not prove that the server is reachable. The writer below owns hardware mutation; endpoint migration still requires a ready receiver and acceptance of an actual device packet.

Reader behavior

usb_read.read_snapshot discovers qualified VID/PID interfaces under the operator Mac's IOService tree. Multiple candidates require explicit selection. It opens the existing tty mode, takes a cooperative OS lease, drains initial diagnostic output for two seconds, then reads identity, settings, and identity again. Both identities and the USB session must agree. Each response has an eight-second deadline and total receive data is bounded to 1 MB. No automatic reconnect, guessed commands, credential attempts or configuration repair runs.

Failures retain partial evidence with a failed receipt. Credentials are not included in error messages. An incomplete or invalid identity prevents the configuration request. Every descriptor is closed. The lease cannot arbitrate applications that ignore cooperative locking. The Fleet equipment service serializes inspection and writes with a shared lease.

Development CLI (not an operator installation flow):

.venv/bin/python -m k1link.device_plugins.arnavi_b2.usb_read --list
.venv/bin/python -m k1link.device_plugins.arnavi_b2.usb_read --output-dir /private/tmp/b2-evidence

The successful result is settings_read, with provisioned: false. It is not "connected to Mission Core." There are no new dependencies or cloud calls. The current host profile supports macOS only. The integrated equipment master uses this reader on the local operator host. Packaging a helper for a remote Core remains a separate delivery boundary.

Evidence and validation

The official published Configurator_251111.exe was inspected statically only, SHA-256 f79af698160ce6009c58608ec5511fab1680eea472ba9d689835fb032f2fc6ec. Relevant PE virtual addresses:

  • SettingsGet registration 0x77b3b6, model interval 5..249, request at 0x77b870.
  • Model switch 0x78c392 / 0x78c3a7 maps model 231 to the B2 label.
  • UpdateTypeInfo 0x787bcc queues >I 7 through 0x78aa08.
  • SF parser starts 0x69bae3; ordered record loop 0x69bb94..0x69c016.
  • MN to _DeviceIMEI mapping 0x6929b7..0x692a59.
  • SID0 to _ModemSIMICCID0 mapping 0x692a63..0x692afc.

Sources: manufacturer downloads, public model-231 metadata. The public schema is research evidence, not a runtime dependency or the current configuration of a physical device. Do not execute the Windows configurator from this module or send device identifiers to its web API.

Synthetic tests cover damaged CRC/length, truncation, duplicate and unknown records, complete-line parsing, wrong model, partial SIM identifier, credential redaction, exact offline changes and USB instance separation. The native module was additionally run against the real device: same IMEI before/after, stable USB session, CRC valid, and configuration hash identical to the independent first read. Private run receipts are held outside the repository.

Next integration boundary

Before applying any server change, prepare the independent gateway profile and deployment, then prove the selected endpoint and actual packet acceptance. Fleet identity must be the device IMEI, with separate vehicle binding and SIM observations. UI enrollment success must depend on reception from this instance by our gateway, not a USB response. The existing manufacturer's startup and periodic configuration checks remain enabled on the qualified unit. Disabling them and proving persistence through restart is a later hardware operation, not a consequence of this read module.

USB policy write acceptance — 2026-09-26

usb_write sends the statically qualified envelope <existing six-digit device password>*CONF*<base64 configuration>\r\n. The official configurator constructs it at 0x777cc0–0x777d12, calls its base64 encoder at 0x66fe98, and handles SR=1 at 0x69b951 before reading settings again. The executable was not run. No firmware, modem-line, relay, reboot or cloud-update command is used. The password is never returned through the API or receipt.

The transaction brackets the existing snapshot with fresh identity including reported SIM identifiers, rejects another firmware/configuration/USB session, fsyncs a private original and target before transmission, then reads the result. Every unchanged record must remain byte-identical. A confirmed different result on the same device permits one rollback to the saved original. Lost I/O produces an uncertain result with no automatic command retry. The operation and a separate post-operation inspection must both succeed before the UI says applied.

A nonblocking macOS tty accepted only 1024 bytes in the first write call. The transport now completes the same frame through bounded writable waits, advancing its offset only over accepted bytes; it never retransmits the accepted prefix. Receipts include expected/accepted byte counts. Synthetic cases cover backpressure, partial writes, timeout, missing ACK, I/O loss, stale identity and rollback. The exact console prompt prefix > may precede a response line; arbitrary embedded or incomplete diagnostic fragments remain rejected.

Real acceptance changed only SIM 2 fields 89, 90 and 91 to the standard MTS access values. The tracker returned SR=1; both immediate and independent readback matched the expected configuration exactly. The earlier terminator mismatch exercised and confirmed restoration of the complete original image. The server route and all other records remained unchanged. Persistence after a power cycle, MTS packet delivery, server migration and manufacturer-cloud removal are separate checks, not implied by successful USB configuration.