Sensor hub 2560 - payload structure

Hello ,

I am currently facing an issue with decoding a payload from my sensor hub, and I’m seeking assistance in understanding its structure and extracting the values from the payload bytes. Here are the details of my setup:
I have a sensor hub with a sensor probe, and the sensor probe has three I/O connections. The payload I am working with is: 007E001703016700E20270008003C00043.
I would greatly appreciate it if someone could help me understand the structure of this payload and guide me on how to determine the location of the values within the bytes. Any suggestions or assistance would be incredibly valuable.
Thank you

Are you looking for a payload decoder for TTN, Chirpstack or an integration like Datacake?

You can have a look into the SensorHub Decoder which works on TTN and Chirpstack V3.

Or the Standardized Payload Decoder. That works as well on Chirpstack V4.

1 Like

Yes , but also I need to understand the structure of the coming payload from the sensor hub in which specific byte the value of the sensor probes are hidden

bytes from the payload : “bytes”: [
0,
126,
0,
23,
3,
1,
103,
0,
229,
2,
112,
0,
124,
3,
192,
0,
58
]
},

It is CayenneLPP format, it is put together as
<sensor_id>,<sensor_type>,<sensor_value>

Sensor ID is just a number.
Sensor Type is defined in the payload decoder I pointed you to
Sensor value length is defined in the payload decoder I pointed you to

1 Like
  "decoded_payload": {
    "0": {
      "divisor": 1,
      "name": "digital_in",
      "signed": false,
      "size": 1
    },
    "1": {
      "divisor": 1,
      "name": "digital_out",
      "signed": false,
      "size": 1
    },
    "2": {
      "divisor": 100,
      "name": "analog_in",
      "signed": true,
      "size": 2
    },
    "3": {
      "divisor": 100,
      "name": "analog_out",
      "signed": true,
      "size": 2
    },
    "100": {
      "divisor": 1,
      "name": "generic",
      "signed": false,
      "size": 4
    },
    "101": {
      "divisor": 1,
      "name": "illuminance",
      "signed": false,
      "size": 2
    },
    "102": {
      "divisor": 1,
      "name": "presence",
      "signed": false,
      "size": 1
    },
    "103": {
      "divisor": 10,
      "name": "temperature",
      "signed": true,
      "size": 2
    },
    "104": {
      "divisor": 20,
      "name": "humidity",
      "signed": false,
      "size": 2
    },
    "112": {
      "divisor": 10,
      "name": "humidity_prec",
      "signed": true,
      "size": 2
    },
    "113": {
      "divisor": 1000,
      "name": "accelerometer",
      "signed": true,
      "size": 6
    },
    "115": {
      "divisor": 10,
      "name": "barometer",
      "signed": false,
      "size": 2
    },
    "116": {
      "divisor": 100,
      "name": "voltage",
      "signed": false,
      "size": 2
    },
    "117": {
      "divisor": 1000,
      "name": "current",
      "signed": false,
      "size": 2
    },
    "118": {
      "divisor": 1,
      "name": "frequency",
      "signed": false,
      "size": 4
    },
    "120": {
      "divisor": 1,
      "name": "percentage",
      "signed": false,
      "size": 1
    },
    "121": {
      "divisor": 1,
      "name": "altitude",
      "signed": true,
      "size": 2
    },
    "125": {
      "divisor": 1,
      "name": "concentration",
      "signed": false,
      "size": 2
    },
    "128": {
      "divisor": 1,
      "name": "power",
      "signed": false,
      "size": 2
    },
    "130": {
      "divisor": 1000,
      "name": "distance",
      "signed": false,
      "size": 4
    },
    "131": {
      "divisor": 1000,
      "name": "energy",
      "signed": false,
      "size": 4
    },
    "132": {
      "divisor": 1,
      "name": "direction",
      "signed": false,
      "size": 2
    },
    "133": {
      "divisor": 1,
      "name": "time",
      "signed": false,
      "size": 4
    },
    "134": {
      "divisor": 100,
      "name": "gyrometer",
      "signed": true,
      "size": 6
    },
    "135": {
      "divisor": 1,
      "name": "colour",
      "signed": false,
      "size": 3
    },
    "136": {
      "divisor": [
        10000,
        10000,
        100
      ],
      "name": "gps",
      "signed": true,
      "size": 9
    },
    "137": {
      "divisor": [
        1000000,
        1000000,
        100
      ],
      "name": "gps",
      "signed": true,
      "size": 11
    },
    "138": {
      "divisor": 1,
      "name": "voc",
      "signed": false,
      "size": 2
    },
    "142": {
      "divisor": 1,
      "name": "switch",
      "signed": false,
      "size": 1
    },
    "188": {
      "divisor": 10,
      "name": "soil_moist",
      "signed": false,
      "size": 2
    },
    "190": {
      "divisor": 100,
      "name": "wind_speed",
      "signed": false,
      "size": 2
    },
    "191": {
      "divisor": 1,
      "name": "wind_direction",
      "signed": false,
      "size": 2
    },
    "192": {
      "divisor": 1000,
      "name": "soil_ec",
      "signed": false,
      "size": 2
    },
    "193": {
      "divisor": 100,
      "name": "soil_ph_h",
      "signed": false,
      "size": 2
    },
    "194": {
      "divisor": 10,
      "name": "soil_ph_l",
      "signed": false,
      "size": 2
    },
    "195": {
      "divisor": 1,
      "name": "pyranometer",
      "signed": false,
      "size": 2
    },
    "203": {
      "divisor": 1,
      "name": "light",
      "signed": false,
      "size": 1
    }
  },

do I need to sign the value type for specific sensor type with channel id !

Hi Bernd, on Sensor Hub I get the following error for the SensorHub Decoder

BR, Claus

If I use the CayenneLPP formatter I can see two temperature values of sensor AB but no humidity and pressure.

What’s to do to see the other values, too?

I have learned something now! You must set the upload conditions for each sensor separately.

I think the decoding of the CayenneLPP decoder is wrong here. The content for humidity is 0x37. This is the correct value of 55%.

image

I tried the decoder from Github and it works better.

But for humidity, there is anything wrong. I will decode the payload by hand tomorrow. Maybe I will get an idea whats wrong.

Hi @ckuehnel

There is some changes in the sensor hub payload that are not CayenneLPP compatible.
Can you try this decoder ==> SensorHub.js

Hi Bernd,

after changing the source as follows, it works.

104: { ‘size’: 1, ‘name’: ‘humidity’, ‘signed’: false, ‘divisor’: 1},

and

var sensors = [];
//var i = 3;
//var num = (bytes[0] << 16) + (bytes[1] << 8) + bytes[2];
//var sens_num = formatHex(num, 6);
//sensors.push({
// ‘channel’: 0,
// ‘type’: 100,
// ‘name’: ‘probe_sn’,
// ‘value’: sens_num
//});
var i = 0;
while (i < bytes.length) {

I could not see the sens_num in the payload and therefore I deleted it from decoder.

I got a first idea of Sensor Hub and it is impresiv.

BR,
Claus

Dr. Claus Kühnel - Talstr. 13b - CH-8852 Altendorf
Mobile +41-76-3960801

Miniatur.png

The sensor number is still in the payload for some sensors and this drives me crazy, because of the different payload decoders required.
Here is the decoded payload of my setting (SensorHub with WindSpeed sensor and one T&H sensor):
image

But I am glad you like the SensorHub.