Error while handling GPS altitude from Tektelic Macro / Mega

Hi,

We are working on swapping out our pile of Tektelic Kona Micros (which have no GPS) for Macros and Megas (with GPS, more channels etc). Today our new indoor GPS repeater arrived so that we can actually start using the time-sensitive LoRa stuff.

We are also using this moment to switch from CSv3 to v4, and from chirpstack-gateway-bridge to chirpstack-mqtt-forwarder.

However, a few minutes after enabling the GPS repeater, the new gateways all went off-line.

After inspecting the logs (see below), it looks like chirpstack-mqtt-forwarder expects an unsigned 32 bit integer as value for the altitude, however pkt_forwarder seems to send a negative value here.

Is this something wonky in the packet forwarder, or in chirpstack-mqtt-forwarder?

kona-mega-0192E1:/etc/chirpstack-mqtt-forwarder$ pkt_forwarder -h       
[1749641861] ~~~ Tektelic packet forwarder 6.0.3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1749641861] ~~~ Library version string 5.1.8 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

/var/log/pkt_fwd.log:

INFO: Received pkt from mote: 00000001 (fcnt=644)
Jun 11 11:22:21 kona-mega-0192E1 pkt_forwarder: 
JSON up: {"rxpk":[{"tmst":272261244,"time":"2025-06-11T11:22:21.490676Z","tmms":1433676159490,"chan":55,"rfch":0,"freq":911.300000,"stat":1,"modu":"LORA","datr":"SF10BW125","codr":"4/5","lsnr":10.8,"rssi":-84,"size":17,"data":"QAEAAADAhAIBcoDIHg9BZrU="}]}
Jun 11 11:22:21 kona-mega-0192E1 pkt_forwarder: INFO: [up] PUSH_ACK received in 3 ms
Jun 11 11:22:21 kona-mega-0192E1 pkt_forwarder: INFO: [jit] queue 0 contains 2 packets:
Jun 11 11:22:21 kona-mega-0192E1 pkt_forwarder: INFO: [jit] queue 0 contains 2 beacons:
Jun 11 11:22:21 kona-mega-0192E1 pkt_forwarder:  - node[0]: count_us=400770568 - type=3
Jun 11 11:22:21 kona-mega-0192E1 pkt_forwarder:  - node[1]: count_us=528770568 - type=3
Jun 11 11:22:21 kona-mega-0192E1 pkt_forwarder: INFO: Beacon dequeued (count_us=272770568)
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: INFO: [jit] queue 0 contains 3 packets:
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: INFO: [jit] queue 0 contains 3 beacons:
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder:  - node[0]: count_us=400770568 - type=3
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder:  - node[1]: count_us=528770568 - type=3
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder:  - node[2]: count_us=656770568 - type=3
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: INFO: Beacon queued (count_us=656770568, freq_hz=926900000, size=23):
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: 
##### 2025-06-11 11:22:22 GMT #####
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: ### [UPSTREAM] ###
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # RF packets received by concentrator: 5
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # CRC_OK: 100.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # RF packets forwarded: 5 (85 bytes)
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # PUSH_DATA datagrams sent: 6 (1473 bytes)
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # PUSH_DATA acknowledged: 100.00%
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: ### [DOWNSTREAM] ###
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # PULL_DATA sent: 3 (100.00% acknowledged)
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # PULL_RESP(onse) datagrams received: 0 (0 bytes)
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # RF packets sent to concentrator: 1 (0 bytes)
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # TX errors: 0
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # BEACON queued: 6
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # BEACON sent so far: 3
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # BEACON rejected: 0
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: ### [JIT] ###
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # SX130x time (PPS): 272770568
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: INFO: [jit] queue 0 contains 3 packets:
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: INFO: [jit] queue 0 contains 3 beacons:
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder:  - node[0]: count_us=400770568 - type=3
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder:  - node[1]: count_us=528770568 - type=3
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder:  - node[2]: count_us=656770568 - type=3
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: INFO: [jit] queue 1 is empty
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: ### [GPS] ###
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: # GPS coordinates: latitude xx.90674, longitude y.54541, altitude -5 m
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: ##### END #####
Jun 11 11:22:22 kona-mega-0192E1 pkt_forwarder: 
JSON up: {"stat":{"time":"2025-06-11 11:22:22 GMT","lati":xx.90674,"long":y.54541,"alti":-5,"rxnb":5,"rxok":5,"rxfw":5,"ackr":100.0,"dwnb":0,"txnb":1,"temp":45,"cpur":19.4,"memr":17.6}}

(coordinates obfuscated)

/var/log/syslog:

Jun 11 11:22:22 kona-mega-0192E1 chirpstack-mqtt-forwarder[12233]: Handle PUSH_DATA error: invalid value: integer `-5`, expected u32 at line 1 column 82, remote: 127.0.0.1:49451

Comparing gateway-bridge and mqtt-forwarder shows that there is a difference in data-types. MQTT Forwarder has an unsigned int leading to the error you see.

1 Like

Thanks, nice find. I had found the uint32 in mqtt-forwarder, but I hadn’t thought to compare it to gateway-bridge.

Having this confirmed as a probable bug, I’ll report the issue on github.