Howto change from objectJSON tp object type?

i receive this format

{
    "applicationID": "123",
    "applicationName": "temperature-sensor",
    "deviceName": "garden-sensor",
    "devEUI": "AgICAgICAgI=",
    "rxInfo": [
        {
            "gatewayID": "AwMDAwMDAwM=",
            "time": "2019-11-08T13:59:25.048445Z",
            "timeSinceGPSEpoch": null,
            "rssi": -48,
            "loRaSNR": 9,
            "channel": 5,
            "rfChain": 0,
            "board": 0,
            "antenna": 0,
            "location": {
                "latitude": 52.3740364,
                "longitude": 4.9144401,
                "altitude": 10.5
            },
            "fineTimestampType": "NONE",
            "context": "9u/uvA==",
            "uplinkID": "jhMh8Gq6RAOChSKbi83RHQ=="
        }
    ],
    "txInfo": {
        "frequency": 868100000,
        "modulation": "LORA",
        "loRaModulationInfo": {
            "bandwidth": 125,
            "spreadingFactor": 11,
            "codeRate": "4/5",
            "polarizationInversion": false
        }
    },
    "adr": true,
    "dr": 1,
    "fCnt": 10,
    "fPort": 5,
    "data": "...",
    "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}",
    "tags": {
        "key": "value"
    }
}

how can i receive this format of data please:

{
    "applicationID": "123",
    "applicationName": "temperature-sensor",
    "deviceName": "garden-sensor",
    "devEUI": "0202020202020202",
    "rxInfo": [
        {
            "gatewayID": "0303030303030303",
            "name": "rooftop-gateway",
            "time": "2016-11-25T16:24:37.295915988Z",
            "rssi": -57,
            "loRaSNR": 10,
            "location": {
                "latitude": 52.3740364,
                "longitude": 4.9144401,
                "altitude": 10.5
            }
        }
    ],
    "txInfo": {
        "frequency": 868100000,
        "dr": 5
    },
    "adr": false,
    "fCnt": 10,
    "fPort": 5,
    "data": "...",
    "object": {
        "temperatureSensor": {"1": 25},
        "humiditySensor": {"1": 32}
    },
    "tags": {
        "key": "value"
    }
}

change the marshaler to
marshaler=“json”

1 Like

in the gateway bridge or application server? please

Actually, that should be json_v3. Please note that in the above examples it is in the Protobuf format as specified by https://github.com/brocaar/chirpstack-api/blob/master/protobuf/as/integration/integration.proto#L81. The Protobuf JSON mapping does not allow you to have a “freeform” object. Therefore, this field is of type string, containing the decoded payload as JSON string instead of object.

1 Like