Custom Payload Decoder

Custom Payload Decoder

@Pat Molloy

Hi, I am a brand new user and a bit out of my depth when it comes to trying to get a custome decoder working - I am hoping this is easy for someone here to say “do this …”

I have a payload coming from a device via LTE-M, and I have no control over the payload it delivers (at least not easily at all).

I have applied the “custom JSON to TagoIO JSON decoder” and get a little bit of the way there …

This is what I see

13:45:40:
[POST] HTTP Request:
"From: 62.171.161.58 [node-fetch/1.0 (+https://github.com/bitinn/node-fetch)] - Content-Type: application/json - Token Ending: d0a59"
"From: 62.171.161.58 [node-fetch/1.0 (+https://github.com/bitinn/node-fetch)] - Content-Type: application/json - Token Ending: d0a59"
13:45:40:
Raw payload:
{ "serial": "CL352656104880656", "data": { "type": "G1", "mcc": "234", "mnc": "10", "latitude": "51.457310", "longitude": "-0.219395", "altitude": "45.995922", "speed": "0.225284", "heading": "129.096436", "fix_epoch": "1617021933", "battery_voltage": "2032", "x_accel": "-9.806592", "y_accel": "-1.379052", "z_accel": "-0.766140", "uptime": "12226772" } }
{
    "serial": "CL352656104880656",
    "data": {
        "type": "G1",
        "mcc": "234",
        "mnc": "10",
        "latitude": "51.457310",
        "longitude": "-0.219395",
        "altitude": "45.995922",
        "speed": "0.225284",
        "heading": "129.096436",
        "fix_epoch": "1617021933",
        "battery_voltage": "2032",
        "x_accel": "-9.806592",
        "y_accel": "-1.379052",
        "z_accel": "-0.766140",
        "uptime": "12226772"
    }
}
13:45:40:
Result of [device] payload parser:
[ { "variable": "serial", "value": "CL352656104880656", "serie": 1617021940856 }, { "variable": "data", "serie": 1617021940856 } ]
[
    {
        "variable": "serial",
        "value": "CL352656104880656",
        "serie": 1617021940856
    },
    {
        "variable": "data",
        "serie": 1617021940856
    }
]
13:45:40:
Bucket [fe2e]:"2 Data Added"
"2 Data Added"

So I can pick up the serial number with this script, but none of the other variables below …

Thanks!

Pat