ph2lb / LoRaWAN_TTN_Env_Node

BME280 and Adruino ProMini based enviromental node with LMIC ABP.
35 stars 13 forks source link

LoRaWAN_TTN_Env_Node

Description :

Revision :

Hardware used :

Software and libraries used :

For licenses of the used libraries, check the links above.

Aditional note :

I use a HTTP integration on the TTN with the decoder / payload function below. :

function Decoder(bytes, port) 
{
  var retValue =   { 
    bytes: bytes
  };

  retValue.batt = bytes[0] / 10.0;
  if (retValue.batt === 0)
     delete retValue.batt; 

  if (bytes.length >= 2)
  {
    retValue.humidity = bytes[1];
    if (retValue.humidity === 0)
      delete retValue.humidity; 
  } 
  if (bytes.length >= 3)
  {
    retValue.temperature = (((bytes[2] << 8) | bytes[3]) / 10.0) - 40.0;
  } 
  if (bytes.length >= 5)
  { 
    retValue.pressure = ((bytes[4] << 8) | bytes[5]); 
    if (retValue.pressure === 0)
      delete retValue.pressure; 
  }

  return retValue; 
}