Turn OFF ADR

Hallo,
I have The Things Uno, and I wanna ask you if is there possibility to turn off ADR.
I want to do some coverage measuring with constatnt parametr, like frequency and SF…
I know that this informations are save in libraries, but i dont know where exactly and how to change them.
Thank you verry much.

Using the library of TTN you can reset the ttn object while disabling ADR in the following way:

// disable ADR
ttn.reset(false);

If you want to know moer you can investigate the library you use.

1 Like

I am sory, but that dont work for me.
I write this line to my code, but if I send messege debug monitor write: send command failed.
Where should this function be?
When I plugged this line into setup, device stop responding, and if I plug it to loop this message will appear:
– LOOP
Model: RN2483
Version: 1.0.3
Sending: mac set deveui 0004A30B001E0F7C
Sending: mac set adr off
Sending: mac set dr 0
Sending: mac tx cnf 1 00
Response is not OK: not_joined
Send command failed
Sending: mac tx uncnf 1 00
Response is not OK: not_joined
Send command failed

Thank you

My code: https://codeshare.io/21p0b7

Hi, Your poblem is that personalisation trough OTAA fails.
Might be coverage or configuration.

Hi,
Iam using ABP…
And when I delete line with <ttn.reset(false);> everything is OK, except that SF :confused:
The same configuration the same coverage.

– PERSONALIZE
Model: RN2483
Version: 1.0.3
Sending: mac set deveui 0004A30B001E0F7C
Sending: mac set adr off
Sending: mac set devaddr 0004A30B
Sending: mac set nwkskey A825B6FBBC23FD4E66E7A2CF35680C78
Sending: mac set appskey 1C936D72C01EAA0C95DD0610092E5E7F
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 0
Sending: mac join abp
Personalize accepted. Status: 00000001
– STATUS
EUI: 0004A30B001E0F7C
Battery: 3283
AppEUI: 0000000000000000
DevEUI: 0004A30B001E0F7C
Data Rate: 0
RX Delay 1: 1000
RX Delay 2: 2000
– LOOP
Sending: mac set dr 0
Sending: mac tx cnf 1 00
Successful transmission
Sending: mac tx uncnf 1 00
Successful transmission

the 1000 dollar question is: does TTN receive your packet?

I am connected to personal gateway and YES that gateway recive my packet.

1 Like

Good. than the next question is where do you reset? you initialisation code is required to see that. not the output of the program

I was trying to put that command to line 61 and than to 142. So into setup and then into loop.
https://codeshare.io/21p0xB

howabout moving

// disable ADR
ttn.reset(false);

to after

ttn.personalize()

or

ttn.join()

Doesnt seemto do any harm as far as I can see.

I have ttn.reset line after ttn.personalize line with this result:
Response is not OK: not_joined
Send command failed

btw it takes at least 20 packets before ADR kicks in.

Why is “ttn.reset(false);” at line 142 in teh main loop?

You can set the start SF when you crate the ttn object:

TheThingsNetwork(Stream &modemStream, Stream &debugStream, ttn_fp_t fp, uint8_t sf = TTN_DEFAULT_SF, uint8_t fsb = TTN_DEFAULT_FSB);

you can force a transmission to a specific datarate each packet:

sendBytes(const uint8_t *payload, size_t length, port_t port = 1, bool confirm = false, uint8_t sf = 0);

Do you have different devices in TTN back-end for OTAA and ABP or the same?

Because I was traying more places where it could work :smiley:

So if I will set SF, like I have in my code, it will automaticaly turn ADR OFF?

So something like that?
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan, 12);

No, that will not change ADR setting

Yes.

Hi,
I try TURN ON ADR (for people who will looking on it us me before)
It work four me:

ttn.join(appEui, appKey);
ttn.reset(true);
ttn.join(appEui, appKey);

I set SF12 and it stay in that way, I need to turn on ADR, i think it is disable in default.

If you study the library you will find the following in TheThingsNetwork.h:

void reset(bool adr = true);

This function will set, when ADR value is not provided, ARD to true. The setting will be stored in a member variable adr in the class. Every time you call provision() or personalize() the ADR will be enabled using the member variable until you disable this with reset(false);