How to connect The Things Uno (first version) to TTN community Edition (v3)
- The Things Uno
- Sensor (BMP280)
- Jump wires
- Computer with Arduino 1.8.12 and Internet Browser installed
- Internet Access
- TTN Gateway Access
Installing the libraries
- Go to Sketch->Include Library->Manage Libraries…
- Search for ‘The Things Network’ and click install on this library:
- Search for ‘BMP280’ and click install on this library:
- Connect the BMP280 sensor: GND->GND, VCC->3.3V, SCL->SCL, SDA->SDA.
- Load the ‘BMP280test’ file under ‘Examples->Adafruit_BMP280’:
- Select the ‘Arduino Leonardo Board’ under Tools->Board->Arduino AVR boards.
- Connect the Things Uno with the USB cable
- Select the given COM port under Tools->Port
- Upload the code to the The Things Uno
- The Monitor will show the Sensor output:
If the sensor could not be found, an error message will show up. Change the port of the sensor in the code, and upload again:
If the sensor does still not work, check your cabling, or try another ChipID (0x58). Mark these settings for the next section.
Get the DEVEUI
Next, upload the ‘DeviceInfo’ sketch under The Things Network Examples. Change the Frequency Plan as shown:
Upload the sketch and open the monitor:
Mark the DevEUI code (paste it in a notepad )
The Things Network
- Go to https://www.thethingsindustries.com/tts-plans/?tab=community
- Create a free Student or Individual account, using an existing mail address in the Europe 1 region.
- Open the Application and create one (‘my-first-ttn-sensors’ for example)
- Open the application and register an end device, fill in as shown:
- Press ‘confirm’ for the JoinEUI.
- Now you can enter the DevEUI as marked before:
- Click ‘generate’ to generate the AppKey and copy the value to your notepad for later use.
- End device ID is the given name for the sensor (you may change it to a name for your sensor)
- Click ‘Register end device’
Join the Things Network
- Download the code from https://github.com/galagaking/ttn_nodeworkshop/blob/master/TheThingsUno_BMP280-upload.ino
- Change the AppKey with the value you have copied from the TTN console (do not touch appEui, it has to be 0000000000000000):
- Also check the BMP280 settings as used before and change accordingly.
- Upload the code
- Open the Monitor
- The UNO will join the TTN network and post every 10 minutes temperature and pressure to the network.
Show the values
Open the application in TTN console and find ‘live data’
Interaction between the device is shown here:
To convert the data to normal values like ‘pressure’, copy the script from the comments in the Arduino code to the ‘Uplink Payload Formatter’:
Paste the code over the default script inside: