setFsbChannels in Sodaq_RN2483 fails

It seems that only 3 channels of the RN2483 are used if you use the Sodaq_RN2483 library. If set to debug this is the output:

[setFsbChannels]
>> mac set ch status 0 on
[expectString] ("ok") .--> "ok" found a match!

>> mac set ch status 1 on
[expectString] ("ok") .--> "ok" found a match!

>> mac set ch status 2 on
[expectString] ("ok") .--> "ok" found a match!

>> mac set ch status 3 on
[expectString] ("ok") .--> "invalid_param"

Looks like these are the 3 default channels of the RN2483 as described in this post:

http://www.microchip.com/forums/m947922.aspx

The enabeling of the other channels fails using the library code

// Enables all the channels that belong to the given Frequency Sub-Band (FSB)
// and disables the rest.
// fsb is [1, 8] or 0 to enable all channels.
// Returns true if all channels were set successfully.
bool Sodaq_RN2483::setFsbChannels(uint8_t fsb)
{
debugPrintLn("[setFsbChannels]");

uint8_t first125kHzChannel = fsb > 0 ? (fsb - 1) * 8 : 0;
uint8_t last125kHzChannel = fsb > 0 ? first125kHzChannel + 7 : 71;
uint8_t fsb500kHzChannel = fsb + 63;
bool allOk = true;
for (uint8_t i = 0; i < 72; i++) {
    print(STR_CMD_SET_CHANNEL_STATUS);
    print(i);
    print(" ");
    print(BOOL_TO_ONOFF(((i == fsb500kHzChannel) || (i >= first125kHzChannel && i <= last125kHzChannel))));
    println();
    allOk &= expectOK();
}
return allOk;

}

1 Like

Hi,

If you want to use the other channels you need to set the frequency, data range and spreadingfactors.
By default only the first 3 channels and return channel are set.

See: http://ww1.microchip.com/downloads/en/DeviceDoc/40001784B.pdf

Example to enable channel 13.

mac set ch freq 13 864000000
mac set ch dcycle 13 999
mac set ch drrange 13 0 5
mac set ch status 13 on

Best regards,
Jan

Thank you Jan, shouldn’t this be added to the library ?

Best Regards
Sebastiaan

1 Like

Hi Sebastiaan,

These three channels are the default for the 868.

Any network can choose its own channels.
You can fork our library and make the changes so it will use your settings.

I don’t think this should be added into the library at this moment.
Maybe when other require the same set of channels we will add it.

Best regards,
Jan

Hi Jan,

I’am new to radio, frequencies and channels so might be confused. When it comes to frequency sub bands (FSB) i found this:

A defacto “Frequency Sub-Band” (FSB) numbering scheme is emerging amongst gateway & server providers using FSB 1 to 8. Semtech “best practice” suggests naming them as blocks with letters A to H to avoid mixing up blocks with channels:

FSB 1 (aka block A) = 0, 1, 2, 3, 4, 5, 6, 7 (125 kHz channels) plus 64 (500 kHz channel)
FSB 2 (aka block B) = 8, 9, 10, 11, 12, 13, 14, 15 plus 65
FSB 3 (aka block C) = 16, 17, 18, 19, 20, 21, 22, 23 plus 66

FSB 8 (aka block H) = 56, 57, 58, 59, 60, 61, 62, 63 plus 71

( http://www.microchip.com/forums/m926581.aspx )

Should this be interpreted as e.g. TTN uses FSB 2 and KPN uses FSB 3 ? This was my interpretation so based on this i was assuming that Sodaq_RN2483::setFsbChannels(uint8_t fsb) would configure the channels and enable them.

Best Regards
Sebastiaan

Hi,

The LoRaWAN specification defines 3 common 125 kHz channels for the 868 MHz band (868.10, 868.30 and 868.50 MHz) that must be supported by all devices and networks, and that all gateways should always be receiving on. These three channels form a common set of channels that all devices can use to join with a network. During this join procedure, the network can instruct the devices to add additional channels to its channel set. These channels are used for both uplink and downlink messages.

KPN and TTN both use FSB 1.
TTN using the FSB 2 on the RN2903.

As the article explains it’s “best practice” you can still create your own blocks.

But this is also allowed:

FSB 1 (aka block A) = 0, 1, 2, 3, 19, 20, 21, 22 (125 kHz channels) plus 64 (500 kHz channel)
FSB 2 (aka block B) = 8, 9, 10, 11, 12, 13, 14, 15 plus 65
FSB 3 (aka block C) = 16, 17, 18, 4, 5, 6, 7, 23 plus 66

Regards,
Jan

How to do this (Example: to enable channel 13) with Sodaq_RN2483 Lib?

Hi @kaebmoo,

The SODAQ RN2483 Library supports to set of bands that belong to a group.
If you want to just set a single channel, you have modify the library.

The library is opensource and available on GitHub:

The following code is to set a channel group:

// Enables all the channels that belong to the given Frequency Sub-Band (FSB)
// and disables the rest.
// fsb is [1, 8] or 0 to enable all channels.
// Returns true if all channels were set successfully.
bool Sodaq_RN2483::setFsbChannels(uint8_t fsb)
{
    debugPrintLn("[setFsbChannels]");

    uint8_t first125kHzChannel = fsb > 0 ? (fsb - 1) * 8 : 0;
    uint8_t last125kHzChannel = fsb > 0 ? first125kHzChannel + 7 : 71;
    uint8_t fsb500kHzChannel = fsb + 63;

    bool allOk = true;

    for (uint8_t i = 0; i < 72; i++) {
        print(STR_CMD_SET_CHANNEL_STATUS);
        print(i);
        print(" ");
        print(BOOL_TO_ONOFF(((i == fsb500kHzChannel) || (i >= first125kHzChannel && i <= last125kHzChannel))));
        println();

        allOk &= expectOK();
    }

    return allOk;
}

Best regards,
Jan