IoT Real-Time
Location System
Engineering specification for a distributed LoRaWAN signal processing platform. Converts RSSI radio signals into real-time indoor positioning coordinates through an event-driven microservices architecture.
System Overview
The system receives radio signals from LoRaWAN tracking devices via relay beacons and a network gateway. These signals are ingested from a RabbitMQ message broker, filtered, and processed through RSSI-based positioning algorithms to determine the indoor coordinates of each tracker.
Computed positions are streamed in real time to connected clients via Server-Sent Events (SSE), enabling live visualization of device movement on interactive floor plan interfaces. The entire pipeline operates as a set of loosely-coupled microservices communicating through Redis Pub/Sub.
System Architecture
Microservices Breakdown
Subscribes to the RabbitMQ exchange to ingest raw LoRaWAN payloads. Performs packet filtering — discarding malformed or duplicate frames — validates RSSI readings, and routes cleaned messages to their respective Redis Pub/Sub channels based on payload type.
Subscribes to Redis channels with calculation payloads containing RSSI values from multiple relay beacons. Converts RSSI to distances via path-loss models, then applies trilateration to compute (x, y) positioning coordinates. Results are published to post-calculation channels.
RESTful API managing all client-facing operations: authentication via JWT, CRUD for devices, beacons, floor plans, workspace management, and PostgreSQL database interactions. Serves as the primary bridge between the frontend client and persistent storage.
Manages persistent Server-Sent Event connections with frontend clients. When a user starts a live tracking session, this service opens an SSE stream and dispatches real-time position updates, enabling smooth, animated device movement on floor plan visualizations.
Positioning Algorithms
Each relay beacon reports an RSSI value (dBm) for the tracker's signal. The log-distance path loss model converts this to an estimated distance:
d = estimated distance · RSSI_ref = reference RSSI at 1m · n = path loss exponent (2–4, environment-dependent)
With distances from ≥3 beacons at known positions (x₁,y₁), (x₂,y₂), (x₃,y₃) with distances d₁, d₂, d₃:
Equations are linearized by subtracting pairs. With >3 beacons, least-squares estimation improves accuracy through redundancy.
When fewer than 3 reliable readings are available, the system uses a weighted centroid approach:
Beacon positions are weighted inversely by distance, providing a reasonable estimate while degrading gracefully.
End-to-End Data Flow
SSE Data Stream
The front end connects via the browser's native
EventSource API. Each event carries updated device
coordinates. The UI applies
transition: transform 0.3s ease to tracker markers,
enabling smooth animated movement as positions update every ~1–2
seconds.