Demonstration TTN OTAA node

Dependencies:   BME280 DS1820 libmDot mbed-rtos mbed

This is an example application for the MultiTech mDot and connects to The Things Network using Over The Air Activation (OTAA). It sends data from a Dallas Semiconductors DS18B20 OneWire temperature sensor.

Register a device and generate a random AppKey for the currently used application Id: (You need to use your own device IDs, the ones shown here are examples only)

./ttnctl devices register 0080000000000000 INFO Generating random AppKey... INFO Registered device AppKey=000102030405060708090A0B0C0D0E0F DevEUI=0080000000000000

or to specify the same AppKey for a new device or to reregister the same device again:

./ttnctl devices register 0080000000000000 000102030405060708090A0B0C0D0E0F

./ttnctl devices info 0080000000000000 Dynamic device:

AppEUI: 70B3D50000000000 {0x70, 0xB3, 0xD5, 0x00, 0x00, 0x00, 0x00, 0x00}

DevEUI: 0080000000000000 {0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

AppKey: 000102030405060708090A0B0C0D0E0F {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}

Copy the AppEUI and AppKey values provided in hex array notation above to the AppEUI and AppKey parameters below.

Revision:
15:8a0ebf59b8bb
Parent:
13:5369ba22389a
--- a/main.cpp	Wed May 11 06:19:55 2016 +0000
+++ b/main.cpp	Wed May 11 06:26:11 2016 +0000
@@ -8,26 +8,27 @@
  * http://forum.thethingsnetwork.org/t/setting-up-multitech-conduit-gateway-for-ttn/216/35
  *
  * Register a device and generate a random AppKey for the currently used application Id:
+ * (You need to use your own device IDs, the ones shown here are examples only)
  *
- *./ttnctl devices register 0080000000009FC4
+ *./ttnctl devices register 0080000000000000
  * INFO Generating random AppKey...             
- * INFO Registered device                        AppKey=EC22CBC24733E3397B83C4C9DEA685A8 DevEUI=0080000000009FC4
+ * INFO Registered device                        AppKey=000102030405060708090A0B0C0D0E0F DevEUI=0080000000000000
  *
  * or to specify the same AppKey for a new device or to reregister the same device again:
  *
- * ./ttnctl devices register 0080000000009FC4 EC22CBC24733E3397B83C4C9DEA685A8
+ * ./ttnctl devices register 0080000000000000 000102030405060708090A0B0C0D0E0F
  *
- * ./ttnctl devices info 0080000000009FC4
+ * ./ttnctl devices info 0080000000000000
  * Dynamic device:
  *
- *  AppEUI:  70B3D57ED00000F6
- *           {0x70, 0xB3, 0xD5, 0x7E, 0xD0, 0x00, 0x00, 0xF6}
+ *  AppEUI:  70B3D50000000000
+ *           {0x70, 0xB3, 0xD5, 0x00, 0x00, 0x00, 0x00, 0x00}
  *
- *  DevEUI:  0080000000009FC4
- *           {0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x9F, 0xC4}
+ *  DevEUI:  0080000000000000
+ *           {0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
  *
- *  AppKey:  EC22CBC24733E3397B83C4C9DEA685A8
- *           {0xEC, 0x22, 0xCB, 0xC2, 0x47, 0x33, 0xE3, 0x39, 0x7B, 0x83, 0xC4, 0xC9, 0xDE, 0xA6, 0x85, 0xA8}
+ *  AppKey:  000102030405060708090A0B0C0D0E0F
+ *           {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}
  *
  *
  * Copy the AppEUI and AppKey values provided in hex array notation above to the AppEUI and AppKey parameters below.
@@ -49,9 +50,9 @@
 #define MAX(a,b) (((a)>(b))?(a):(b))
 
 // AppEUI
-uint8_t AppEUI[8]={0x70, 0xB3, 0xD5, 0x7E, 0xD0, 0x00, 0x00, 0xF6};
+uint8_t AppEUI[8]={0x70, 0xB3, 0xD5, 0x00, 0x00, 0x00, 0x00, 0x00};
 // AppKey
-uint8_t AppKey[16]={0xEC, 0x22, 0xCB, 0xC2, 0x47, 0x33, 0xE3, 0x39, 0x7B, 0x83, 0xC4, 0xC9, 0xDE, 0xA6, 0x85, 0xA8};
+uint8_t AppKey[16]={0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F};
 
 // Some defines for the LoRa configuration
 /*