11#include < TheThingsNetwork.h>
22#include < TheThingsNode.h>
33
4- // These keys are for https://ttn.fyi/activate
5- // Replace them if you want to use your own app
6- const char *appEui = " 70B3D57EF0001CEE" ;
7- const char *appKey = " F2E5C891560FF9CE24AD56E1A69B85DF" ;
4+ // Set your AppEUI and AppKey
5+ const char *appEui = " 0000000000000000" ;
6+ const char *appKey = " 00000000000000000000000000000000" ;
87
98#define loraSerial Serial1
109#define debugSerial Serial
1110
1211// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
13- #define freqPlan REPLACE_ME
12+ #define freqPlan TTN_FP_EU868
1413
1514TheThingsNetwork ttn (loraSerial, debugSerial, freqPlan);
1615TheThingsNode *node;
@@ -24,8 +23,8 @@ void setup() {
2423 loraSerial.begin (57600 );
2524 debugSerial.begin (9600 );
2625
27- // Test LoRa module
28- ttn. showStatus ( );
26+ // Wait a maximum of 10s for Serial Monitor
27+ while (!debugSerial && millis () < 10000 );
2928
3029 // Config Node
3130 node = TheThingsNode::setup ();
@@ -41,12 +40,6 @@ void setup() {
4140 node->showStatus ();
4241 node->setColor (TTN_GREEN);
4342
44- // Wait a maximum of 10s for Serial Monitor
45- while (!debugSerial && millis () < 10000 );
46-
47- debugSerial.println (" -- NODE: STATUS" );
48- node->showStatus ();
49-
5043 debugSerial.println (" -- TTN: STATUS" );
5144 ttn.showStatus ();
5245
@@ -97,7 +90,7 @@ void sendData(uint8_t port) {
9790 node->showStatus ();
9891
9992 byte* bytes;
100- byte payload[9 ];
93+ byte payload[6 ];
10194
10295 uint16_t battery = node->getBattery ();
10396 bytes = (byte*) &battery;
0 commit comments