Hello.
I’m trying to integrate Dragino LDDS75 in my system, using a selfhosted Chirpstack server.
At first I succeded in pairing the sensor, but in Sensor Data I received this information:
"objectJSON": "{\"Bat\":3.359,\"Distance\":\"No Sensor\",\"Interrupt_status\":1}",
Looked online and found this interesting thread on TTN forum. The user points out that the codec is not reading correctly the payload.
I changed the Codec in this way then
function Decode(fPort, bytes, variables) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
var len=bytes.length;
var value=(bytes[0]<<8 | bytes[1]) & 0x3FFF;
var batV=value/1000;//Battery,units:V
var distance = 0;
if(len==8) // change from 5 to 8 based on this trouble shooting https://www.thethingsnetwork.org/forum/t/dragino-ldds75-returns-no-sensor/539560
{
value=bytes[2]<<8 | bytes[3];
distance=(value);//distance,units:mm
if(value<20)
distance = "Invalid Reading";
}
else
distance = "No Sensor";
var interrupt = bytes[len-1];
return {
Bat:batV ,
Distance:distance,
Interrupt_status:interrupt
};
}
Now the device data says “Invalid Reading”
"objectJSON": "{\"Bat\":3.338,\"Distance\":\"Invalid Reading\",\"Interrupt_status\":1}",
The Lorawan Frames sections has this data og “gateway Undefined”
Any help?
[
{
"uplinkMetaData": {
"rxInfo": [
{
"gatewayID": "LPfxECRAABE=",
"time": "2023-10-30T09:12:16.782854497Z",
"timeSinceGPSEpoch": null,
"rssi": -81,
"loRaSNR": 9.5,
"channel": 0,
"rfChain": 1,
"board": 0,
"antenna": 0,
"location": {
"latitude": 0,
"longitude": 0,
"altitude": 0,
"source": "UNKNOWN",
"accuracy": 0
},
"fineTimestampType": "NONE",
"context": "aMxmZA==",
"uplinkID": "pBxt0qo2TCKFpdspaJN6Og==",
"crcStatus": "CRC_OK"
}
],
"txInfo": {
"frequency": 868100000,
"modulation": "LORA",
"loRaModulationInfo": {
"bandwidth": 125,
"spreadingFactor": 12,
"codeRate": "4/5",
"polarizationInversion": false
}
}
},
"phyPayload": {
"mhdr": {
"mType": "UnconfirmedDataUp",
"major": "LoRaWANR1"
},
"macPayload": {
"fhdr": {
"devAddr": "0188137b",
"fCtrl": {
"adr": true,
"adrAckReq": false,
"ack": false,
"fPending": false,
"classB": false
},
"fCnt": 265,
"fOpts": null
},
"fPort": 2,
"frmPayload": [
{
"bytes": "gMxl8rOx8PY="
}
]
},
"mic": "766089fa"
}
}
]