-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relay NotifyNewEndDeviceReq payload incorrectly formatted #7334
Comments
@KrishnaIyer I object, your honour. I will supply more information this time around. The endianness of my device is right, and the endianness of the network is similarly little-endian. Observe the contents of a (random) downlink, dumped in straight byte order as received by the radio:
Byte 0 is the MHDR, byte 1 through 4 is the DevAddr: With that out of the way, here is a NotifyNewEndDevice, as seen through the Relay:
Base64 payload in the console:
NwkSEncKey from the console:
Now the corresponding downlink to UpdateUplinkList (in base64):
Which, decoded, reports the following:
Notice the same endianness on the DevAddr in bytes 2-5. Given that the byte ordering is clear from the UpdateUplinkList, here is again the NotifyNewEndDevice: We should see the four bytes for DevAddr first (in little-endianness), and only then the PowerLevel. I am curious to hear from you @KrishnaIyer. If there are any questions, please let me know, happy to supply more information. |
@KrishnaIyer can you please review this additional information? |
@KrishnaIyer @johanstokking sorry for the repeated ping, but I'd like to investigate this further please. |
@StevenCellist thanks for your report. So the issue is that the fields are swapped; we're sending Looping in @halimi |
Yes, that seems to be the case, to the best of my understanding. Thanks for reopening! |
Summary
The payload of the Relay MAC command
NotifyNewEndDeviceReq
is not correctly formatted/parsed on TTS.Steps to Reproduce
ttn-lw-cli relays create <app-id> <device-id> --mode.serving
ttn-lw-cli relays create <app-id> <device-id> --mode.served.mode.always --mode.served.serving-device-id <device-id>
ttn-lw-cli relays uplink-forwarding-rules create <app-id> <device-id> 0 --device-id <device-id>
NotifyNewEndDeviceReq
is triggered.Current Result
NotifyNewEndDeviceReq
payload formatted as per TS011 paragraph 10.7First four bytes DevAddr, last two bytes PowerLevel
Served device DevAddr copied from Console:
260B470F
Relay log:
Relay console log:
Notice that the
dev_addr
field ofRelayNotifyNewEndDeviceReq
is not correct (as well as snr/rssi but those are not so easy to see).NotifyNewEndDeviceReq
payload swapped formattingFirst two bytes PowerLevel, last four bytes DevAddr
Served device DevAddr copied from Console:
260B01C7
Relay log:
Relay console log:
Notice that this swapped formatting yields the expected result on the console.
Expected Result
The formatting as per TS011 paragraph 10.7 should be the correct formatting (and therefore the decoding on TTS should be corrected).
Relevant Logs
No response
URL
No response
Deployment
The Things Stack Community Edition
The Things Stack Version
3.32.1
Client Name and Version
Other Information
No response
Proposed Fix
Swap the payload fields of
NotifyNewEndDeviceReq
.Contributing
Validation
Code of Conduct
The text was updated successfully, but these errors were encountered: