attnode/Firmware
2019-09-19 18:14:51 +00:00
..
.vscode Initial Commit 2019-09-19 05:40:34 +02:00
lib Initial Commit 2019-09-19 05:40:34 +02:00
src Use Correct Prescaler Register 2019-09-19 13:49:24 +02:00
.gitignore Initial Commit 2019-09-19 05:40:34 +02:00
platformio.ini Initial Commit 2019-09-19 05:40:34 +02:00
README.md Added Decoder JS Code 2019-09-19 18:14:51 +00:00

TinyLoRa Firmware

Example Sensor Node Firmware with a BMP/E280 Sensor. Please Change the Values in src/secconfig.h to your Keys from https://console.thethingsnetwork.org. Device has to be set to ABP Mode.

Project was created using PlatformIO Atmel-AVR Framework

Decoder for the TTN Application

function Decoder(bytes, port) {
  var decoded = {};
  decoded.t = (bytes[0]) | (bytes[1] << 8 ) | (bytes[2] << 16 ) | (bytes[3] << 24)
  decoded.t = decoded.t / 100
  decoded.p = (bytes[4]) | (bytes[5] << 8 ) | (bytes[6] << 16 ) | (bytes[7] << 24)
  decoded.p = decoded.p / 100
  decoded.h = (bytes[8]) | (bytes[9] << 8 ) | (bytes[10] << 16 ) | (bytes[11] << 24)
  decoded.h = decoded.h / 100
  decoded.v = (bytes[12]) | (bytes[13] << 8 ) | (bytes[14] << 16 ) | (bytes[15] << 24)
  decoded.v = decoded.v / 1000

  return decoded;
}