-#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);
}



  digitalWrite(LED_PIN, HIGH);
  //the device will attempt a join every second till the join is successfull
  while(!ttn.join(appEui, appKey, 20, 5000)){
      Serial.println("---- backing off for a minute ---");
      delay(60000);
  }
  digitalWrite(LED_PIN, LOW);

