RAK811 module does not receive join accept message

Hi!

So i have implemented the rak811 module for connections with The Things Community Stack.

I recently had an issue with “uplink channel not found”, however I was told the solution was to turn off the other channels not designated for transmitting a join command. This solution worked, however I came across another problem.

I keep getting an error code: “RAK811 response error 99: LoRa join failed”

In my TTS console I spot that the gateway is transmitting a join accept message, however the rak811 module does not receive it…

Has anyone had any similar issues?

1 Like

Hi @trymjb ,

The issue on join frequencies will be solve on the next FW release.

Regarding your Error 99, what regional band are you operating?

The regional band used is EU868

@carlrowan My initial thought was that the rak811 timed out before it could receive the join accept downlink, however this was not the case as the error is a response error

You have no success yet on any join attempt?

Is the network layer setup you have in the TTN V3 look like this?

Have you doubled check the eui and keys (DEVEUI, APPEUI and APPKEY)?
What is the version of the FW?

No, however i managed to Get a connection to another gateway.

I have an idea that The gateway at home transmitts on The wrong port.

Let me Get back after i have done some more troubleshooting

1 Like

Given that it is basically the same problem, I’m not sure if it is needed to open another post.

Devices
End-node: RAK811
Gateway: RAK2247

Problem
Using join ABP works just fine, but OTAA won’t work, at least not with TTN v3 console. Though I remember having it working with TTN v2.
Given that I get an error code 82 The LoRa parameters are invalid. I think the answer should be pretty obvius. But I’ve tried setting new devices with no success. Maybe it is because the AppEUI is full of zeros? Not sure, but TTN v3 doesn’t generate one like before.

Pictures

Serial Monitor

  • ABP:
OK V3.0.0.14.H

Start init RAK811 parameters...
Current work region: AU915
RAK811 init OK!
Start to join LoRaWAN...
Join LoRaWAN success
Start send data...
1.29
OK

Start send data...
1.29
OK
  • OTAA:
********************************************************
LoRaWAN
********************************************************
OK V3.0.0.14.H

Start init RAK811 parameters...
Current work region: AU915
RAK811 init OK!
Start to join LoRaWAN...
ERROR: 82


Rejoin again after 5s...
ERROR: 82

Full-code
I’m using rak’s example with few changes.

/********************
 * This demo is only supported after RUI firmware version 3.0.0.13.X on RAK811
 * Master Board Uart Receive buffer size at least 128 bytes. 
 ********************/

#include "RAK811.h"
#define WORK_MODE LoRaWAN   //  LoRaWAN or LoRaP2P
#define JOIN_MODE ABP    //  OTAA or ABP
#if JOIN_MODE == OTAA
String DevEui = "0102030405060708"; // -> Changed
String AppEui = "0000000000000000"; // I'm using this one
String AppKey = "01020304050607080901020102030405010";  // -> Changed
#else JOIN_MODE == ABP
String NwkSKey = "01020304050607080901020102030405010";  // -> Changed
String AppSKey = "01020304050607080901020102030405010";  // -> Changed
String DevAddr = "01020304";  // -> Changed
#endif

#define DebugSerial Serial
#define LoRaSerial Serial4 

char buffer[60] = {0};
char res[15];
char hi[3] = {'h','i', '\0'};

bool InitLoRaWAN(void);
RAK811 RAKLoRa(LoRaSerial,DebugSerial);


void setup() {
  DebugSerial.begin(115200);
  while(!DebugSerial)
    ;
  DebugSerial.println(F("********************************************************"));
  DebugSerial.println(F("LoRaWAN"));
  DebugSerial.println(F("********************************************************"));

  LoRaSerial.begin(115200); //set LoRaSerial baudrate:This baud rate has to be consistent with  the baud rate of the WisNode device.
  while(LoRaSerial.available())
  {
    LoRaSerial.read(); 
  }

  RAKLoRa.rk_setWorkingMode(0);
//  if(!RAKLoRa.rk_setWorkingMode(0))  //set WisNode work_mode to LoRaWAN.
//  {
//    DebugSerial.println(F("set work_mode failed, please reset module."));
//    while(1);
//  }
  
  RAKLoRa.rk_getVersion();  //get RAK811 firmware version
  DebugSerial.println(RAKLoRa.rk_recvData());  //print version number

  DebugSerial.println(F("Start init RAK811 parameters..."));

  if (!InitLoRaWAN())  //init LoRaWAN
  {
    DebugSerial.println(F("Init error,please reset module.")); 
    while(1);
  }

  DebugSerial.println(F("Start to join LoRaWAN..."));
  while(!RAKLoRa.rk_joinLoRaNetwork(60))  //Joining LoRaNetwork timeout 60s
  {
    DebugSerial.println();
    DebugSerial.println(F("Rejoin again after 5s..."));
    delay(5000);
  }
  DebugSerial.println(F("Join LoRaWAN success"));

  if(!RAKLoRa.rk_isConfirm(0))  //set LoRa data send package type:0->unconfirm, 1->confirm
  {
    DebugSerial.println(F("LoRa data send package set error,please reset module.")); 
    while(1);    
  }
}

void loop() {
  DebugSerial.println(F("Start send data..."));

  int resistance = (int)((analogRead(A1)+250) * (3.3/1023.0) * 100); //123.45;
  itoa(resistance, res, 10);
  sprintf(buffer, "%s:%s", hi, res);

  DebugSerial.println(resistance/100.);
  
  if (RAKLoRa.rk_sendDataASCII(1, buffer, strlen(buffer)))
  {    
    for (unsigned long start = millis(); millis() - start < 60000L;)
    {
      String ret = RAKLoRa.rk_recvData();
      if(ret != "")
      { 
        DebugSerial.println(ret);
      }
    }
  }
}

bool InitLoRaWAN(void)
{
  #if JOIN_MODE == OTAA
  if(RAKLoRa.rk_setJoinMode(JOIN_MODE))  //set join_mode:OTAA
  {
    if(RAKLoRa.rk_setRegion(1))  //set region AU915
    {
      if (RAKLoRa.rk_initOTAA(DevEui, AppEui, AppKey))
      {
        DebugSerial.println(F("RAK811 init OK!"));  
        return true;    
      }
    }
  }
  return false;
  #else
  if(RAKLoRa.rk_setJoinMode(JOIN_MODE))  //set join_mode:ABP
  {
    if(RAKLoRa.rk_setRegion(1))  //set region EU868, alterado de 5 para 1
    {
      if (RAKLoRa.rk_initABP(DevAddr, NwkSKey, AppSKey))  //set ABP mode parameters
      {
        DebugSerial.println(F("RAK811 init OK!"));  
        return true;    
      }
    }
  }
  #endif
}
```

For example, I’ve just created another device with a devEUI that i got from TTN v2.
image

Than changed my keys within arduino IDE:

String DevEui = "00DC63B5EE6BB4C6";
String AppEui = "0000000000000000";
String AppKey = "78E61FC783769BBC3EDC8A4ABA0894B8";

But the error is the same:

********************************************************
LoRaWAN
********************************************************
OK V3.0.0.14.H

Start init RAK811 parameters...
Current work region: AU915
OTAA: RAK811 init OK!
Start to join LoRaWAN...
ERROR: 82


Rejoin again after 5s...
ERROR: 82

I don’t even see the messages in the gateway.

Gateway’s configuration:
image

But it works with ABP.

TTS CE (TTN v3) is a little more particular about which version of LoRaWAN you use.

Assuming the underlying LoRaMac-node is fairly recent on the current RAK firmware, you should try 1.0.4

But it is strange that 1.0.2 Rev B worked for ABP and won’t work for OTAA, isn’t it? Also, Rak’s guide show us 1.0.2.

I’ll try to use 1.0.4 as you suggested and check what happens.

Not really as the mechanisms have fundamental differences.

As this doesn’t appear to work for you, you’ll have to decide what to do next - stick with it, or try 1.0.4 or 1.0.3 …

Hi @SWoto ,

The all zero APPEUI is most likely the reason. You can’t change it once the device is already added.

Please try to add another devices and set the APPEUI again but not all zero.

1 Like

I’m not sure if this is a matter of version, because the gateway isn’t receiving anything. But I did change it to test:

In both of them, the gateway and the device live data show nothing about my messages and I keep getting error 82 The LoRa parameters are invalid.

I’ve changed the AppKey to 100000000000F04C to see what happens… And it worked! Thank you!

Than I changed what @nmcc suggested and it still works. To be sure, I’ve changed the appEUI back to 00 again ant it went to error 82. So we need to set it to something else.

Prints of it working

  • Gateway’s Live Data:
    Here we can see the first message that is the OTAA request, then the gateway’s answer, after that we have the payload and a confirmed message i guess, due to the downlink after it.

  • End-Node Network Layer

For the End-Node, I’m also using the appEUI that I mentioned before 100000000000F04C.

It seems it is verified now that the issues you have is caused by our FW not accepting all zero APPEUI.

Also, by default, all channels are enabled in RAK811 even if not the join frequencies. That’s probably why you have failure attempts on joining.

Over on the TTN forum we’re not overly keen on the all-Zero’s idea either, but we are told it’s a “thing” - even if many MAC implementations object to it.

So TTI are looking at generating EUI’s for Dev & App/Join to cover this - but don’t know on what timescale.

1 Like

Hi Nick,

What do you mean with MAC implementations? Like the LoRaWAN stack in the device?

I am actually pushing for us to support the all-zero APPEUI of TTS. But it is not seen as a priority. But if TTI team will create an APPEUI generation like before, then there will be no need to change in our side :slight_smile:

1 Like

Yes, either LoRaMac-node or LMIC - I’ve not really tested the 00’s as I have some proper EUI64’s to use - but reports on the TTN forum indicate a range of issues with the code base not co-operating - mostly with joins.

1 Like

Thank you Nick. It is really nice you are here keeping us updated :slight_smile:

Cheers.

Don’t forget, only 11 days of read-write TTN v2 left.

But with routing between v2 & v3 bi-directional, not an insurmountable problem.