Heltec Cube Cell Decoder for BME680

Hi there
has anyone written a payload decoder BME680 for the Multisensor Example from Heltec ?

thanks a lot

You mean something like this:

function Decoder(bytes, port) {
  // Decode an uplink message from a buffer
  // (array) of bytes to an object of fields.
  var decoded = {};

  // if (port === 1) decoded.led = bytes[0];
  
  decoded.Temperature = (bytes[1] << 8) + bytes[0];
  decoded.Temperature=decoded.Temperature/100.0

  decoded.Pressure = (bytes[3] << 8) + bytes[2];
  decoded.Humidity = (bytes[5] << 8) + bytes[4];

  decoded.Humidity=decoded.Humidity/100.0
  return decoded;
}

This converts bytes “01 02 03 04 05 06” to 2 bytes = Temperature, next 2 bytes to Pressure and the final 2 bytes to Humidity.

Naming the return variables like decode.xxx wil return a json object that has this xxx=value.

1 Like

I may have misunderstood the question.

Are you referring to the payload bytes sent from the sensor to the loRaWan gateway and to be decoded in your application?

Or are you referring how to read the sensor data on the Heltec Cube Cell Decoder and convert this to the LoRaWan payload to be transmitted?

exactly :slight_smile:

i refer to the data sent by the cubecell to be decoded within the TTN

Beware that this does not support negative values.

1 Like

That is an extremely valid point! Negative values