<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: oleg-kukharenko</title>
    <description>The latest articles on DEV Community by oleg-kukharenko (@olegkukharenko).</description>
    <link>https://dev.to/olegkukharenko</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4281436%2Feceb4859-5171-4270-84bf-4823088d771c.jpg</url>
      <title>DEV Community: oleg-kukharenko</title>
      <link>https://dev.to/olegkukharenko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/olegkukharenko"/>
    <language>en</language>
    <item>
      <title>FleetPulse: driver-behaviour and vehicle telemetry for a small fleet, from the CAN bus to the dashboard</title>
      <dc:creator>oleg-kukharenko</dc:creator>
      <pubDate>Thu, 03 Dec 2026 22:51:57 +0000</pubDate>
      <link>https://dev.to/olegkukharenko/fleetpulse-driver-behaviour-and-vehicle-telemetry-for-a-small-fleet-from-the-can-bus-to-the-5464</link>
      <guid>https://dev.to/olegkukharenko/fleetpulse-driver-behaviour-and-vehicle-telemetry-for-a-small-fleet-from-the-can-bus-to-the-5464</guid>
      <description>&lt;p&gt;&lt;em&gt;An open-source bench prototype: two ESP32-S3 devices, a Flutter gateway app, a Go server on TimescaleDB and a SvelteKit dashboard, with an on-board kit of about $50 per vehicle&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;A delivery company with 5–20 vans has two questions it cannot answer cheaply: how its drivers drive, and what state its vehicles are in. Harsh braking, harsh acceleration, harsh cornering and impacts show up later as fuel, tyres, brakes, repairs and incidents; odometer, engine hours and fault codes are what service planning needs. Commercial telematics answers both, but it is sold as a contract with a monthly fee per vehicle and a SIM card in every box, which is a poor fit for a fleet of a dozen vans. The constraints I set were: an inexpensive kit, no mandatory SIM in the vehicle because drivers already carry smartphones, no data lost when the driver forgets the phone or drives out of coverage, support for both OBD-II (cars and vans) and J1939 (trucks), and a device that only reads the bus.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;FleetPulse links the vehicle, the driver and the fleet operator in one system. Each vehicle carries two small devices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The logger module&lt;/strong&gt; (ESP32-S3 + ICM-20948 IMU + u-blox GPS) detects harsh braking, harsh acceleration, harsh cornering and impacts from 100 Hz IMU data, tracks trips and keeps every record until the server has acknowledged it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The bus adapter&lt;/strong&gt; (ESP32-S3 + SN65HVD230 CAN transceiver) reads OBD-II or J1939 and sends the decoded values to the module over BLE once a second.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The driver's phone carries the data to the server over BLE. When the phone is gone, the module switches to its own LTE modem. The server stores the data, runs alert rules and risk heuristics, and feeds a live dashboard and the driver app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftrkb9mq4os2fayyfvio5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftrkb9mq4os2fayyfvio5.jpg" alt="Communication channels" width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The rest of the system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Driver app&lt;/strong&gt; (Flutter, Android): BLE gateway with an SQLite offline queue, driver sign-in, a monitor screen with the trip, acceleration chart, CAN data and events, a fleet map, alerts and predictions, self-update. It runs as a foreground service, so it keeps working with the screen off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt; (Go: chi, pgx/v5, sqlc, goose; TimescaleDB): ingest, a WebSocket live hub, an alert engine, risk heuristics, drivers and scoring, a fleet registry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dashboard&lt;/strong&gt; (SvelteKit, Leaflet, Observable Plot): fleet map, vehicle page with live acceleration and bus data, alerts, analytics and a driver leaderboard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simulator&lt;/strong&gt;: nine virtual vans on London streets (OSRM routes), driven by twelve fictional drivers in shifts, sending real batches through the same ingest as the phone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsfkl8r8pbv3y7xgabzzz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsfkl8r8pbv3y7xgabzzz.jpg" alt="Dashboard: the fleet" width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5j8cwguwbonlpuyo60k6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5j8cwguwbonlpuyo60k6.jpg" alt="Dashboard: the real bench module, with bus data from the J1939 emulator" width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpjx40li6wxpuqakkssz6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpjx40li6wxpuqakkssz6.jpg" alt="Driver app: Monitor" width="720" height="1436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key engineering decisions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. The phone is the gateway; LTE takes over after 60 s
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Choice.&lt;/strong&gt; The module's primary uplink is BLE to the driver's phone. An optional LTE modem (SIMCom A7670E in the series design, a SIM7600E-H HAT on the bench) is a second uplink.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternatives.&lt;/strong&gt; A SIM and modem in every vehicle as the only uplink; or the phone only.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; Drivers already carry smartphones, so the base kit needs no data plan. The phone alone is not enough: it is forgotten, switched off or out of range. Once a second the module checks whether a phone is connected and subscribed; after 60 000 ms without one (&lt;code&gt;lte.fallback_after_ms&lt;/code&gt; in &lt;code&gt;config/device.yaml&lt;/code&gt;) it brings up PPP through &lt;code&gt;esp_modem&lt;/code&gt;, takes wall-clock time from NTP and uploads its outbox directly, one batch every 10 s, at most 40 records, events first. When the phone returns, PPP is closed. Without the modem the kit costs about $14 less and the module keeps records until the phone returns.&lt;/p&gt;

&lt;p&gt;The specification first planned the gateway as a PWA using Web Bluetooth in Android Chrome. Chrome drops the GATT link when the tab is in the background or the screen is off, so a phone in a pocket stopped delivering data. The gateway became a native Flutter app with an Android foreground service (ADR 0004).&lt;/p&gt;

&lt;h3&gt;
  
  
  2. An outbox with server acknowledgement and idempotent ingest
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Choice.&lt;/strong&gt; At-least-once delivery from the device, idempotent storage on the server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternatives.&lt;/strong&gt; Fire-and-forget notifications; or exactly-once negotiation between the hops.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; Every hop can fail: BLE, the phone's network, the modem. Each record gets a sequence number (separate counters for events and summaries), a random 32-bit &lt;code&gt;seq_epoch&lt;/code&gt; chosen after an NVS erase and a &lt;code&gt;boot_id&lt;/code&gt;. Records stay in two rings in PSRAM, 1 000 events and 7 200 summaries (two hours at one per second), until a &lt;code&gt;CMD_ACK&lt;/code&gt; frees them. Counters are saved to NVS every 32 records and resume at the saved value plus 32 after a reboot, so numbers are never reused within an epoch. The phone's SQLite queue ignores a record it already holds. The server inserts with &lt;code&gt;ON CONFLICT DO NOTHING&lt;/code&gt; on unique keys, treats a conflict as a replay, answers with the highest stored sequence numbers, and passes only newly inserted rows to the WebSocket and the alert rules, so a replay raises no second alert. On overflow the oldest summaries are dropped, never events.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Two devices linked over BLE instead of one
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Choice.&lt;/strong&gt; A logger module fixed to the body, and a separate bus adapter at the diagnostic connector.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternatives.&lt;/strong&gt; One OBD-II dongle with everything inside.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; The IMU must be fixed rigidly to the body to measure the vehicle's accelerations; a device hanging from the diagnostic connector is not. The connector is also often in an awkward place for GPS and LTE antennas. The module runs NimBLE as a peripheral (to the phone) and a central (to the adapter) at the same time, scans for the adapter's service UUID and ignores adapters weaker than −85 dBm, which belong to another vehicle. The adapter is optional: without it, summaries carry no bus data.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Mounting calibration from gravity and the first confident acceleration
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Choice.&lt;/strong&gt; The module learns its own orientation. "Down" is taken from gravity with the vehicle standing level (button held 2–7 s); "forward" from the first confident acceleration. Until calibrated, only impacts are detected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternatives.&lt;/strong&gt; Require a fixed mounting orientation; or ask the installer to enter it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; An installer will put the box wherever it fits. After calibration, accelerations are split into longitudinal and lateral components, low-pass filtered (2nd-order Butterworth, 4 Hz) and compared with enter/exit thresholds and a minimum duration: 0.40 g enter, 0.30 g exit, 300 ms for braking and acceleration; 0.50/0.40 g, 500 ms for cornering; 1.5 g on a single unfiltered sample for an impact. A peak at 1.5 times the enter threshold or more is CRITICAL. The detector is plain C11 and runs in host tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Configuration as data, code generation, one protobuf contract
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Choice.&lt;/strong&gt; Every tunable value lives in &lt;code&gt;config/*.yaml&lt;/code&gt;, validated by a JSON Schema (&lt;code&gt;additionalProperties: false&lt;/code&gt;, all keys required) and cross-field rules such as &lt;code&gt;exit_g &amp;lt; enter_g&lt;/code&gt; or no GPIO used twice. C headers, sdkconfig fragments, a TypeScript module, a Dart file, the adapter's web page and brand assets are generated from it. The wire format is one protobuf v1 schema, generated for C (nanopb), Go, TypeScript and Dart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternatives.&lt;/strong&gt; Constants in each codebase; Kconfig for the firmware and something else for the rest.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; The same numbers (UUIDs, thresholds, upload policy, colours) are needed in four languages and drift apart as literals. A CI gate regenerates the committed files in memory and fails on any difference. Secrets never go into YAML: a &lt;code&gt;${VAR}&lt;/code&gt; reference is resolved from the environment, and a document containing one cannot be a code-generation source, so a secret cannot be compiled into firmware. Golden vectors check that the C and Go encoders produce identical bytes (ADR 0001).&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Time anchored per boot
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Choice.&lt;/strong&gt; The module has no real-time clock. Records carry &lt;code&gt;uptime_ms&lt;/code&gt; and a &lt;code&gt;boot_id&lt;/code&gt;. The gateway measures &lt;code&gt;clock_offset_ms&lt;/code&gt; (wall time at the midpoint of a &lt;code&gt;DeviceInfo&lt;/code&gt; read minus uptime); the server keeps one anchor per &lt;code&gt;(vehicle, seq_epoch, boot_id)&lt;/code&gt;, and the first value wins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternatives.&lt;/strong&gt; The original design: each batch carried an offset, and summaries were unique on &lt;code&gt;(vehicle_id, time)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; That design broke idempotency. Every reconnect measured a new offset that differed by milliseconds, so a replayed summary got a different &lt;code&gt;time&lt;/code&gt; and was stored twice. Records from a previous boot replayed from the outbox got the current boot's offset and the wrong time. With a fixed anchor per boot, &lt;code&gt;time = uptime_ms + offset&lt;/code&gt; is deterministic per record, and a replay produces the same key. Records of a boot that arrive without an offset get an estimated anchor and are marked as such. The cost: an estimated anchor stays estimated (ADR 0003).&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware
&lt;/h2&gt;

&lt;p&gt;There is no custom PCB; both devices are built from development boards and breakout modules.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fba8vqw16dsl41c9441z2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fba8vqw16dsl41c9441z2.jpg" alt="In-vehicle hardware" width="800" height="1240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The enclosures in the image are renders of OpenSCAD models. Approximate single-unit retail prices, 2026:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Device&lt;/th&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Approx. price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Logger&lt;/td&gt;
&lt;td&gt;ESP32-S3-DevKitC-1 N16R8&lt;/td&gt;
&lt;td&gt;$7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logger&lt;/td&gt;
&lt;td&gt;ICM-20948 breakout&lt;/td&gt;
&lt;td&gt;$5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logger&lt;/td&gt;
&lt;td&gt;u-blox GPS with patch antenna (NEO-M8N / NEO-M10 class)&lt;/td&gt;
&lt;td&gt;$6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logger&lt;/td&gt;
&lt;td&gt;SIMCom A7670E LTE Cat-1 board + antenna&lt;/td&gt;
&lt;td&gt;$14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logger&lt;/td&gt;
&lt;td&gt;DC/DC 12–36 V → 5 V / 3 A, connectors, perfboard, switches&lt;/td&gt;
&lt;td&gt;$5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Adapter&lt;/td&gt;
&lt;td&gt;ESP32-S3-DevKitC-1, SN65HVD230, J1962 plug, buck converter&lt;/td&gt;
&lt;td&gt;$12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Both&lt;/td&gt;
&lt;td&gt;PETG or ASA filament&lt;/td&gt;
&lt;td&gt;$1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Total per vehicle&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;about $50&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A data SIM and its plan are not included. The bus adapter sends only read requests (OBD-II modes 01 and 09, J1939 PGN 59904); there is no code that writes to an ECU.&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Every app build had a new signing key and an empty Gradle cache
&lt;/h3&gt;

&lt;p&gt;All CI runs in pinned containers as the current host user (ADR 0002). The app image mounts the Flutter SDK, the Android SDK and the Gradle cache from the host. Builds worked, but each one downloaded the Gradle dependencies again, and each APK was signed with a different debug key. The second symptom was the visible one: a new build would not install over the previous one (&lt;code&gt;adb install&lt;/code&gt; reports a signature mismatch), and the app's self-update depends on successive builds sharing a key.&lt;/p&gt;

&lt;p&gt;The cause: the JVM does not take its home directory from &lt;code&gt;HOME&lt;/code&gt;. It takes &lt;code&gt;user.home&lt;/code&gt; from the passwd database, and inside the container that did not point at the mounted cache. Gradle therefore created a fresh cache, and the Android Gradle plugin generated a fresh &lt;code&gt;debug.keystore&lt;/code&gt;, in a throwaway directory on every run. Setting &lt;code&gt;HOME&lt;/code&gt; changed nothing. The fix was to name the directories explicitly in &lt;code&gt;ci/ci.yaml&lt;/code&gt;: &lt;code&gt;GRADLE_USER_HOME=/cache/home/.gradle&lt;/code&gt; and &lt;code&gt;ANDROID_USER_HOME=/cache/android-user&lt;/code&gt;, with the host's &lt;code&gt;~/.android/debug.keystore&lt;/code&gt; mounted so that every build is signed with the same key.&lt;/p&gt;

&lt;h3&gt;
  
  
  A leaderboard where normal drivers scored 0
&lt;/h3&gt;

&lt;p&gt;The driver score over 30 days is &lt;code&gt;clamp(100 − 10 × penalty / max(hours, 1), 0, 100)&lt;/code&gt;, where the penalty sums event weights (harsh braking 2, harsh acceleration 2, harsh cornering 1, impact 3). The simulator's driver profiles were first multipliers on the base event rate: calm 0.3, normal 1, aggressive 3. The development overlay raised that base rate to 6 harsh events per hour, so that a few minutes of screen time would show trips and alerts. A normal driver then produced 6 harsh events per hour, 6 to 12 penalty points per hour of driving depending on the mix, and the formula took 60 to 120 points off: normal drivers scored 0, and so did the aggressive ones at three times that rate. The leaderboard could not tell them apart.&lt;/p&gt;

&lt;p&gt;The fix was to stop multiplying. Each profile now has absolute rates while driving: calm 0.3, normal 1 and aggressive 4 harsh events per hour (&lt;code&gt;config/simulator.yaml&lt;/code&gt;, &lt;code&gt;drivers.profiles&lt;/code&gt;), which replace the base rates for a vehicle with a driver. A simulator test compares the calm and aggressive profiles over four simulated hours, and the leaderboard separates the profiles from the data alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results and how they were measured
&lt;/h2&gt;

&lt;p&gt;Measured once on the bench with real hardware and the deployed server; they are not repeated automatically.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bus adapter on a J1939 emulator&lt;/td&gt;
&lt;td&gt;~198 frames/s, 0 bus errors; engine speed, road speed, fuel rate, odometer decoded; engine hours and VIN requested (RTS/CTS); DM1 codes and lamps reported&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Offline buffering&lt;/td&gt;
&lt;td&gt;1 063 records buffered on the module, uploaded on the phone's first connection with no gaps and no duplicates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Phone lost&lt;/td&gt;
&lt;td&gt;after 60 s without the phone the module uploads over LTE; it returns to the phone when it reconnects&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fleet on the dashboard&lt;/td&gt;
&lt;td&gt;10 vehicles: 1 real bench module, 9 simulated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automated tests&lt;/td&gt;
&lt;td&gt;116 (Go unit 37, Go integration 11, firmware host 55, Flutter 8, dashboard 5) plus a hardware-in-the-loop BLE test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;On-board kit&lt;/td&gt;
&lt;td&gt;about $50 per vehicle&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;On the emulator, engine hours were answered in about 1 ms and the VIN came over RTS/CTS in 3 packets; 3 active DM1 fault codes and the amber lamp reached the app and the dashboard. The firmware host tests run the platform-independent C modules under AddressSanitizer and UndefinedBehaviorSanitizer. The hardware-in-the-loop test drives a flashed module over Bluetooth and checks that nothing acknowledged is sent again after a reconnection.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bench prototype.&lt;/strong&gt; It has not been installed in a vehicle. Bus data was verified on a J1939 emulator, not on a real truck or car. The OBD-II mode is covered only by host tests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enclosures and vehicle power&lt;/strong&gt; are designed, not printed and fitted; the bench runs from USB-C.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LTE&lt;/strong&gt; was tested on a SIM7600E-H HAT with one SIM. The A7670E of the series design has not been tested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The fleet is mostly simulated.&lt;/strong&gt; Nine of the ten vehicles on the dashboard are simulated, and their events come from random processes. The detector thresholds have not been validated against real driving.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Predictions are heuristics, not machine learning&lt;/strong&gt;: event counts over time windows, a linear extrapolation of the current rate, and a comparison with the fleet median. Whether they anticipate incidents has not been measured.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security gaps&lt;/strong&gt;: one shared gateway token in the app and the firmware, driver sign-in without SMS verification, public read endpoints (including driver phone numbers), an unencrypted BLE link, release builds signed with a development key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android only&lt;/strong&gt;; no iOS. No load test beyond 10 vehicles.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Repository and how to run it
&lt;/h2&gt;

&lt;p&gt;The code is at &lt;a href="https://github.com/oleg-kukharenko/fleetpulse" rel="noopener noreferrer"&gt;github.com/oleg-kukharenko/fleetpulse&lt;/a&gt; under the Apache License 2.0, published as is, without support. The simulated fleet runs without any hardware (Docker with Compose, Bash, Python 3 with PyYAML):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/oleg-kukharenko/fleetpulse &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; fleetpulse
cp deploy/.env.example deploy/.env
tools/stack.sh --profile demo --profile web up -d --build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then open &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt;; nine simulated vans appear in London within 2–3 minutes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2pwwkmhlm25kbpymjbzn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2pwwkmhlm25kbpymjbzn.jpg" alt="Dashboard: drivers" width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I take on paid embedded and backend projects: &lt;a href="mailto:info@starflow.team"&gt;info@starflow.team&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>esp32</category>
      <category>iot</category>
      <category>go</category>
      <category>flutter</category>
    </item>
  </channel>
</rss>
