-#include <rn2483.h>
 #include <SoftwareSerial.h>
 
 #define RADIO_RESET_PIN 12

  delay(500);
  digitalWrite(12, HIGH);
  Serial.println("done.");
  
  String response = "";
  while (response=="")
  {
    delay(1000);
    Serial.print("autobaud...");
    loraSerial.write((byte)0x00);
    loraSerial.write(0x55);
    loraSerial.println();
    loraSerial.println("sys get ver");
    response = loraSerial.readStringUntil('\n');
    Serial.print(response);
  }
  Serial.println("..done.");
}


// the loop routine runs over and over again forever:
void send_to_TTN(String data)  {
  ttn.sendString(data);
  delay(20000);
}


//#endif

SoftwareSerial loraSerial(10, 11); // RX, TX

TheThingsNetwork ttn(loraSerial, Serial, TTN_FP_EU868);

void setup_radio()  {
  loraSerial.begin(9600);
  ttn.autobaud();
  ttn.provision(appEui, appKey);
  ttn.showStatus();

#if defined(REGISTERFIRST)
  Serial.println("You need to generate keys at TTN.");
