Hi all,
Just got the Seeeduino LoRaWAN that I’m looking to set up with a ChirpStack server over a RAK7244 gateway. I’ve followed the guides here, except the part that says that I need to upgrade the modem firmware, since in the wiki it was 2.x, and my board shipped with 3.3.1 already, which seems much newer.
I currently have this simple code:
#include <LoRaWan.h>
unsigned char data[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA,};
char buffer[256];
void setup(void)
{
SerialUSB.begin(115200);
while(!SerialUSB);
lora.init();
memset(buffer, 0, 256);
lora.getVersion(buffer, 256, 1);
SerialUSB.print(buffer);
memset(buffer, 0, 256);
lora.getId(buffer, 256, 1);
SerialUSB.print(buffer);
lora.setId(NULL, "0000000000000000", "0000000000000000");
lora.setKey("2B7E151628AED2A6ABF7158809CF4F3C", "2B7E151628AED2A6ABF7158809CF4F3C", "2B7E151628AED2A6ABF7158809CF4F3C");
lora.setDeciveMode(LWOTAA);
lora.setDataRate(DR0, US915HYBRID);
lora.setChannel(0, 903.9);
lora.setChannel(1, 904.1);
lora.setChannel(2, 904.3);
lora.setReceiceWindowFirst(0, 903.9);
lora.setReceiceWindowSecond(923.3, DR3);
lora.setDutyCycle(false);
lora.setJoinDutyCycle(false);
lora.setPower(14);
while(!lora.setOTAAJoin(JOIN));
}
void loop(void)
{
bool result = false;
result = lora.transferPacket("Hello World!", 10);
if(result)
{
short length;
short rssi;
memset(buffer, 0, 256);
length = lora.receivePacket(buffer, 256, &rssi);
if(length)
{
SerialUSB.print("Length is: ");
SerialUSB.println(length);
SerialUSB.print("RSSI is: ");
SerialUSB.println(rssi);
SerialUSB.print("Data is: ");
for(unsigned char i = 0; i < length; i ++)
{
SerialUSB.print("0x");
SerialUSB.print(buffer[i], HEX);
SerialUSB.print(" ");
}
SerialUSB.println();
}
}
}
However, it seems that this doesn’t work and I’m not able to send anything:
+VER: 3.3.1
+ID: DevAddr, 00:00:00:00
+ID: DevEui, 00:00:00:00:00:00:00:00
+ID: AppEui, 00:00:00:00:00:00:00:00
+ID: DevEui, 00:00:00:00:00:00:00:00
+ID: AppEui, 00:00:00:00:00:00:00:00
+KEY: NWKSKEY 2B7E151628AED2A6ABF7158809CF4F3C
+KEY: APPSKEY 2B7E151628AED2A6ABF7158809CF4F3C
+KEY: APPKEY 2B7E151628AED2A6ABF7158809CF4F3C
+MODE: LWOTAA
+DR: US915HYBRID
+DR: DR0
+DR: US915HYBRID DR0 SF10 BW125K
+CH: 0,903900000,DR0:DR3
+CH: 1,904100000,DR0:DR3
+CH: 2,904300000,DR0:DR3
+RXWIN1: 0,903900000
+RXWIN2: 923300000,DR8
+LW: DC, OFF, 0
+LW: JDC, OFF
+POWER: 14
+JOIN: Start
+JOIN: NORMAL
+MSG: LoRaWAN modem is busy
+JOIN: Join failed
+JOIN: Done
+MSG: Please join network first
Any ideas on what could be wrong here? Thanks!