WolkLoRa repo consists Arduino IDE example which makes connection to The Things Network. It's based on RN2483-Arduino-Library. Device measure enviroment temperature data on hearbeat event. This data can be routed from TTN to WolkAbout IoT Platform using apropiated decoder(below described as Application Decoder) and WolkAbout IoT Platform wizard.
Used Hardware:
Firmware dependencies:
-
Install following Arduino libs(HOW TO):
- OneWire
- DallasTemperature
-
Include files:
- src/rn2xx3.cpp and src/rn2xx3.h with Sketch/Include Library/Add .ZIP Library... in Arduino IDE. Original source is RN2483-Arduino-Library.
- Open one of WolkNode_TTN.ino example
- #define LoRA connection mode, OTAA or ABP
- Insert your TTN device parameters. Copy Example Code from device overview into WolkNode_TTN.ino
- Verify and Upload to device
To route data from TTN to WolkAbout IoT Platform create device on WolkAbout IoT Platofrm and copy following decoder into Payload Formats section on TTN Applications. Note that name of methode '.T' over var decoded is REF from device manifest on WolkAbout IoT platform.
function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var decoded = {};
var type = bytes[0];
switch (type) {
case 1:
decoded.T = bytes[1] + bytes[2]/100;
break;
default:
decoded.T = bytes[0];
}
return decoded;
}