Problem of reading data with Dragino LDDS75

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"
        }
    }
]

Hi,

Different comments:

  • Codecs are working ok, first you get No sensor for distance and after modified you get Invalid reading.
  • Invalid reading is shown when distance value sent in uplink is lower than 20 mm. Which should be the right distance? Maybe are you putting your hand in front of the sensor?
  • Lorawan frame seems ok, you should send info on Events tab, in UnconfirmedDataUp → data. It is base64 payload. And we can check the real info sent by sensor.

Hi.
Thanks for the reply.

  • Codecs are working ok, first you get No sensor for distance and after modified you get Invalid reading.

ok

  • Invalid reading is shown when distance value sent in uplink is lower than 20 mm. Which should be the right distance? Maybe are you putting your hand in front of the sensor?

I’ve read the datasheet and agree with you: this sensor would not workk with very close objects, but I recall it was long, pointing at the ceiling. will recheck later today

  • Lorawan frame seems ok, you should send info on Events tab, in UnconfirmedDataUp → data. It is base64 payload. And we can check the real info sent by sensor.

Ok. This is a wonderful int.
I’ll turn the device back on and loook for this data.
Thanks for your help.

Hello @pulidoj
So, I don’t think I can answer to your last question properly
I don’t understand where to find the “Events Tab”.
Anyway: I turned the device back on, anch crosscheck not to put something in fronto of the reading.

These are the UnconfirmedDataUp, is that helping?
Thanks for your time!