You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Math rules strike again - there appears to be a minor re-encoding mistake on the RSSI field in the uplinkMetadata of RelayForwardUplinkReq that results in the forwarded RSSI to be 30 off (or, more accurately, 2*15).
Steps to Reproduce
Send a forwarded uplink from a Relay-enabled device, observing the RSSI of the relay from the end-device's uplink.
Observe the output on the end-device's console (or the relay's console in the rx_metadata field).
The RSSI value on the end-device console ends up 30 dBm lower than what the relay sends to the network server. This is due to a minor brackets problem. The unmarshalling is done right...
The tests look OK to me, but that doesn't take away the behaviour that I see on the console.
In similar vein to the other issue, here is a collection of outtakes from the Relay log and device consoles to investigate.
Relay's metadata setup after receiving a NodeR-uplink (that is an end-device):
The first six bytes are the Metadata as described in section 9.1 of TS011:
The Uplink metadata is C2 41 00, the Uplink Frequency is C8 85 84 (0x8485C8 = 8685000, identical to log). Reversing the bytes for the metadata in similar fashion, it reads 0x0041C2. Decoding this according to Table 27, we see:
Uplink Datarate = 2 (identical to log)
Uplink SNR = 28 (Relay reported 8, +20 from encoding)
Uplink RSSI = 32 (Relay reported -17, so negated and +15 from encoding)
But looking at the Console for the NodeR device, I see the following:
While the SNR is reported correctly, the RSSI value is 30 off. I think the issue is in the line I originally posted, but that may be wrong. Please let me know your thoughts @KrishnaIyer
Summary
Math rules strike again - there appears to be a minor re-encoding mistake on the RSSI field in the
uplinkMetadata
ofRelayForwardUplinkReq
that results in the forwarded RSSI to be 30 off (or, more accurately, 2*15).Steps to Reproduce
rx_metadata
field).Current Result
Relay:
Console:
The RSSI value on the end-device console ends up 30 dBm lower than what the relay sends to the network server. This is due to a minor brackets problem. The unmarshalling is done right...
lorawan-stack/pkg/encoding/lorawan/relay.go
Line 80 in 569c2cc
... but the re-marshalling is applied incorrectly:
lorawan-stack/pkg/encoding/lorawan/relay.go
Line 53 in 569c2cc
Notice the very subtle difference in brackets - the
+15
should be applied outside the brackets instead of inside.Expected Result
The RSSI for the end-device should be set back to original.
Relevant Logs
No response
URL
No response
Deployment
The Things Stack Community Edition
The Things Stack Version
3.32.1
Client Name and Version
No response
Other Information
No response
Proposed Fix
Change ...
lorawan-stack/pkg/encoding/lorawan/relay.go
Line 53 in 569c2cc
... to ...
(I guess?)
Contributing
Validation
Code of Conduct
The text was updated successfully, but these errors were encountered: