Need help with setting up LoRa on ESP32 V3 LoRa Dev Board

Please post all relevant information as an issue or discussion on the RadioLib GitHub repo.
Try to include the bare minimum of your code that involves the setup and join, debug information after enabling the DEBUG flag, and some nicely formatted text blocks of what you see on your console.

I can see the join request and acceptance in the Helium Console, repeated over and over. I guess my sensor can’t tell he was accepted into the network.

Steven, I am sorry. The join requests were from one of my Heltec cubecell_AB02A boards. I was confused about which board was getting through to the Console.

With this in mind I probably should not post any code on RadioLib github repo as I imagine I still have my configuration incorrect.

Steven, I really want to test the SX1262 code, but still getting a -6 return code.

If you have a minute would you mind looking at my startup method to see if anything jumps out?

I tried adding your addional SPI configuration, but it did not change anything, so I am leaving it out
to keep the config as simple as possible.

#include <RadioLib.h>

//new slave select pin to use, defaults to 18
//new DIO0 pin to use, defaults to 26
//new reset pin to use, defaults to 14

uint32_t csPin = 8;
uint32_t irqPin = 14;
uint32_t rstPin = 12;
uint32_t gpioPin = 13;

SX1262 radio = new Module(csPin, irqPin, rstPin, gpioPin);
LoRaWANNode node(&radio, &US915);

void setup() {
  Serial.begin(115200);
  Serial.print(F("[SX1262] Initializing ... "));
  node.selectSubband(1);
  
  int state = radio.begin();

  if(state == RADIOLIB_ERR_NONE) {
    Serial.println(F("Lora success!"));
  }
  else
  {
    Serial.print(F("Lora failed, code "));
    Serial.println(state);
    while(true);
  }

  uint64_t joinEUI = 0x6081F...
  uint64_t devEUI = 0x6081F9...
  uint8_t nwkKey[] = { 0x15, 0xB1,...
  uint8_t appKey[] = {0x21, 0x75, ...

  Serial.print(F("[LoRaWAN] Attempting over-the-air activation ... "));
  state = node.beginOTAA(joinEUI, devEUI, nwkKey, appKey);

  if(state == RADIOLIB_ERR_NONE) {
    Serial.println(F("success!"));
  } else {
    Serial.print(F("failed, code "));
    Serial.println(state);
    while(true);
  }

}

The output is the same as above, but will include it here.

[SX1262] Initializing ... Channel UL 0 frequency = 902.299988 MHz
Channel UL 1 frequency = 902.500000 MHz
Channel UL 2 frequency = 902.700012 MHz
Channel UL 3 frequency = 902.899963 MHz
Channel UL 4 frequency = 903.099976 MHz
Channel UL 5 frequency = 903.299988 MHz
Channel UL 6 frequency = 903.500000 MHz
Channel UL 7 frequency = 903.700012 MHz

freq: 915.00
bw: 125.00
sf: 7
cr: 7
syncWord: 18
power: 10
preambleLength: 8
tcxoVoltage: 1.60
useRegulatorLDO: 0

RadioLib Debug Info
Version:  6.2.0.0
Platform: ESP32
Compiled: Nov 12 2023 19:18:01

Found SX126x: RADIOLIB_SX126X_REG_VERSION_STRING:
0000320 53 58 31 32 36 31 20 56 32 44 20 32 44 30 32 00 | SX1261 V2D 2D02.

M       SX126x
Lora success!
[LoRaWAN] Attempting over-the-air activation ...
Channel frequency UL = 902.299988 MHz
DR 72: LORA (SF: 10, BW: 125.000000, CR: 5)
Timeout in 556032 us
Join-request sent <-- Rx Delay start

Channel frequency DL = 923.299988 MHz
DR 64: LORA (SF: 10, BW: 500.000000, CR: 5)
Opening Rx1 window (71712 us timeout)... <-- Rx Delay end
closing
DR 96: LORA (SF: 12, BW: 500.000000, CR: 5)
Opening Rx2 window (185888 us timeout)... <-- Rx Delay end
closing
failed, code -6

Is your gateway really configured for subband 1? The default for US is almost always subband 2. So I’d try that first.

Yes, I have tried all 8 subchannels. I have spent hours trying all kinds of config, but still getting code -6.

My gateway is not working, but there are many in the neighborhood. The Helium Hotspot is typically not configured. You just plug it in and the LoraWan config is already configured.

Thank you for your continued interest in my attempts to use the new RadioLib classes.

Some more things:

  • how did you configure your device on the console? LoRaWAN version, regional parameters etc, some screenshot would be nice
  • can you enable some sort of verbose output on the console to see if there’s maybe a problem with keys or so which makes the join-request fail?

When you add a device to the Helium console, it automatically populates the deveui, appeui and appkey.
I have taken those values and inserted them into my code.

I do not see any verbose option.

Interesting, I found and configured a profile which mentions subband.

I set it to 2, and updated my code, but no luck.

ConsoleVersion

Is there any big or little indianness that I need to pay attention to?

What country to you live in Steven? I am in Austin Texas.

Help on Adding a device to Helium Console

Thank you for your help.

What I can see looks OK, but what I can’t see may be crucial:

  • Did you make sure that the AppEUI on the console is the joinEUI in the code? Since it is close to the devEUI but not exactly the same.
  • The console reports an “App Key”, but in the code this should be the “NwkKey” - I cannot tell if you configured this correctly.
  • Also, I assume that you configured your device as a LoRaWAN v1.1 device? That’s also not visible from the screenshot.

Oh, the AppKey should be the NwkKey.

Did not know that. Checking now.

node.selectSubband(2);

Yes, the AppEUI, is the joinEUI.
The NwkKey is now the appKey. (what should the appkey be?)
uint64_t devEUI = 0x6081F9CC292D9FCF; //v3
uint64_t joinEUI = 0x6081F9F682B030A7;
uint8_t appKey[] = { 0xCB, 0x87, 0xFB, 0x88, 0x8A, 0x66, 0x88, 0x25, 0x4B, 0xAA, 0xD0, 0x7B, 0x34, 0xC1, 0xhidden, 0xhidden };
uint8_t nwkKey[] = { 0xCB, 0x87, 0xFB, 0x88, 0x8A, 0x66, 0x88, 0x25, 0x4B, 0xAA, 0xD0, 0x7B, 0x34, 0xC1, 0xhidden, 0xhidden }; but they match the console config.

HConsole2

1 Like

The AppKey is ignored in LoRaWAN v1.1 sessions, so you can just keep it the same or set to all zeroes - doesn’t matter. This now looks good to me, so I’d say you give it a shot!

Yes, have and its a no go. Still -6 code.

The console has a debut mode and sits “waiting for data”. I launch the sensor and the console never sees anything.

I can’t see where I can specify LoRaWAN v1.1, but this next image does not look good.

Helium Console | Helium Documentation

Steven, I have to leave my house and go to work.
Thank you for the support.

I will look at your reply after I get off this afternoon.

I think you’ve defined your homework yourself with that screenshot :slight_smile:

Yes, I am trying to find out if the Console was upgraded to 1.1.

Looks like the legacy console.helium.com is LoraWan 1.0.3.

Sorry for taking your time up on this.

Thank again for your help.

1 Like

No problem, you’re welcome. Useful knowledge!
Now I’m curious - will you be looking for another stack such as the default LoRaWAN_APP, or another server such as TTN? That’s also useful knowledge… :slight_smile:

Well my goal for this board was to use it as a gateway for my other sensors around the property.

I was going to use LoraWan through the Helium network b/c I have a hotspot and there are 100s of them in Austin, TX.

I already have a Flow on the console that accepts msgs and sends them on to AzureIotHub and then on to an Azure Function that sends the data into Azure TableStorage.

So I wanted to use that route.

But it seems it is a no go…so far.

So my plan is to use the V3 board to receive Lora msgs and then use the Wifi to send straight to Azure IotHub.

Now I have to see if i can get Lora SX1262 talking to SX1278 radios. I don’t think that will be a big deal, but with radios in my experience, everything is a big deal. :slight_smile:

1 Like