LoRaWAN Uplink Deduplication for GPS Tracking Platforms
LoRaWAN Uplink Deduplication: When Two Gateways Hear One GPS Tracker
A worker wearing a LoRaWAN badge crosses the yard between a warehouse and a loading dock. The badge sends one location report. The warehouse gateway hears it, and so does the gateway above the dock. Later, the customer opens the tracking platform and sees two arrival alerts for the same worker. Where did the second alert come from?
Two gateways hearing the transmission is normal. In ChirpStack, one application uplink event can include a list of receiving gateways, each with its own reception details. To explain the two alerts, follow the report from the network server to the location history and then to the notification log. Counting gateway receptions alone cannot tell you how many times the worker arrived. GitHub
Read one uplink before counting two positions
Open a single up event in ChirpStack. For a tracking integration, three fields are particularly useful. GitHub
| Field | What to look for | How to use it |
|---|---|---|
deduplicationId | The identifier of this uplink event | Trace the same event through ingestion, storage, and alert processing. |
deviceInfo.devEui | The identity of the transmitting device | Find the badge, collar, or asset tracker that sent the report. |
rxInfo | The list of gateway receptions, including gateway IDs and radio measurements | See which gateways heard the transmission and compare their reception conditions. |
Suppose the payload contains one GPS fix and rxInfo lists two gateways. The natural result is one location record with two associated gateway receptions. Keeping both receptions is useful to the installer. Keeping one location record gives the customer an accurate trip history.
There is an important exception for trackers that buffer locations. A device might upload three historical fixes in one payload after returning to coverage. In that case, the application should preserve all three fixes and their original timestamps. The payload specification determines the number of positions. The gateway count plays no part in that calculation.
Find where the second alert appeared
Start with the two alerts the customer received and trace backward. This is usually quicker than searching a full day of gateway traffic.
| What the logs show | Where to investigate |
|---|---|
One uplink event, two rxInfo entries, one stored fix, and two alerts | Inspect the geofence rule and notification delivery logs. Check whether one boundary crossing triggered two notification jobs. |
The identical uplink event reached the application twice, with the same deduplicationId | Check whether processing the event a second time created another location row or alert. |
| One event contains one decoded fix, but the database has one position row per receiving gateway | Inspect the importer. The position write may sit inside the loop that stores reception details. |
| Two different events contain the same coordinates | Check the device’s fix times and reporting schedule. A stationary tracker can legitimately report the same location more than once. |
The last case matters for parked trailers, stored equipment, and livestock resting near a water point. Deleting every repeated latitude and longitude would erase valid observations. A trailer reporting from the same bay at 08:00 and 12:00 gives dispatch two pieces of information: where it was in the morning and how recently the tracker was heard from at midday.
Store the event, the positions, and the alert separately
For a ChirpStack integration, a practical design is to store the network source and deduplicationId together under a unique database constraint. If the same event reaches two application workers at the same time, the database can enforce a single event record. A lookup followed by an unprotected insert leaves room for both workers to decide that the event is new.
Store decoded positions under that event. For a buffered payload, give each fix its own entry using a stable sample identifier or its index within the payload. Store the gateway receptions alongside the event so the support team can still inspect gateway IDs and radio measurements.
For an arrival alert, record the actual transition, such as Badge 217 entered Loading Dock A, and associate the notification job with that transition. Save the positions, transition, and pending notification in one database transaction. That also handles the opposite failure: if processing stops halfway through, a retry can complete the work without silently losing the alert.
Run a two-gateway acceptance test
Use one badge or tracker, two gateways connected to the same network server, and a test zone with a clearly marked entrance. Give the field technician access to the application events as well as the customer-facing map.
- Start outside the zone. Confirm the platform has recorded an outside position. Walk the device inside and wait for a fresh fix clearly within the boundary.
- Find a report heard by both gateways. Open its
upevent and record the event ID, device ID, decoded fix time, and receiving gateway IDs. - Compare the records. For a payload containing one fix, verify that the platform saved one position and retained both gateway receptions. Check that the outside-to-inside transition produced one arrival alert.
- Replay the same event in the test integration. Confirm that the location and alert counts stay the same. Then send a fresh report while the device remains inside. The new observation should appear in the history without generating another arrival.
For an OEM project, ask for a sample payload and a matching network-server event before approving the integration. A single example containing one fix and two gateway receptions gives the hardware, platform, and customer teams a shared acceptance test. It works across applications ranging from warehouse badges to livestock tracking. Explore OEM LoRa personnel badges, livestock collars, and asset GPS trackers.