Search code examples
arduinolorawan

How to set up a Seeeduino with LoRaWAN?


I'm trying to implement communication between a Seeeduino LoRaWAN and The Rhings Network. The gateway is set up, however I've been unable to load the correct LoRaWAN information onto the Seeeduino.

I've been following the tutorial from their website. The Seeeduino does connect and I can upload code onto the Seeeduino to read and print sensor data via serial, so the IDE settings, like the board should be correct.

Problem 1: library LoRaWan.h is not known. Problem 2: When using a different Beelan Lorawan library, the library import works, but commands such as lora.getversion, lora.setid, etc. cause an error, because they don't exist.

So the main question really is, how do I let the Seeeduino know which AppSKey, DevEUI, AppEUI, etc. it should use?

#include <LoRaWan.h>

void setup(void) {     
    Serial.begin(115200);
    lora.init();
    memset(buffer, 0, 256);
    lora.getVersion(buffer, 256, 1);
    SerialUprint(buffer); 
    memset(buffer, 0, 256);
    lora.getId(buffer, 256, 1);
    Serial.print(buffer);

    // void setId(char *DevAddr, char *DevEUI, char *AppEUI);
    lora.setId(NULL, "12409E2345695432", "70B3D57EF0006593");
    // setKey(char *NwkSKey, char *AppSKey, char *AppKey);
    lora.setKey(NULL, NULL, "47BDA77B6D7B4DDA7DC182E54295FE4E");
}

void loop(void) {   
}

Solution

  • The problem was with the newer 1.5.6 board version. Reverting to board version 1.3 of Seeed SAMD Boards installed the missing LoRaWaN library and allowed for a successfull setup of the lorawan components.