arduino-libraries / MKRWAN_v2

[Beta] Library for Arduino MKRWAN 1300 / 1310 suitable for firmwares derived from ST sources
GNU Lesser General Public License v3.0
7 stars 6 forks source link

US915 #30

Open andreax64 opened 1 year ago

andreax64 commented 1 year ago

Using MKRWAN 1310. I'm trying to setup an OTAA connection (modem.joinOTAA method) with US915 band, obviously doesn't work... But the question is why if I call the modem.getConf() method it tells me that Freq= 868000000 Hz? I don't think that's correct.

// CODE
#include <MKRWAN_v2.h>

LoRaModem modem;

String appEui = "xxxxxxx";
String appKey = "xxxxxxxxxx";

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("beginning....");
  if (!modem.begin(US915)) {
    Serial.println("Failed to start module");
    while (1) {}
  };
  delay(5000);

  int connected = modem.joinOTAA(appEui, appKey);
  Serial.println(modem.getTConf());
  if (!connected) {
    Serial.println("Something went wrong; are you indoor? Move near a window and retry");
    while (1) {}
  }
 Serial.println("Connected");
}

Serial OUTPUT:

GetTConf FailFreq= 868000000 Hz
Power= 14 dBm
Bandwidth= 125 kHz
SF= 12 
CR= 4/8 
LNA State =0  
PA Boost State =0  
868000000:14:125:12:4/8:0:0
Something went wrong; are you indoor? Move near a window and retry