IoT Telemetry Ingest v1.2
Hardware Pilot Ready
Hostinger hPanel

Automotive GPS Telemetry Ingestion

Production telematics pipeline for vehicle tracking. Features two-tier deduplication (Redis SET NX + MySQL unique constraint), native Traccar auto-normalization, and out-of-order stale packet protection for cellular dead zones.

Telemetry Ingest Host
https://api.logistichubnepal.com
Two-Tier Idempotency & Dead-Zone Guard

Two-Tier Telematics Pipeline Architecture

Commercial vehicle trackers communicate using binary/text packets over raw TCP/UDP sockets. Nginx on port 443 expects HTTPS TLS and cannot decode raw tracker frames directly. The system utilizes a dedicated protocol gateway:

Tier 1
GPS Protocol Gateway (Traccar / Go Daemon)

Listens on TCP/UDP socket ports (e.g. Teltonika Codec 8E, SinoTrack GT06, Queclink). Decodes binary frames into normalized JSON events and forwards to this API.

Tier 2
Telemetry Ingestion API (Laravel on hPanel)

Receives normalized JSON at /api/v1/gps/telemetry, validates timestamps, prevents stale points from overwriting live coordinates, deduplicates packets, and pushes updates to Socket.IO.

POST
/api/v1/gps/telemetry
Public / Gateway Auth

Ingest telemetry feed from hardware GPS devices or Traccar forwarders.

Two-Tier Idempotency

Redis Cache::add() (6-hour performance layer) + MySQL UNIQUE(device_id, packet_id) (correctness layer).

Stale Packet Protection

Delayed points arriving out-of-order are stored in history but will never overwrite the vehicle's current live location.

Canonical Telemetry JSON Schema

FieldTypeRequiredDescription
device_idstringYes15-digit IMEI or hardware serial mapped to vehicle.
latitudefloatYesLatitude coordinate (-90.0 to 90.0).
longitudefloatYesLongitude coordinate (-180.0 to 180.0).
packet_idstringOptionalProtocol packet ID preferred. Deterministic hash generated as fallback.
device_recorded_atstringOptionalHardware GPS UTC timestamp (ISO 8601). Critical for route playback.
ignitionboolean|nullOptionalEngine ignition. Unknown/missing is preserved as null (STOPPED).
current_speedfloatOptionalGround speed in km/h. Raw speed preserved; effective speed damped < 3 km/h.

Integration Code Generators

curl -X POST "https://api.logistichubnepal.com/api/v1/gps/telemetry" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "device_id": "864201048591234",
  "packet_id": "pkt_sim_101",
  "protocol": "teltonika",
  "source": "hardware_gps",
  "latitude": 27.717245,
  "longitude": 85.323961,
  "current_speed": 48.5,
  "heading": 135,
  "ignition": true,
  "fuel_level": 82,
  "odometer": 154200.5,
  "device_recorded_at": "2026-10-18T04:58:58.639Z"
}'

Traccar Direct Webhook Auto-Normalization

Forward native JSON positions directly from Traccar to Laravel without an adapter layer.

Auto-Detected Webhook Payload

When Traccar posts with "position": { ... } and "device": { ... }, the controller automatically converts knots to km/h, extracts uniqueId, maps course and ignition, and handles optional attributes safely.

Recommended Traccar Forwarding Config (traccar.xml)
<entry key='forward.enable'>true</entry>
<entry key='forward.url'>https://api.logistichubnepal.com/api/v1/gps/telemetry</entry>
<entry key='forward.header'>X-Gateway-Secret: your-production-secret</entry>

Live Telemetry Tester

Interactive

Transmit a test telemetry packet directly to api.logistichubnepal.com.

•

Gateway Observability & Hardware Pilot Health

Live ingest health statistics and device telemetry inspector for field testing.

Click "Refresh Gateway Health" to fetch real-time gateway throughput, latencies, and device status.

Latency Measurement Notice: processing_latency_ms represents internal server-side PHP/Redis/DB execution time only. Actual end-to-end round-trip latency (Traccar → Cellular → TLS Handshake → Laravel) must be benchmarked under live network conditions during the hardware pilot.

10-Step Hardware Pilot Verification Checklist

Standard operating procedure for connecting the first physical Teltonika / Concox tracker on NTC/Ncell SIM.

01
Initial ConnectionPhysical tracker connects over cellular to Traccar TCP/UDP port.
02
Telemetry IngestionTraccar forwards parsed JSON to api.logistichubnepal.com/api/v1/gps/telemetry.
03
Live Radar MapLaravel writes DB and notifies Socket.IO; truck marker updates on web/mobile map.
04
Ignition StateIgnition ON triggers IDLING; Ignition OFF triggers PARKED; Missing maps to STOPPED.
05
Speed Jitter DampingSpeeds below 3.0 km/h damp effective_speed to 0, avoiding spurious moving alerts.
06
Network InterruptionCellular drop causes status transition: ONLINE -> DELAYED -> OFFLINE.
07
Dead-Zone Buffer RecoveryReconnection uploads buffered packets; device_recorded_at preserved in history.
08
Duplicate Replay TestReplayed packet stopped by Redis SET NX and MySQL UNIQUE(device_id, packet_id).
09
Out-of-Order Packet GuardOld buffered point does not overwrite current position in vehicle_current_locations.
10
Gateway Restart TestRestart Traccar/Laravel services and verify trackers reconnect automatically.