How to make RN2483 node use a fixed channel and spreading factor?

Hi,

For use with a single channel gateway, I want my node to use a fixed channel and spreading factor.

I think it is possible to do this if I look into the RN2483 Command Reference. Example in the doc:

  • mac set ch drrange 13 0 2 would set it that channel 13 can have data range from 0 (SF12/125) to 2 (SF10/125)
  • mac set ch status 4 off turns off channeld ID 4.

So if I disable all channels except one and set drrange min and max equal wouldn’t I have set it to single channel and fixed Spreading Factor?

Question then remains: which channel and which datarange?

1 Like

Hi Chris,

In the LoRa Specification it says that first three channel (868.1 868.3 868.5) must be implemented in every end device. I tried what you did with mDot and software inside changed first three channel to its original state. I think RN2483 may do the same.

To only use one channel, the following worked for me for ABP with the TTN libraries along with with RN2483 version 1.0.1 (Dec 15 2015 09:38:09), on EU868.

Of course, this is only for testing. To use, e.g., channel 5:

// Initialise ABP and set up the 8 standard channels:
ttn.personalize(devAddr, nwkSKey, appSKey);

// Disable 7 of the 8 default channels. This basically disables the
// mandatory LoRaWAN channel hopping, so FOR TESTING ONLY.
exec("mac set ch status 0 off");
exec("mac set ch status 1 off");
exec("mac set ch status 2 off");
exec("mac set ch status 3 off");
exec("mac set ch status 4 off");
// exec("mac set ch status 5 off");
exec("mac set ch status 6 off");
exec("mac set ch status 7 off");

Beware that when disabling channels, the resulting single-channel node will have a very low maximum duty cycle of only 0.125%. The wiki explains:

In the European band, a transmission on a channel within a frequency band, also influences the other frequencies in that band.

…and:

As a per-channel duty cycle limit is easier to implement, you can also divide the sub-band duty cycle over the number of channels in that sub-band. So for example, in a sub-band with 8 channels and a duty cycle of 1%, each channel has a duty cycle of 1/8% (that’s 0.125%).

This method is also implemented by the RN2483 module, and as a result, instead of seeing the no_free_ch when you send too quickly after the first message you can send multiple messages before all 8 channels are “blocked” and the duty cycle is enforced.

One can validate that indeed the maximum duty cycle for, e.g., channel 5 is 0.125%:

// Print the default duty cycle: 799 means 100/(799+1) = 0.125%, which
// is 1% for the whole sub-band, divided over 8 channels; see explanation
// on https://www.thethingsnetwork.org/wiki/LoRaWAN/Duty-Cycle
exec("mac get ch dcycle 5");

Though the RN2483 allows one to set the maximum duty cycle for that one channel to be 1%, I think one should not do that. LoRaWAN mandates:

The end-device changes channel in a pseudo-random fashion for every transmission. The resulting frequency diversity makes the system more robust to interferences.

So, I’d say that disabling some default channels from a sub-band does not imply one can then (ab)use the full 1% for the one channel that is used. Instead, I feel that disabling default channels implies the node’s maximum duty cycle is decreased. (And it’s a maximum anyway; better stay below the maximum.)


The exec function as used above needs to be defined like below.

/**
 * Executes the given AT command and prints its result, if any. 
 * FOR TESTING ONLY; might cause a memory leak with String?
 */
String exec(const char* cmd) {
  debugSerial.print(cmd);
  debugSerial.print(F(": "));
  loraSerial.println(cmd);
  while(!loraSerial.available()) {
    delay(50);
  }
  String s = "";
  // This includes \r\n newline:
  while(loraSerial.available()) {
    s.concat((char)loraSerial.read());
  }
  debugSerial.write(s.c_str());
}

I am trying to connect an RN2483 over the pycom LoraWAN nano gateway on the TTN platform. The gateway is working fine and is connected on the TTN platform with the default settings (68610000 Mhz - DR5)

forthe RN2483 i configured it to work on a single channel. This is the commands i used:

loraSerial.println(“mac reset 868”);
delay(100);
loraSerial.println(“mac set ch status 0 off”);
delay(100);
loraSerial.println(“mac set ch status 1 off”);
delay(100);
loraSerial.println(“mac set ch status 2 off”);
delay(100);
loraSerial.println(“mac set ch freq 5 868100000”);
delay(100);
loraSerial.println(“mac set ch dcycle 5 9”);
delay(100);
loraSerial.println(“mac set ch drrange 5 0 5”);
delay(100);
loraSerial.println(“mac set ch status 5 on”);
delay(100);

loraSerial.println(“mac set devaddr xxxxxxx”);
delay(100);
loraSerial.println(“mac set nwkskey xxxxxxx”);
delay(100);
loraSerial.println(“mac set appskey xxxxxxx”);
delay(100);
loraSerial.println(“mac set adr off”);
delay(100);
loraSerial.println(“mac set ar off”);
delay(100);
loraSerial.println(“mac set pwridx 1”);
delay(100);
loraSerial.println(“mac set dr 5”);
delay(100);
loraSerial.println(“mac join abp”);
delay(100);

then i tried to send a message for example:

mac tx cnf 1 12345678

but i don’t receive anything?

I have in parallel a multitech connect to Loriot which receives the message with the correct freq & DR.

Did anyone ever connected an RN2483 over a pycom LoRaWAN nano gateway?

Hi Pleemans,

Did you manage to get it working? i’m facing the same probleem. I have a Dragino Lora/gps hat on a rPi3 which is used as a gateway/packet forwarder. The gateway is functioning as I can see that messages are being received. But not from my node. I have a ‘the things uno’ board which is in fact a draguino leonardo with lora microchip. I blocked all channels apart from the default one (0) which is set on 868.1. None of the packages send are received by my gateway though…

Anne

I’m also interested to know if this worked.

I am surprised that it is possible with RN2483 to switch off the 3 default channels (mac set ch status 0 off).

My suggestion would have been to enable a high duty cycle on one wanted channel (mac set ch dcycle 0 0) and a very low duty cycle on the unwanted channels (mac set ch dcycle 1 65535).

Please let us know what works.

See this link:

https://www.thethingsnetwork.org/forum/t/setting-fixed-spreading-factor-on-rn2483/8838

I’ve tried

But after limiting the channels to channel 0 I can’t see any downlinks anymore. (Single channel LoRa gateway with a Raspberry Pi and a Dragino HAT.)

It looks like disabling more than one channel causes some kind of hanging. If I try to disable more than one channel I get


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 abp
Personalize accepted. Status: 00000001
mac set ch status 3 off: ok
mac set ch status 4 off:

on the serial monitor ie no ‘ok’ for the next channel an no more output.

Any idea?