attnode/Firmware/README.md

972 B

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. Also since there is no permanent storage to store the Frame Counter, please disable the Frame Counter Check in the TTN console.

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;
}