Gateway receives wrong gps coordinates/packages

I used the LMIC-node from L.L. Parente (github.com/lnlp/LMIC-node) and made a gps mapper node. Most of the time my gateway receives the correct coordinates, but sometimes my node seems to be in the middle of an ocean or on an other continent.
At first I thought it was a problem of the gps in the TTGO T-beam and I added a check in the code so that only packages are uploaded where the coordinates are within a reasonable distance from my home address.
Still my gateway receives occasionally wrong coordinaties/packages.
See gateway console log:
mapper.pdf (24.1 KB)

Screenshot from TTN mapper:
mapper

Is there a way to prevent this errors?

Roel

Gateway: Mikrotik Wap lora8 (version 3)
Application: version 3)
MCU: TTGO T-Beam LoRa 868 Mhz (v1?)

First of all, the gateway probably has nothing to do with this.
The gateway acts a bit like a mail man, just delivers letters, can’t even look into your envelope (content is encrypted). If it were to modify the contents, the network would notice the tampering/corruption because of a secure checksum.

Where it is going wrong is a bit of a guess. To investigate that, I would check every step in the way from location to map, like you did a bit already. Start with the GPS, reject weird coordinates or coordinates with a large HDOP, check if the payload is built up OK on the device side, check how the payload is decoded on the TTN side (Are you using a TTN payload decoder?)

As a general piece of advice, it’s nearly always better to find/know the root cause of a problem, instead of trying to “correct” or ignore it. If you encounter a problem and at some point it disappears without understanding why, it will most probably come back to bite you at some later time.

1 Like

Checked my code again and found one error. I am not sure if this error is the cause of the wrong payloads, but today I do not see strange data in ttnmapper.

Wrong… Still strange coordinates.

I’m using your code @roelwolf and see the same. The serial output from the device is giving the correct co-ordinates, but the application inside of TTN is (seemingly) quite random.

Did you ever work this out?

Compare your encoder and decoder.

Yes, my problem (wrong coordinates) was caused by the fact that the downlink messages where interpreted as gps coordinates and translated by the decoder.
In the decoder you have to check the input port and only translate de data if the port is unequal to 10.
I provided a decoder in my github repository.

Roel