TheThingsNetwork / arduino-device-lib

Arduino Library for TTN Devices
MIT License
208 stars 96 forks source link

DevEUI set when changing ADR #278

Open jpmeijers opened 2 years ago

jpmeijers commented 2 years ago

The output from the SendOTAA example looks like this:

-- STATUS
EUI: <redacted>
Battery: 3325
AppEUI: 0FB6664FBCD5E97F
DevEUI: <redacted>
Data Rate: 5
RX Delay 1: 1000
RX Delay 2: 2000
-- JOIN
Model: RN2483
Version: 1.0.1
Sending: mac set deveui <redacted>
Sending: mac set adr off
Sending: mac set deveui <redacted>
Sending: mac set appeui 0FB6664FBCD5E97F
Sending: mac set appkey 935E7BE846EE0704FC42E7B7948252A2
Sending: mac save 
Sending: mac set rx2 3 869525000
Sending: mac set ch drrange 1 0 6
Sending: mac set ch dcycle 0 799
Sending: mac set ch dcycle 1 799
Sending: mac set ch dcycle 2 799
Sending: mac set ch dcycle 3 799
Sending: mac set ch freq 3 867100000
Sending: mac set ch drrange 3 0 5
Sending: mac set ch status 3 on
Sending: mac set ch dcycle 4 799
Sending: mac set ch freq 4 867300000
Sending: mac set ch drrange 4 0 5
Sending: mac set ch status 4 on
Sending: mac set ch dcycle 5 799
Sending: mac set ch freq 5 867500000
Sending: mac set ch drrange 5 0 5
Sending: mac set ch status 5 on
Sending: mac set ch dcycle 6 799
Sending: mac set ch freq 6 867700000
Sending: mac set ch drrange 6 0 5
Sending: mac set ch status 6 on
Sending: mac set ch dcycle 7 799
Sending: mac set ch freq 7 867900000
Sending: mac set ch drrange 7 0 5
Sending: mac set ch status 7 on
Sending: mac set pwridx 1
Sending: mac set retx 7
Sending: mac set dr 5
Sending: mac join otaa 
Join not accepted: denied
Check your coverage, keys and backend status.

At the top just after the join function is called, we see these commands being sent to the radio:

Sending: mac set deveui <redacted>
Sending: mac set adr off
Sending: mac set deveui <redacted>
Sending: mac set appeui 0FB6664FBCD5E97F
Sending: mac set appkey 935E7BE846EE0704FC42E7B7948252A2

We can see the DevEUI is set twice, once by the ADR off function, and again by the personalise function. This is not a problem, but it would be better if we review this behaviour.