CubeCell + TTN + US915

Hi!

I am trying to connect a CubeCell board to a LoRa Gateway that is connected to The Things Network (TTN) with the LoRaWan example provided by Heltec (from the example, I just changed the devEUI, appEUI and appKey, everything else is the same). I’ve been struggling with this, I can’t make my CubeCell board connect to TTN. I have double checked the frequency plan and the keys.

In my gateway I can see this:

But in Arduino Serial Console I just keep receiving “join failed, join again at 30s later

Any ideas? Thanks for your help.

José

“ join failed, join again at 30s later ”, means: attempt join twice failed then serial print this this sentence.

Is your frequency US915MHz?(US915 and AU915 are not same frequency) What’s your gateway?(heltec made?)

I have a RAK831 Gateway. It works fine with other Heltec boards like the WiFi LoRa 32. My frequency is US915MHz.

I’ve also tried using the US915 (hibrid) from the board configuration, still no success.

You should try using sub-band 2 within the US915 region (Canada / US and South America). My Arduino code contains the following along with the other LoRaWAN parameters:

/*LoraWan channelsmask, default channels 0-7*/ 
/*Changed to Sub-band 2 for TTN*/
uint16_t userChannelsMask[6]={ 0xFF00,0x0000,0x0000,0x0000,0x0000,0x0000 };
1 Like

This worked for me. Until I did this the join requests went into a black hole.

2 Likes

Signed up just to thank you for saving me so much time.

1 Like

Hi, MrPhisch,

What do you mean by “try using sub-band 2” and how it relates to the code you showed? If you or someone could explain it to me, I would be grateful. It might help me solve a problem I’m having.

Thanks!

Setting “userChannelsMask” in your code to what I showed in my example instructs the device to use only sub-band 2, which is required for TTN (if you’re using TTN, of course)

Oh, I see.

I’m actually using Chirpstack.

And I assume I could also instruct the device to use only other sub-band by changing “userChannelsMask” to something else? Why does 0xFF00,0x0000,0x0000,0x0000,0x0000,0x0000 instructs for sub-band 2? What is the logic behind it? I wish to understand.

By default, the code I’m using have:

/* LoraWan channelsmask, default channels 0-7 */ 
uint16_t userChannelsMask[6]={ 0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 };

Is it correct to assume that:
0xFF00,0x0000,0x0000,0x0000,0x0000,0x0000 enables channels from 0 - 3
0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 enables channels from 4 - 7
And so on?

You will almost certainly want to have the same sub-band configured in your network server (Chirpstack), your gateway(s), and on your LoRaWAN nodes.

For Chirpstack, see the ‘enabled_uplink_channels’ directive in your chirpstack-network-server.toml configuration file.
For example: To use sub-band 1,

[network_server.band]
name=“US_902_928”
[network_server.network_settings]
enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7, 64]

The above tells Chirpstack that you want to use the US915 band, and enable channels 0-7 (125 kHz uplink channels) as well as channel 64 (500 kHz uplink channel).

As for the arduino code for your nodes, ‘userChannelsMask’ is a bitmask written in hex.To enable uplink channels 0-7 (sub-band 1), use
uint16_t userChannelsMask[6]={ 0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 };

2 Likes