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.
Diff: main.cpp
- Revision:
- 10:717a3d909c6b
- Parent:
- 9:086351e54b57
- Child:
- 11:38ce10209eff
diff -r 086351e54b57 -r 717a3d909c6b main.cpp --- a/main.cpp Sat Nov 14 20:15:20 2015 +0000 +++ b/main.cpp Sat Nov 14 20:17:03 2015 +0000 @@ -30,7 +30,7 @@ uint8_t NwkSKey[16]= {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C}; // Network Address - Get your own address range at http://thethingsnetwork.org/wiki/AddressSpace -uint8_t NetworkAddr[4]= {0x02,0x01,0x2A,0x01}; // Temperature sensor/OxFloodNet sensor +uint8_t NetworkAddr[4]= {0x02,0x01,0xXX,0xXX}; // Our Network address or Node ID // Some defines for the LoRa configuration