RAK4630 Set Spreading Factor?


I’m very happy coding away on the RAK4630 module. The supplied lorawan library works really nice with the eventing.

On my other lora devices, i can set a spreading factor. I’ve notived that the RAK4630 seems to be at SF7.
How can i set the spreading factor on these devices?

Hi @cyclops ,

Since you are using RAK4630 module, I will assume that you are using the RUI3 firmware. You can set the spreading factor via AT commands or RUI3 API.

No, i’m not using the RUI3 API/firmware. I’m actually using “my own” code

Adding to this - the other code i used (sodaq) had SF things instead of DR. So i now understand that DR is linked directly to SF. Is that correct?

Hi @cyclops ,

I understand :+1:

Looking at your code, you should be able to set the default DR on config.h. Specifically this int8_t _loraDataRate = DR_0;. However, you said you get SF7 which do not correspond with DR=0. Hmm. I think your code is based on @beegee’s work. So I believe he can give better insights :ok_hand:

DR and SF are related to one another. Values depends on your region. I advise you have a look on the regional document from LoRa Alliance.

To give example, DR0 is SF12 in EU868 while DR0 is SF10 in US915. Here’s the table for US915.

1 Like


As you are using my SX126x-Arduino library, the API call to change the datarate is

/**@brief Configure data rate
 * @param data_rate data rate
 * @param enable_adr  enable adaptative data rate
void lmh_datarate_set(uint8_t data_rate, bool enable_adr);

As Carl said, SF and BW are combined in LoRaWAN specs into the data rate DR.
Beside of reading the official specs, you can have a quick overview in our Documentation Center where we show for most regions the possible datarate (with SF and BW), max payloads, …