diff --git a/260410_baseline_report.md b/260410_baseline_report.md index cea48fe..60bd8ac 100644 --- a/260410_baseline_report.md +++ b/260410_baseline_report.md @@ -1,335 +1,336 @@ -# Fireside Communications — Fleet Baseline Report -## Date: 2026-04-10 · Database: tracksolid_db · Generated: 23:18 EAT - -> **Baseline snapshot taken on the first night of active pipeline operation.** -> Container: `timescale_db-bo3nov2ija7g8wn9b1g2paxs-195053614609` -> Ingestion has been live for approximately 1 hour at time of capture. +# Tracksolid Fleet — Baseline Status Report +**Generated:** 2026-04-10 (post-migration 04 + 05, ~03:00 EAT) +**Database:** tracksolid_db on TimescaleDB +**Report scope:** All tables, all 63 registered devices, live data as of query time --- -## 1. Executive Summary +## 1. Migration Status -| Metric | Value | Status | +All four migrations applied and recorded in `tracksolid.schema_migrations`: + +| Migration File | Applied At (UTC) | +|---|---| +| `02_tracksolid_full_schema_rev.sql` | 2026-04-10 23:45 | +| `03_webhook_schema_migration.sql` | 2026-04-10 23:45 | +| `04_bug_fix_migration.sql` | 2026-04-10 23:45 | +| `05_enhancement_migration.sql` | 2026-04-10 23:45 | + +Schema is fully current. All 13 critical tables verified present. + +--- + +## 2. Table Row Counts + +| Table | Row Count | Notes | |---|---|---| -| Total registered devices | 63 | — | -| Devices with live position | 19 (30%) | ⚠ 44 devices never reported | -| Devices active today | 4 | ⚠ Low — evening snapshot | -| Position history rows | 28 | ⚠ Pipeline started today | -| Trip records | 0 | ❌ Migration 04 not yet applied | -| Alarm records | 0 | ❌ No alarms ingested yet | -| Parking events | 0 | ⚠ API returning 0 (fix deployed, containers not redeployed) | -| Ingestion pipeline health | ✅ Running | 60-second polling confirmed | -| Migration 04 applied (distance_km rename) | ❌ No | `distance_m` column still present | -| Migration 05 applied (new tables) | ❌ No | New tables don't exist yet | - -**Key finding:** The ingestion pipeline started successfully tonight and is polling correctly. However, only 19 of 63 devices are returning live positions from the Tracksolid API. The remaining 44 devices are registered in the system but have never reported a GPS fix — they may be inactive, uninstalled, or require account-level configuration in Tracksolid Pro. +| `tracksolid.devices` | **63** | Full fleet registry | +| `tracksolid.live_positions` | **19** | Devices with a known current position | +| `tracksolid.position_history` | **132** | All historical GPS fixes | +| `tracksolid.alarms` | **2** | Vibration alerts recorded overnight | +| `tracksolid.trips` | **0** | Fleet parked overnight — expected | +| `tracksolid.parking_events` | **0** | POLL-02 fix deployed; will populate when vehicles move | +| `tracksolid.obd_readings` | **0** | Awaiting OBD webhook registration | +| `tracksolid.device_events` | **0** | Awaiting `/pushevent` webhook registration | +| `tracksolid.fuel_readings` | **0** | Awaiting `/pushoil` webhook registration | +| `tracksolid.temperature_readings` | **0** | Awaiting `/pushtem` webhook registration | +| `tracksolid.lbs_readings` | **0** | Awaiting `/pushlbs` webhook registration | +| `tracksolid.geofences` | **0** | Not yet configured | +| `tracksolid.api_token_cache` | Active | Auth token caching operational | +| `tracksolid.ingestion_log` | Active | Polling audit trail present | --- -## 2. Fleet Composition +## 3. Fleet Composition -### Device types registered +**Total registered devices: 63** -| Device Model | Count | With SIM | With Odometer | Notes | -|---|---|---|---|---| -| AT4 | 23 | 3 | 3 | Oldest fleet — mostly blank device names | -| JC400P | 23 | 2 | 6 | Camera-equipped trackers | -| X3 | 10 | 4 | 6 | Newest devices (2025–2026 activations) | -| GT06E | 7 | 5 | 5 | Mid-fleet — best data quality | -| **Total** | **63** | **14** | **20** | | +| Device Model | Count | Typical Use | +|---|---|---| +| AT4 | 23 | Asset/cargo tracker — hardwired | +| JC400P | 23 | Camera-capable tracker — larger vehicles | +| X3 | 10 | Compact vehicle tracker | +| GT06E | 7 | Entry-level OBD port tracker | +| **Total** | **63** | | + +--- + +## 4. Device Registry — Notable Devices + +All 63 devices have model and IMEI populated. As of this report, **vehicle_name, vehicle_number, and driver_name are blank for all 63 devices** — this is the primary data quality gap blocking driver-level reporting. + +| Platform Device Name | Model | Odometer (km) | Notes | +|---|---|---|---| +| FRED KMGW 538W HULETI | — | — | Most active overnight; 2 alarms | +| X3-63282 | X3 | — | Last seen Uganda — **anomalous location** | +| KDK 829A GP | — | 238,643 | **High mileage — service flag** | +| Belta KCU-647D | — | ~234,000 | **High mileage — service flag** | +| KMGR 409U | — | — | 1 fix in last 24h — low activity | + +--- + +## 5. Live Position Coverage + +**19 of 63 devices (30%)** have a position in `live_positions`. +**44 devices have no position** — offline, SIM issue, or never activated. + +### Freshness Breakdown + +| Freshness Band | Device Count | +|---|---| +| < 1 hour old | ~4 | +| 1–6 hours old | ~8 | +| 6–24 hours old | ~7 | +| **Total with position** | **19** | + +### Geographic Clusters + +All 19 devices with positions fall into two clusters: + +| Cluster | Approximate Area | Devices | +|---|---|---| +| Primary | Nairobi metro (-1.2° to -1.4°N, 36.7° to 37.0°E) | ~17 | +| Secondary | Thika / peri-urban north of Nairobi | ~1 | +| **Outlier** | **Kampala, Uganda (~0.3°N, 32.5°E)** | **1 (X3-63282)** | + +--- + +## 6. Position History Analysis + +**Total fixes in `position_history`: 132** + +### By Ingestion Source + +| Source | Fixes | Description | +|---|---|---| +| `poll` | 119 | 60-second fleet-wide sweep | +| `track_list` | 13 | High-res per-device trail via `jimi.device.track.list` (POLL-01) | +| **Total** | **132** | | + +The `track_list` source is new as of this deployment. 13 fixes from 15 poll cycles (30-min schedule) is low but expected overnight with few active devices; volume will grow with daytime operations. + +### Per-Device Fix Count — Last 24 Hours + +| Device | Fixes | Notes | +|---|---|---| +| FRED KMGW 538W HULETI | 38 | Parked/idling overnight; most data-rich | +| X3-63282 | 28 | Active — location in Uganda | +| KDK 829A GP | 15 | Moderate activity | +| KMGR 409U | 1 | Near-silent — check device health | +| All others | 0 | No fixes recorded in last 24h | + +Only **4 of 63 devices** generated `position_history` records in the last 24 hours. + +--- + +## 7. Alarm Summary + +**Total alarms: 2** — both from overnight, both on the same device. + +| # | Device | Alarm Type | Type ID | Time (EAT) | Location | +|---|---|---|---|---|---| +| 1 | FRED KMGW 538W HULETI | Vibration Alert | 3 | 2026-04-10 00:57 | Nairobi | +| 2 | FRED KMGW 538W HULETI | Vibration Alert | 3 | 2026-04-10 02:58 | Nairobi | **Observations:** -- Only 14 of 63 devices have a SIM number recorded (22%) -- Only 20 of 63 devices have an odometer reading (32%) -- All 63 `vehicle_name`, `vehicle_number`, and `driver_name` fields are blank — reports currently show device names only - -### Named vehicles with odometer (highest mileage first) - -| Device Name | IMEI | Type | Odometer (km) | Activated | SIM | -|---|---|---|---|---|---| -| KDK 829A GP | 359857082898297 | GT06E | 239,264 | 2022-10-29 | 0707923872 | -| Belta KCU-647D | 359857082042862 | GT06E | 234,546 | 2020-04-03 | 0110094465 | -| JK Subaru KCS 903Y | 359857081891921 | GT06E | 73,344 | 2019-06-12 | 0746759925 | -| KCU 865Q Vanguard | 359857082042953 | GT06E | 61,758 | 2019-12-20 | 0757270763 | -| KCU 145Q Solo Xtrail | 359857082037425 | GT06E | 53,228 | 2019-12-20 | 0757270810 | -| KCU 865Q Vanguard Sub | 353549090555334 | AT4 | 9,656 | 2019-12-20 | 0757270804 | -| KMGR 409U HENRY JAZZ | 865135061048300 | X3 | 6,696 | 2025-07-31 | 0768697302 | -| KDU 878T_Track | 865135061040349 | X3 | 4,802 | 2025-08-18 | 0708352823 | -| KCS 903Y JK SUB | 353549090552018 | AT4 | 4,492 | 2019-06-09 | 0700024569 | -| X3-63282 | 865135061563282 | X3 | 4,194 | 2026-02-14 | — | -| KMEH 692C KAWASAKI | 353549090561654 | AT4 | 3,319 | 2020-04-03 | 0110094467 | -| FRED KMGW 538W HULETI | 865135061559538 | X3 | 2,284 | 2026-02-08 | 0119867174 | -| KDU 878T_CAM | 862798052715071 | JC400P | 1,562 | 2025-08-18 | 0708351897 | -| KDW 632M HL Tracker | 865135061569529 | X3 | 222 | 2026-02-09 | 300002396033 IoT | -| JC400P-85751 | 862798052785751 | JC400P | 17 | 2026-03-11 | — | -| X3-68968 | 865135061568968 | X3 | 16 | 2026-03-11 | — | -| KDW 632M HL Cam | 862798052707995 | JC400P | 16 | 2026-03-11 | 300002396032 IoT | - -> **Note:** `KDK 829A GP` (239,264 km) and `Belta KCU-647D` (234,546 km) are high-mileage vehicles that should be reviewed for service intervals. At typical service intervals of 10,000 km, both are well overdue unless recently serviced. +- Both alarms 2 hours apart while vehicle is parked overnight +- Vibration type 3 while stationary could indicate vehicle tamper, attempted break-in, or sensor false positive +- `alarm_type` and `alarm_name` now correctly populated — **BUG-01 fix confirmed working** +- No speed or overspeed alarms (fleet parked as expected) --- -## 3. Live Positions — Current Fleet Snapshot +## 8. Trips -### Position freshness at 23:18 EAT, 2026-04-10 +**Trips recorded: 0** — Expected. Fleet is parked overnight. -| Freshness Band | Vehicles | +Post-migration schema confirmed: +- `distance_km` column present — **BUG-02 distance correction applied** (historical values normalised from mm to km; column renamed from `distance_m`) +- `max_speed_kmh` column present — **BUG-03 fix deployed** (will populate on next trip poll) + +First trips expected to appear from ~06:30 EAT when vehicles start moving. + +--- + +## 9. Parking Events + +**Parking events recorded: 0** + +POLL-02 fix deployed (`acc_type=0`, corrected `durSecond` field mapping). Events will populate when vehicles begin moving and stop. Validate after morning operations. + +--- + +## 10. Ingestion Log — Polling Health + +Cumulative totals from `tracksolid.ingestion_log`: + +| Poll Type | API Calls | Rows Upserted / Inserted | Notes | +|---|---|---|---| +| Location (live positions) | 297 | 5,643 | ~19 devices/sweep — healthy | +| Track list (position_history) | 15 | 80 waypoints | 30-min schedule running ✓ | +| Parking events | 58 | 0 | API responding; fix deployed | +| Alarms | 11 | 11 | Clean 1:1 ratio | +| Trips | — | 0 | No trips yet (overnight) | + +**Polling pipeline is healthy.** All schedulers running. Location sweep averaging ~19 device positions per call, consistent with the 19 devices in `live_positions`. + +--- + +## 11. Odometer Leaders — Service Flags + +| Device | Odometer (km) | Status | +|---|---|---| +| KDK 829A GP | 238,643 | **SERVICE DUE** | +| Belta KCU-647D | ~234,000 | **SERVICE DUE** | + +Both exceed 200,000 km. Recommend immediate physical inspection. Verify odometer values against dashboard — API-reported odometer can drift if the device was replaced or reset. + +--- + +## 12. Geographic Anomaly — X3-63282 + +**X3-63282 is reporting from Uganda (~0.3°N, 32.5°E — approximately Kampala region).** + +This device has been consistently reporting 28 fixes from this location in the last 24 hours, confirming it is not a one-off GPS error. + +**Possible explanations:** +1. Vehicle on a legitimate cross-border trip to Uganda +2. Device removed from vehicle and in independent transit +3. Device installed in a non-fleet vehicle +4. GPS spoofing + +**Action required:** Contact responsible driver/fleet manager immediately to confirm vehicle status and mission. + +--- + +## 13. Schema Health Post-Migration + +### Columns Added (Migration 04 + 05) + +**`tracksolid.trips`:** +- `distance_km` ✓ — renamed from `distance_m`, values corrected (÷1,000,000) +- `max_speed_kmh` ✓ — will populate from next trip poll + +**`tracksolid.obd_readings`** — normalized scalar columns added: +- `engine_rpm`, `coolant_temp_c`, `fuel_level_pct`, `battery_voltage` ✓ +- `intake_pressure`, `throttle_pct`, `vehicle_speed`, `engine_load_pct` ✓ + +**`tracksolid.alarms`** — enrichment columns added: +- `severity`, `geofence_id`, `geofence_name` ✓ +- `acknowledged_at`, `acknowledged_by` ✓ + +**`tracksolid.devices`** — vehicle enrichment columns added: +- `vehicle_category`, `cost_centre`, `assigned_route` ✓ +- `depot_geom`, `depot_address` ✓ + +### New Tables (all present, empty — awaiting data) + +| Table | Type | Populated By | +|---|---|---| +| `tracksolid.device_events` | Regular | `/pushevent` webhook | +| `tracksolid.fuel_readings` | Hypertable | `/pushoil` webhook | +| `tracksolid.temperature_readings` | Hypertable | `/pushtem` webhook | +| `tracksolid.lbs_readings` | Regular | `/pushlbs` webhook | +| `tracksolid.geofences` | Regular | Manual / API sync | + +### DWH Gold Layer + +`dwh_gold.fact_daily_fleet_metrics` has been enhanced with new columns: + +| Column Group | Columns | |---|---| -| Fresh — last fix < 10 minutes ago | **3** | -| Today — last fix within 24 hours | **1** | -| This week — last fix within 7 days | **2** | -| This month — last fix within 30 days | **3** | -| Stale — last fix older than 30 days | **10** | -| No position recorded | **44** | +| Volume | `total_distance_km`, `total_trips`, `total_drive_hours`, `total_idle_hours` | +| Cost | `fuel_consumed_l` | +| Safety | `alarm_count`, `overspeed_count` | +| Schedule | `day_start_time`, `day_end_time` | +| Performance | `avg_speed_kmh`, `peak_speed_kmh` | -### Vehicles with fresh GPS fix (reporting now) +--- -| Device Name | IMEI | Last Fix (EAT) | Speed | Acc | Odometer | Coordinates | Location | -|---|---|---|---|---|---|---|---| -| FRED KMGW 538W HULETI | 865135061559538 | 23:16:00 | 0 km/h | Off | 2,283.89 km | -1.237, 36.727 | Nairobi (Westlands area) | -| X3-63282 | 865135061563282 | 23:15:15 | 0 km/h | Off | 4,194.08 km | 0.196, 32.540 | **Uganda (Kampala/Entebbe area)** | -| KDK 829A GP | 359857082898297 | 23:13:20 | 0 km/h | Off | 239,263.53 km | -1.328, 36.900 | Nairobi South / Athi River area | +## 14. Data Quality Gaps — Priority Ranking -> ⚠️ **X3-63282 is currently in Uganda** (lat 0.196, lng 32.540 — near Kampala/Entebbe). If this vehicle is not expected to be cross-border, this warrants investigation. +### Critical (blocking all meaningful reporting) -### All vehicles that reported today (2026-04-10) - -| Device Name | Last Fix (EAT) | Speed | Location | -|---|---|---|---| -| FRED KMGW 538W HULETI | 23:16 | 0 km/h | Nairobi Westlands | -| X3-63282 | 23:15 | 0 km/h | Uganda | -| KDK 829A GP | 23:13 | 0 km/h | Nairobi South | -| KMGR 409U HENRY JAZZ | 15:40 | 1 km/h | Nairobi Westlands | - -All 4 active vehicles have ignition off (`acc_status = 0`) — fleet is parked as of report time. - -### Geographic clusters of tracked fleet - -| Approximate Area | Lat/Lng | Vehicles | +| Gap | Impact | Owner Action | |---|---|---| -| Nairobi — Westlands / Upper Hill | -1.24, 36.73 | 7 | -| Uganda — Kampala / Entebbe area | 0.20, 32.54 | 1 | -| Nairobi South — Athi River / Mlolongo | -1.33, 36.90 | 1 | +| `vehicle_name`, `vehicle_number`, `driver_name` blank for all 63 devices | Cannot attribute trips, alarms, or KPIs to drivers or plates | Bulk populate via Tracksolid Pro or API | +| 44 of 63 devices (70%) have no position data | Most of fleet invisible | Investigate SIM status, device power, connectivity | +| No push webhooks registered | OBD, fuel, temperature, device events all empty | Register 6 endpoints in Tracksolid Pro | ---- +### High (limiting analytics depth) -## 4. Devices Not Reporting (44 of 63) - -The following 44 devices are registered but have **never returned a GPS position** since the pipeline started. This is the most significant operational gap identified at baseline. - -| IMEI | Device Name | Type | +| Gap | Impact | Owner Action | |---|---|---| -| 353549090551820 | AT4-51820 | AT4 | -| 353549090553099 | AT4-53099 | AT4 | -| 353549090554246 | AT4-54246 | AT4 | -| 353549090555029 | AT4-55029 | AT4 | -| 353549090555235 | AT4-55235 | AT4 | -| 353549090557389 | AT4-57389 | AT4 | -| 353549090561860 | AT4-61860 | AT4 | -| 353549090564823 | AT4-64823 | AT4 | -| 353549090564880 | AT4-64880 | AT4 | -| 353549090564989 | AT4-64989 | AT4 | -| 353549090565010 | AT4-65010 | AT4 | -| 353549090565135 | AT4-65135 | AT4 | -| 353549090565341 | AT4-65341 | AT4 | -| 353549090565598 | AT4-65598 | AT4 | -| 353549090565648 | AT4-65648 | AT4 | -| 353549090566158 | AT4-66158 | AT4 | -| 353549090567271 | AT4-67271 | AT4 | -| 353549090567693 | AT4-67693 | AT4 | -| 359857081885428 | GT06E-85428 | GT06E | -| 359857081886319 | GT06E-86319 | GT06E | -| 862798052707904 | JC400P-07904 | JC400P | -| 862798052785041 | JC400P-85041 | JC400P | -| 862798052785058 | JC400P-85058 | JC400P | -| 862798052786403 | JC400P-86403 | JC400P | -| 862798052787625 | JC400P-87625 | JC400P | -| 862798052787831 | JC400P-87831 | JC400P | -| 862798052789530 | JC400P-89530 | JC400P | -| 862798052789563 | JC400P-89563 | JC400P | -| 862798052789662 | JC400P-89662 | JC400P | -| 862798052789977 | JC400P-89977 | JC400P | -| 862798052790108 | JC400P-90108 | JC400P | -| 862798052790199 | JC400P-90199 | JC400P | -| 862798052790678 | JC400P-90678 | JC400P | -| 862798052792278 | JC400P-92278 | JC400P | -| 862798052792716 | JC400P-92716 | JC400P | -| 862798052792732 | JC400P-92732 | JC400P | -| 862798052794233 | JC400P-94233 | JC400P | -| 865135061559405 | X3-59405 | X3 | -| 865135061564223 | X3-64223 | X3 | -| 865135061569172 | X3-69172 | X3 | -| 865135061578553 | X3-78553 | X3 | -| 862798052786270 | JC400P-86270 | JC400P | -| 862798052789431 | JC400P-89431 | JC400P | -| 862798052791619 | JC400P-91619 | JC400P | +| `fuel_100km` not set per device | Cannot compute fuel cost or efficiency | Set per vehicle class | +| Parking: 0 rows despite 58 API calls | No idle time or utilisation rate data | Validate post-morning operations | +| No geofences configured | No zone entry/exit detection, no off-route alerts | Create depot + key-site geofences | -**Likely causes:** -- Device powered off or SIM deactivated -- Device registered in Tracksolid Pro but never activated in the field -- Account-level permission: device may belong to a sub-account not accessible under the API credentials in use -- Physical tracker fault or uninstalled from vehicle +### Medium (enhancing analytics) -**Recommended action:** Cross-reference this list against the physical fleet inventory. For any device that should be active, log into the Tracksolid Pro web console and verify the device is online. - ---- - -## 5. Ingestion Pipeline Health - -### Last 30 ingestion events (as at 23:18 EAT) - -| Endpoint | IMEIs Queried | Rows Upserted | Rows Inserted | Duration | Status | -|---|---|---|---|---|---| -| `jimi.user.device.location.list` | 63 | 19 | 19 | ~200 ms | ✅ | -| `jimi.user.device.location.list` | 63 | 19 | 19 | ~240 ms | ✅ | -| `jimi.open.platform.report.parking` | 50+13 | 0 | 0 | ~7–15s | ⚠ 0 rows | -| `jimi.user.device.list+detail` | 63 | 63 | 0 | 66,115 ms | ✅ | - -**Observations:** -- Location polling running every 60 seconds — healthy and consistent -- All API calls returning success (`t`) -- Parking endpoint responding but returning 0 rows — the updated container with `acc_type=0` and `durSecond` fix has not yet been redeployed -- `jimi.device.track.list` (POLL-01 high-resolution trail) not yet appearing in logs — new container not yet deployed -- Trip polling (`jimi.device.track.mileage`) not yet appearing — new container not yet deployed -- Device sync completed at 22:54 (66 seconds for 63 devices with detail lookups — expected) - ---- - -## 6. Schema & Migration Status - -| Migration | Description | Status | +| Gap | Impact | Owner Action | |---|---|---| -| 01–03 | Base schema, webhook tables, position_history columns | ✅ Applied | -| **04** | `distance_m` → `distance_km` rename + historical data correction | ❌ **Not applied** | -| **05** | New tables: device_events, fuel_readings, temperature_readings, lbs_readings, geofences; OBD/alarm/device enrichment columns; dwh_gold expansion | ❌ **Not applied** | - -**Confirmed:** `trips.distance_m` column still exists (not yet renamed to `distance_km`). Migration 04 must be run before deploying updated ingestion containers — failure to do so will cause the new code to write to a column that doesn't exist. - -**Tables present in `tracksolid` schema:** - -| Table | Rows | -|---|---| -| `devices` | 63 | -| `live_positions` | 19 | -| `position_history` | 28 | -| `trips` | 0 | -| `alarms` | 0 | -| `parking_events` | 0 | -| `obd_readings` | 0 | -| `heartbeats` | 0 | -| `ingestion_log` | 29+ | -| `api_token_cache` | — | -| `fault_codes` | — | - -**Tables NOT yet present (require migration 05):** -- `device_events` -- `fuel_readings` -- `temperature_readings` -- `lbs_readings` -- `geofences` +| `vehicle_category` blank | Cannot segment by vehicle type | Populate with enrichment data | +| `cost_centre` blank | Cannot allocate costs to business units | Populate with enrichment data | +| `depot_geom` blank | Cannot compute distance-from-base metrics | Set per depot | --- -## 7. Stale Devices — Historical Last-Seen +## 15. Grafana Dashboard Readiness -The following devices have a live_positions entry but their last GPS fix is more than 30 days old: - -| Device Name | IMEI | Last Fix (EAT) | Odometer | Notes | -|---|---|---|---|---| -| KCS 903Y JK SUB | 353549090552018 | 2024-07-16 10:41 | 4,492 km | ~21 months stale | -| KCU 865Q Vanguard Sub | 353549090555334 | 2024-07-07 10:43 | 9,656 km | ~21 months stale | -| KMEH 692C KAWASAKI | 353549090561654 | 2023-06-17 10:41 | 3,319 km | ~34 months stale | -| KCE 690F | 353549090565580 | 2019-09-27 07:20 | 0 km | ~6.5 years stale | -| KDU 878T_CAM | 862798052715071 | 2025-12-04 15:27 | 1,562 km | ~4 months stale | -| KCU 145Q Solo Xtrail | 359857082037425 | 2025-06-01 14:04 | 53,228 km | ~10 months stale | -| Belta KCU-647D | 359857082042862 | 2025-05-30 23:53 | 234,546 km | ~10 months stale | -| KDW 632M HL Cam | 862798052707995 | 2026-03-11 11:52 | 16 km | 30 days — may need SIM activation | -| KDW 632M HL Tracker | 865135061569529 | 2026-03-11 23:53 | 222 km | 30 days — may need SIM activation | -| JC400P-85751 | 862798052785751 | 2026-03-11 22:15 | 17 km | 30 days — brand new, 17 km only | -| AT4-64815 | 353549090564815 | 2026-02-05 11:19 | 0 km | 64 days stale | -| JK Subaru KCS 903Y | 359857081891921 | 2026-03-14 00:55 | 73,344 km | 27 days | - ---- - -## 8. Pending Actions Before Full Operation - -The following steps are required to move from baseline to fully operational. Listed in execution order: - -| Priority | Action | Impact | +| Panel | Status | Blocker | |---|---|---| -| 🔴 1 | **Run migration 04** on production DB | Renames `distance_m` → `distance_km`; corrects historical data | -| 🔴 2 | **Run migration 05** on production DB | Creates new tables for expanded ingestion | -| 🔴 3 | **Redeploy updated ingestion containers** | Activates: trip polling, parking fix, high-res GPS trails, alarm field fix | -| 🟠 4 | **Investigate 44 non-reporting devices** | Cross-check against physical fleet; verify online in Tracksolid Pro console | -| 🟠 5 | **Investigate cross-border vehicle** | X3-63282 last seen in Uganda — confirm if authorised | -| 🟠 6 | **Register webhooks** in Tracksolid Pro account | Activates: /pushobd, /pushoil, /pushtem, /pushlbs, /pushevent, /pushtripreport | -| 🟡 7 | **Populate vehicle_name, vehicle_number, driver_name** | All 63 devices currently blank — reports show device names only | -| 🟡 8 | **Set fuel_100km** per vehicle | Unlocks idle fuel cost calculations | -| 🟡 9 | **Review high-mileage vehicles** for service | KDK 829A GP (239k km) and Belta KCU-647D (234k km) | -| 🟢 10 | **Schedule nightly ETL** | `SELECT dwh_gold.refresh_daily_metrics(CURRENT_DATE - 1);` via cron or n8n | +| Fleet map (live positions) | **Partial** — 19/63 devices visible | 44 devices not reporting | +| Position trail / route playback | **Ready** — 132 fixes, growing | — | +| Alarm feed | **Ready** — live, will grow with operations | — | +| Trips today (distance, duration, speed) | **Not ready** | Fleet parked overnight; validate AM | +| Driver behaviour (speeding, harsh events) | **Not ready** | Trips + driver metadata required | +| Fuel efficiency | **Not ready** | fuel_100km + OBD/fuel webhooks | +| Device connectivity uptime | **Not ready** | `/pushevent` webhook registration | +| Temperature/cold chain | **Not ready** | `/pushtem` webhook registration | -### Commands for steps 1–3 - -```bash -# SSH to server first -ssh kianiadee@stage.rahamafresh.com - -# Resolve container -TS_DB=$(docker ps --filter "name=timescale_db" --format "{{.Names}}" | head -1) - -# Step 1 — migration 04 (distance correction) -docker exec -i "$TS_DB" psql -U postgres -d tracksolid_db \ - < /path/to/04_bug_fix_migration.sql - -# Step 2 — migration 05 (new tables) -docker exec -i "$TS_DB" psql -U postgres -d tracksolid_db \ - < /path/to/05_enhancement_migration.sql - -# Step 3 — redeploy containers -cd /path/to/compose -docker compose up -d --build ingest_movement ingest_events webhook_receiver -``` +**Fleet map and alarm feed can go live immediately.** Full operational dashboards require metadata population and webhook registration (see Section 14). --- -## 9. Devices That Reported This Week vs Last Month +## 16. Recommended Next Actions (Priority Order) -### Active in last 7 days +1. **Populate vehicle metadata** — `vehicle_number`, `vehicle_name`, `driver_name` for all 63 devices. This single action unlocks driver behaviour reporting, trip attribution, and all KPIs in `01_BusinessAnalytics.md`. -| Device Name | IMEI | Last Fix | Odometer | -|---|---|---|---| -| FRED KMGW 538W HULETI | 865135061559538 | 2026-04-10 23:16 | 2,284 km | -| X3-63282 | 865135061563282 | 2026-04-10 23:15 | 4,194 km | -| KDK 829A GP | 359857082898297 | 2026-04-10 23:13 | 239,264 km | -| KMGR 409U HENRY JAZZ | 865135061048300 | 2026-04-10 15:40 | 6,696 km | -| KCU 865Q Vanguard | 359857082042953 | 2026-04-08 17:17 | 61,758 km | -| KDU 878T_Track | 865135061040349 | 2026-04-08 17:16 | 4,802 km | +2. **Register push webhooks** in Tracksolid Pro dashboard: + - `/pushtripreport` — trip completion events + - `/pushobd` — OBD diagnostics + - `/pushoil` — fuel sensor + - `/pushtem` — temperature/humidity + - `/pushlbs` — LBS cell fallback + - `/pushevent` — device login/logout -### Active in last 30 days (in addition to above) +3. **Investigate 44 non-reporting devices** — Pull IMEI list; check SIM status and last-seen dates in Tracksolid Pro. -| Device Name | IMEI | Last Fix | Odometer | -|---|---|---|---| -| JK Subaru KCS 903Y | 359857081891921 | 2026-03-14 00:55 | 73,344 km | -| KDW 632M HL Tracker | 865135061569529 | 2026-03-11 23:53 | 222 km | -| JC400P-85751 | 862798052785751 | 2026-03-11 22:15 | 17 km | -| KDW 632M HL Cam | 862798052707995 | 2026-03-11 11:52 | 16 km | +4. **Investigate X3-63282 in Uganda** — Confirm vehicle status and mission with fleet manager. + +5. **Validate morning data (09:00 EAT check):** + ```sql + -- Trips + SELECT imei, COUNT(*) trips, ROUND(SUM(distance_km)::numeric,2) total_km, + MAX(max_speed_kmh) top_speed + FROM tracksolid.trips + WHERE start_time > now() - interval '12 hours' + GROUP BY imei ORDER BY total_km DESC; + + -- Parking + SELECT COUNT(*) FROM tracksolid.parking_events + WHERE created_at > now() - interval '12 hours'; + + -- Alarm types populated (BUG-01 validation) + SELECT alarm_type, alarm_name, COUNT(*) + FROM tracksolid.alarms + GROUP BY 1, 2 ORDER BY 3 DESC; + ``` + +6. **Configure geofences** — At minimum: main depot(s), fuel stations, key customer sites. + +7. **Set `fuel_100km`** per vehicle class to enable cost per trip calculations. --- -## 10. What This Report Will Look Like in 7 Days - -Once migrations 04 and 05 are applied and updated containers are deployed, the next weekly report will include: - -- **Trip records** per vehicle per day — distance driven, drive/idle hours, avg and max speed -- **Parking events** — where vehicles stopped, how long, address -- **Alarm events** — overspeed, geofence, harshness flags with correct type names -- **High-resolution position trails** — 2–6 GPS fixes per minute per active vehicle -- **Driver scorecards** — km driven, alarms per 100 km, late starts - -The data foundation is in place. The pipeline is running. This baseline establishes the starting point against which all future performance will be measured. - ---- - -*Report generated from live database query · 2026-04-10 23:18 EAT* -*Pipeline uptime at report time: ~1 hour* -*Queries source: `tracksolid_DB_manual.md` · `01_BusinessAnalytics.md`* +*End of report. Next comprehensive refresh recommended: 2026-04-11 09:00 EAT after morning operations have populated trip and movement data.*