Hi, I’m trying to connect my nano + RFM95W to TTN and thus my gateway that’s already connected.
Problem is, it doesn’t seem to connect, as it still says “never seen”
I’ve used this guide: HopeRF RFM95 and arduino a low cost LoRaWan solution - disk91.com - the IoT blogdisk91.com – the IoT blog to connect the nano with the RFM95 chip.
The code I made with help from a colleague (I’m an intern btw, this is a project I have to finish within the next 3-4 weeks, so I’m getting anxious) and looks as follows:
#define EU_868
#define DEBUG
#include <lorawan.h>
const sRFM_pins RFM_pins = {
.CS = 6,
.RST = 5,
.DIO0 = 3,
.DIO1 = 4,
};
void setup() {
// put your setup code here, to run once:
if (!lora.init()){
Serial.println(“RFM95W not detected”) ;
while (1);
}
// colleague added this, but other colleague wasn’t sure if this was necessary
// lora.setNwkSKey("-----------------------------------");
// lora.setAppSKey("------------------------------------");
// lora.setDevAddr("------------------");
lora.setDevEUI("-------------------------------");
lora.setAppEUI("-------------------------------------");
lora.setAppKey("-------------------------------------------");
lora.setDeviceClass(CLASS_A);
lora.setChannel(CH0);
lora.setDataRate(2);
bool isJoined;
do {
Serial.println(“Joining…”);
isJoined = lora.join();
//wait for 10s to try again
delay(10000);
}while(!isJoined);
Serial.println(“Joined to network”);
}
void loop() {
// put your main code here, to run repeatedly:
lora.update();
// put your main code here, to run repeatedly:
char myStr[] = “Ini data LoRa”;
lora.sendUplink(myStr, strlen(myStr), 0, 0);
lora.update();
delay(1000);
}
If someone can help me that would be wonderful, I have tried looking through this forum and I’m not sure if I’m just blind but I can’t find any topic that can truly help me with my case, you have my thanks already. (if I missed any information, please inform me and I’ll try adding it, or if I added some…sensitive? data I’ll remove it)