Skip to content

Instantly share code, notes, and snippets.

@sabas1080
Created January 7, 2017 00:23
Show Gist options
  • Save sabas1080/3949e403ab3597036f9a28c97c879c72 to your computer and use it in GitHub Desktop.
Save sabas1080/3949e403ab3597036f9a28c97c879c72 to your computer and use it in GitHub Desktop.
#include <TheThingsNetwork.h>
#include <SoftwareSerial.h>
#define RESET 15
//SoftwareSerial loraSerial(4, 5); // RX, TX !! labels on relay board is swapped !!
#define loraSerial Serial1
#define debugSerial Serial
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan TTN_FP_US915
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
void setup()
{
loraSerial.begin(57600);
debugSerial.begin(9600);
pinMode(RESET,OUTPUT);
digitalWrite(RESET, HIGH);
}
void loop()
{
debugSerial.println("Device Information");
debugSerial.println();
ttn.showStatus();
debugSerial.println();
debugSerial.println("Use the EUI to register the device for OTAA");
debugSerial.println("-------------------------------------------");
debugSerial.println();
delay(10000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment