diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/converter.json deleted file mode 100644 index 1ac036b1..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-5TM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-5TM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/legacy-soil-moisture-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return x[0] / 50; }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return 0.0000043 * Math.pow(x[0]/50, 3) - 0.00055 * Math.pow(x[0]/50, 2) + 0.0292 * (x[0]/50) - 0.053; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 400) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload.json deleted file mode 100644 index bb9e0e2d..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgI7AAMANwJxDGA=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_01.json deleted file mode 100644 index e1e30fd2..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgI7AAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 7a13643a..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgI7AAMANwJxDGA=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 2ef02da4..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgI7AAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result.json deleted file mode 100644 index 1ed6f07c..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "dielectric_permittivity": 1.1, - "volumetric_water_content": -0.0215397767, - "soil_temperature": 22.5, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_01.json deleted file mode 100644 index 2fbb63a8..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_02.json deleted file mode 100644 index 185e6bf3..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "dielectric_permittivity": 1.1, - "volumetric_water_content": -0.0215397767, - "soil_temperature": 22.5, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_03.json deleted file mode 100644 index b5e3fb3b..00000000 --- a/VENDORS/Decentlab/DL-5TM/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/converter.json deleted file mode 100644 index ec5e8e21..00000000 --- a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-5TM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-5TM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/legacy-soil-moisture-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return x[0] / 50; }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return 0.0000043 * Math.pow(x[0]/50, 3) - 0.00055 * Math.pow(x[0]/50, 2) + 0.0292 * (x[0]/50) - 0.053; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 400) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/payload.json deleted file mode 100644 index ab55e016..00000000 --- a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02023b0003003702710c60" -} diff --git a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/payload_01.json deleted file mode 100644 index c740f01e..00000000 --- a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02023b00020c60" -} diff --git a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/result.json deleted file mode 100644 index bc497463..00000000 --- a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "dielectric_permittivity": 1.1, - "volumetric_water_content": -0.0215397767, - "soil_temperature": 22.5, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/result_01.json deleted file mode 100644 index bba7bdee..00000000 --- a/VENDORS/Decentlab/DL-5TM/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/converter.json deleted file mode 100644 index f029da68..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-5TM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-5TM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/legacy-soil-moisture-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return x[0] / 50; }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return 0.0000043 * Math.pow(x[0]/50, 3) - 0.00055 * Math.pow(x[0]/50, 2) + 0.0292 * (x[0]/50) - 0.053; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 400) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/payload.json deleted file mode 100644 index 1998a4c3..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02023b0003003702710c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/payload_01.json deleted file mode 100644 index cb6e96a2..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02023b00020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/result.json deleted file mode 100644 index 78a026e9..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dielectric_permittivity": 1.1, - "volumetric_water_content": -0.0215397767, - "soil_temperature": 22.5, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/result_01.json deleted file mode 100644 index 8f1fbf89..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 48e4d432..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-5TM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-5TM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/legacy-soil-moisture-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return x[0] / 50; }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return 0.0000043 * Math.pow(x[0]/50, 3) - 0.00055 * Math.pow(x[0]/50, 2) + 0.0292 * (x[0]/50) - 0.053; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 400) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 1998a4c3..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02023b0003003702710c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index cb6e96a2..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02023b00020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 78a026e9..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dielectric_permittivity": 1.1, - "volumetric_water_content": -0.0215397767, - "soil_temperature": 22.5, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 8f1fbf89..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index b32f1ef1..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-5TM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-5TM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/legacy-soil-moisture-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return x[0] / 50; }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return 0.0000043 * Math.pow(x[0]/50, 3) - 0.00055 * Math.pow(x[0]/50, 2) + 0.0292 * (x[0]/50) - 0.053; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 400) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 882cc0df..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgI7AAMANwJxDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 72615093..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgI7AAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 02c4a961..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dielectric_permittivity": 1.1, - "volumetric_water_content": -0.0215397767, - "soil_temperature": 22.5, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 4a985ec6..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 4af3f48b..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-5TM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-5TM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/legacy-soil-moisture-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return x[0] / 50; }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return 0.0000043 * Math.pow(x[0]/50, 3) - 0.00055 * Math.pow(x[0]/50, 2) + 0.0292 * (x[0]/50) - 0.053; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 400) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 882cc0df..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgI7AAMANwJxDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 72615093..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgI7AAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 02c4a961..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dielectric_permittivity": 1.1, - "volumetric_water_content": -0.0215397767, - "soil_temperature": 22.5, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 4a985ec6..00000000 --- a/VENDORS/Decentlab/DL-5TM/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "571", - "deviceType": "DL-5TM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/info.json b/VENDORS/Decentlab/DL-5TM/info.json deleted file mode 100644 index f49a8185..00000000 --- a/VENDORS/Decentlab/DL-5TM/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/legacy-soil-moisture-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-5TM is equipped with a legacy soil moisture and a temperature sensor. Suitable for applications such as irrigation control, smart agriculture, parks, and golf courses." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-5TM/photo.png b/VENDORS/Decentlab/DL-5TM/photo.png deleted file mode 100644 index 6ca7f8dc..00000000 Binary files a/VENDORS/Decentlab/DL-5TM/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/converter.json deleted file mode 100644 index d1574d7c..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ALB", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ALB',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/albedometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'incoming_radiation',\n displayName: 'Incoming radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'reflected_radiation',\n displayName: 'Reflected radiation',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'albedo',\n displayName: 'albedo',\n convert: function (x) { return ((((x[0] - 32768) > 0) && ((x[1] - 32768) > 0)) ? (x[1] - 32768) / (x[0] - 32768) : 0); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload.json deleted file mode 100644 index 4e70d184..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlKFAAOAmYAiC9M=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 76dc4cad..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlKFAAIL0w==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_02.json deleted file mode 100644 index c3d7c7c1..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlKFAAOAmYAiC9M=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_03.json deleted file mode 100644 index f47fa73a..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlKFAAIL0w==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result.json deleted file mode 100644 index ead83377..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "incoming_radiation": 15.3, - "reflected_radiation": 3.4, - "albedo": 0.2222222222222222, - "battery_voltage": 3.027, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_01.json deleted file mode 100644 index 67cbbbd3..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.027, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_02.json deleted file mode 100644 index 1bc412bb..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "incoming_radiation": 15.3, - "reflected_radiation": 3.4, - "albedo": 0.2222222222222222, - "battery_voltage": 3.027, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_03.json deleted file mode 100644 index d3369c49..00000000 --- a/VENDORS/Decentlab/DL-ALB/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.027, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/converter.json deleted file mode 100644 index b400e735..00000000 --- a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ALB", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ALB',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/albedometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'incoming_radiation',\n displayName: 'Incoming radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'reflected_radiation',\n displayName: 'Reflected radiation',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'albedo',\n displayName: 'albedo',\n convert: function (x) { return ((((x[0] - 32768) > 0) && ((x[1] - 32768) > 0)) ? (x[1] - 32768) / (x[0] - 32768) : 0); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/payload.json deleted file mode 100644 index 7f2022d9..00000000 --- a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0252850003809980220bd3" -} diff --git a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/payload_01.json deleted file mode 100644 index a423c7ab..00000000 --- a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02528500020bd3" -} diff --git a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/result.json deleted file mode 100644 index b122a658..00000000 --- a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "incoming_radiation": 15.3, - "reflected_radiation": 3.4, - "albedo": 0.2222222222222222, - "battery_voltage": 3.027, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/result_01.json deleted file mode 100644 index f1c2a456..00000000 --- a/VENDORS/Decentlab/DL-ALB/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.027, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/converter.json deleted file mode 100644 index 4616c34c..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ALB", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ALB',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/albedometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'incoming_radiation',\n displayName: 'Incoming radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'reflected_radiation',\n displayName: 'Reflected radiation',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'albedo',\n displayName: 'albedo',\n convert: function (x) { return ((((x[0] - 32768) > 0) && ((x[1] - 32768) > 0)) ? (x[1] - 32768) / (x[0] - 32768) : 0); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/payload.json deleted file mode 100644 index cffb5dbf..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0252850003809980220bd3", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/payload_01.json deleted file mode 100644 index 7fd00c22..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02528500020bd3", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/result.json deleted file mode 100644 index c7bf4d24..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "incoming_radiation": 15.3, - "reflected_radiation": 3.4, - "albedo": 0.2222222222222222, - "battery_voltage": 3.027, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/result_01.json deleted file mode 100644 index f02bb150..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.027, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 9f3afdc5..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ALB", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ALB',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/albedometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'incoming_radiation',\n displayName: 'Incoming radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'reflected_radiation',\n displayName: 'Reflected radiation',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'albedo',\n displayName: 'albedo',\n convert: function (x) { return ((((x[0] - 32768) > 0) && ((x[1] - 32768) > 0)) ? (x[1] - 32768) / (x[0] - 32768) : 0); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index cffb5dbf..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0252850003809980220bd3", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 7fd00c22..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02528500020bd3", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index c7bf4d24..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "incoming_radiation": 15.3, - "reflected_radiation": 3.4, - "albedo": 0.2222222222222222, - "battery_voltage": 3.027, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index f02bb150..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.027, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 820c2df3..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ALB", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ALB',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/albedometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'incoming_radiation',\n displayName: 'Incoming radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'reflected_radiation',\n displayName: 'Reflected radiation',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'albedo',\n displayName: 'albedo',\n convert: function (x) { return ((((x[0] - 32768) > 0) && ((x[1] - 32768) > 0)) ? (x[1] - 32768) / (x[0] - 32768) : 0); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index e6e98a55..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlKFAAOAmYAiC9M=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 4dab3af4..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlKFAAIL0w==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 39dcfe66..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "incoming_radiation": 15.3, - "reflected_radiation": 3.4, - "albedo": 0.2222222222222222, - "battery_voltage": 3.027, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index ab3caf96..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.027, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index fa5d11ca..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ALB", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ALB',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/albedometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'incoming_radiation',\n displayName: 'Incoming radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'reflected_radiation',\n displayName: 'Reflected radiation',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: 'W⋅m⁻²'},\n {name: 'albedo',\n displayName: 'albedo',\n convert: function (x) { return ((((x[0] - 32768) > 0) && ((x[1] - 32768) > 0)) ? (x[1] - 32768) / (x[0] - 32768) : 0); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index e6e98a55..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlKFAAOAmYAiC9M=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 4dab3af4..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlKFAAIL0w==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 39dcfe66..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "incoming_radiation": 15.3, - "reflected_radiation": 3.4, - "albedo": 0.2222222222222222, - "battery_voltage": 3.027, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index ab3caf96..00000000 --- a/VENDORS/Decentlab/DL-ALB/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-ALB", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.027, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/info.json b/VENDORS/Decentlab/DL-ALB/info.json deleted file mode 100644 index 1d754c2d..00000000 --- a/VENDORS/Decentlab/DL-ALB/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/albedometer-sensor-for-lorawan", - "description": "The Decentlab DL-ALB is an albedometer sensor for LoRaWAN®. Suitable for applications such as solar panel arrays, incoming and reflected shortwave radiation measurement, agricultural measurements, and ecological and hydrological weather networks." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ALB/photo.png b/VENDORS/Decentlab/DL-ALB/photo.png deleted file mode 100644 index 79bfe05b..00000000 Binary files a/VENDORS/Decentlab/DL-ALB/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/converter.json deleted file mode 100644 index d4a2d7ad..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ATM22", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM22',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/wind-speed-wind-direction-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 8,\n values: [{name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload.json deleted file mode 100644 index d0a7c0d7..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgjJAAOACYErgBSBCIACf+iACIAEC/U=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 8754200e..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgjJAAIL9Q==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 9ae369d8..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgjJAAOACYErgBSBCIACf+iACIAEC/U=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 3d85a3e4..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgjJAAIL9Q==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result.json deleted file mode 100644 index 46f96f6a..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_01.json deleted file mode 100644 index 356105be..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_02.json deleted file mode 100644 index 762dbe9a..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_03.json deleted file mode 100644 index c8a0ec9b..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/converter.json deleted file mode 100644 index 0f2bb5f9..00000000 --- a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ATM22", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM22',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/wind-speed-wind-direction-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 8,\n values: [{name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/payload.json deleted file mode 100644 index 728a4473..00000000 --- a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0208c900038009812b8014810880027fe8800880040bf5" -} diff --git a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/payload_01.json deleted file mode 100644 index f4fe2dd3..00000000 --- a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0208c900020bf5" -} diff --git a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/result.json deleted file mode 100644 index 5ba7080c..00000000 --- a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/result_01.json deleted file mode 100644 index 62beeab5..00000000 --- a/VENDORS/Decentlab/DL-ATM22/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/converter.json deleted file mode 100644 index b513d9a5..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ATM22", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM22',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/wind-speed-wind-direction-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 8,\n values: [{name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/payload.json deleted file mode 100644 index 2c7aee26..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0208c900038009812b8014810880027fe8800880040bf5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/payload_01.json deleted file mode 100644 index 4f6132f8..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0208c900020bf5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/result.json deleted file mode 100644 index 3897b28e..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/result_01.json deleted file mode 100644 index b04be4b3..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index b2b0bf66..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ATM22", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM22',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/wind-speed-wind-direction-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 8,\n values: [{name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 2c7aee26..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0208c900038009812b8014810880027fe8800880040bf5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 4f6132f8..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0208c900020bf5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 3897b28e..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index b04be4b3..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index fdd5d394..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ATM22", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM22',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/wind-speed-wind-direction-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 8,\n values: [{name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index b2d5d37d..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgjJAAOACYErgBSBCIACf+iACIAEC/U=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index e5de2b71..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgjJAAIL9Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index edfd128e..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 6bcc924b..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 754e3fea..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ATM22", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM22',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/wind-speed-wind-direction-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 8,\n values: [{name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index b2d5d37d..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgjJAAOACYErgBSBCIACf+iACIAEC/U=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index e5de2b71..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgjJAAIL9Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index edfd128e..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 6bcc924b..00000000 --- a/VENDORS/Decentlab/DL-ATM22/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2249", - "deviceType": "DL-ATM22", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/info.json b/VENDORS/Decentlab/DL-ATM22/info.json deleted file mode 100644 index e7c3f27c..00000000 --- a/VENDORS/Decentlab/DL-ATM22/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/wind-speed-wind-direction-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-ATM22 consists of wind speed, wind gust, wind direction, tilt, and temperature sensors. It is suitable for smart agriculture, urban heat islands, and building automation." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM22/photo.png b/VENDORS/Decentlab/DL-ATM22/photo.png deleted file mode 100644 index 346eefd8..00000000 Binary files a/VENDORS/Decentlab/DL-ATM22/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/converter.json deleted file mode 100644 index 2bc0f27a..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ATM41", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM41',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/eleven-parameter-weather-station-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 17,\n values: [{name: 'solar_radiation',\n displayName: 'Solar radiation',\n convert: function (x) { return x[0] - 32768; },\n unit: 'W⋅m⁻²'},\n {name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return (x[1] - 32768) / 1000; },\n unit: 'mm'},\n {name: 'lightning_strike_count',\n displayName: 'Lightning strike count',\n convert: function (x) { return x[2] - 32768; }},\n {name: 'lightning_average_distance',\n displayName: 'Lightning average distance',\n convert: function (x) { return x[3] - 32768; },\n unit: 'km'},\n {name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[7] - 32768) / 10; },\n unit: '°C'},\n {name: 'vapor_pressure',\n displayName: 'Vapor pressure',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'relative_humidity',\n displayName: 'Relative humidity',\n convert: function (x) { return (x[10] - 32768) / 10; },\n unit: '%'},\n {name: 'sensor_temperature_internal',\n displayName: 'Sensor temperature (internal)',\n convert: function (x) { return (x[11] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[12] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[13] - 32768) / 10; },\n unit: '°'},\n {name: 'compass_heading',\n displayName: 'Compass heading',\n convert: function (x) { return x[14] - 32768; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[16] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload.json deleted file mode 100644 index 864a87a0..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgNaAAOACoAAgACAAIAJgSuAFIEIgLSlfIIMgQmAAn/ogFaACIAEC/U=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 823ad1b4..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgNaAAIL9Q==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 2a90328c..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgNaAAOACoAAgACAAIAJgSuAFIEIgLSlfIIMgQmAAn/ogFaACIAEC/U=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 28014f4a..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgNaAAIL9Q==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result.json deleted file mode 100644 index df80b615..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "solar_radiation": 10, - "precipitation": 0, - "lightning_strike_count": 0, - "lightning_average_distance": 0, - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "vapor_pressure": 1.8, - "atmospheric_pressure": 95.96, - "relative_humidity": 52.4, - "sensor_temperature_internal": 26.5, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "compass_heading": 86, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_01.json deleted file mode 100644 index ce584ae7..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_02.json deleted file mode 100644 index 26a8ac98..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "solar_radiation": 10, - "precipitation": 0, - "lightning_strike_count": 0, - "lightning_average_distance": 0, - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "vapor_pressure": 1.8, - "atmospheric_pressure": 95.96, - "relative_humidity": 52.4, - "sensor_temperature_internal": 26.5, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "compass_heading": 86, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_03.json deleted file mode 100644 index 0bd5a0e8..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/converter.json deleted file mode 100644 index 1ce99d27..00000000 --- a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ATM41", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM41',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/eleven-parameter-weather-station-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 17,\n values: [{name: 'solar_radiation',\n displayName: 'Solar radiation',\n convert: function (x) { return x[0] - 32768; },\n unit: 'W⋅m⁻²'},\n {name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return (x[1] - 32768) / 1000; },\n unit: 'mm'},\n {name: 'lightning_strike_count',\n displayName: 'Lightning strike count',\n convert: function (x) { return x[2] - 32768; }},\n {name: 'lightning_average_distance',\n displayName: 'Lightning average distance',\n convert: function (x) { return x[3] - 32768; },\n unit: 'km'},\n {name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[7] - 32768) / 10; },\n unit: '°C'},\n {name: 'vapor_pressure',\n displayName: 'Vapor pressure',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'relative_humidity',\n displayName: 'Relative humidity',\n convert: function (x) { return (x[10] - 32768) / 10; },\n unit: '%'},\n {name: 'sensor_temperature_internal',\n displayName: 'Sensor temperature (internal)',\n convert: function (x) { return (x[11] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[12] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[13] - 32768) / 10; },\n unit: '°'},\n {name: 'compass_heading',\n displayName: 'Compass heading',\n convert: function (x) { return x[14] - 32768; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[16] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/payload.json deleted file mode 100644 index 4df1704f..00000000 --- a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02035a0003800a8000800080008009812b8014810880b4a57c820c810980027fe88056800880040bf5" -} diff --git a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/payload_01.json deleted file mode 100644 index a2a109f1..00000000 --- a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02035a00020bf5" -} diff --git a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/result.json deleted file mode 100644 index 3322927b..00000000 --- a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/result.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "solar_radiation": 10, - "precipitation": 0, - "lightning_strike_count": 0, - "lightning_average_distance": 0, - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "vapor_pressure": 1.8, - "atmospheric_pressure": 95.96, - "relative_humidity": 52.4, - "sensor_temperature_internal": 26.5, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "compass_heading": 86, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/result_01.json deleted file mode 100644 index 49135ebc..00000000 --- a/VENDORS/Decentlab/DL-ATM41/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/converter.json deleted file mode 100644 index 71d7a4a3..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ATM41", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM41',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/eleven-parameter-weather-station-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 17,\n values: [{name: 'solar_radiation',\n displayName: 'Solar radiation',\n convert: function (x) { return x[0] - 32768; },\n unit: 'W⋅m⁻²'},\n {name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return (x[1] - 32768) / 1000; },\n unit: 'mm'},\n {name: 'lightning_strike_count',\n displayName: 'Lightning strike count',\n convert: function (x) { return x[2] - 32768; }},\n {name: 'lightning_average_distance',\n displayName: 'Lightning average distance',\n convert: function (x) { return x[3] - 32768; },\n unit: 'km'},\n {name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[7] - 32768) / 10; },\n unit: '°C'},\n {name: 'vapor_pressure',\n displayName: 'Vapor pressure',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'relative_humidity',\n displayName: 'Relative humidity',\n convert: function (x) { return (x[10] - 32768) / 10; },\n unit: '%'},\n {name: 'sensor_temperature_internal',\n displayName: 'Sensor temperature (internal)',\n convert: function (x) { return (x[11] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[12] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[13] - 32768) / 10; },\n unit: '°'},\n {name: 'compass_heading',\n displayName: 'Compass heading',\n convert: function (x) { return x[14] - 32768; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[16] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/payload.json deleted file mode 100644 index a98f0b0f..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02035a0003800a8000800080008009812b8014810880b4a57c820c810980027fe88056800880040bf5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/payload_01.json deleted file mode 100644 index 4a8a1e1d..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02035a00020bf5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/result.json deleted file mode 100644 index c7c009d5..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/result.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "solar_radiation": 10, - "precipitation": 0, - "lightning_strike_count": 0, - "lightning_average_distance": 0, - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "vapor_pressure": 1.8, - "atmospheric_pressure": 95.96, - "relative_humidity": 52.4, - "sensor_temperature_internal": 26.5, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "compass_heading": 86, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/result_01.json deleted file mode 100644 index 1b20be28..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 0b74b3d7..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ATM41", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM41',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/eleven-parameter-weather-station-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 17,\n values: [{name: 'solar_radiation',\n displayName: 'Solar radiation',\n convert: function (x) { return x[0] - 32768; },\n unit: 'W⋅m⁻²'},\n {name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return (x[1] - 32768) / 1000; },\n unit: 'mm'},\n {name: 'lightning_strike_count',\n displayName: 'Lightning strike count',\n convert: function (x) { return x[2] - 32768; }},\n {name: 'lightning_average_distance',\n displayName: 'Lightning average distance',\n convert: function (x) { return x[3] - 32768; },\n unit: 'km'},\n {name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[7] - 32768) / 10; },\n unit: '°C'},\n {name: 'vapor_pressure',\n displayName: 'Vapor pressure',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'relative_humidity',\n displayName: 'Relative humidity',\n convert: function (x) { return (x[10] - 32768) / 10; },\n unit: '%'},\n {name: 'sensor_temperature_internal',\n displayName: 'Sensor temperature (internal)',\n convert: function (x) { return (x[11] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[12] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[13] - 32768) / 10; },\n unit: '°'},\n {name: 'compass_heading',\n displayName: 'Compass heading',\n convert: function (x) { return x[14] - 32768; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[16] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index a98f0b0f..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02035a0003800a8000800080008009812b8014810880b4a57c820c810980027fe88056800880040bf5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 4a8a1e1d..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02035a00020bf5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index c7c009d5..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "solar_radiation": 10, - "precipitation": 0, - "lightning_strike_count": 0, - "lightning_average_distance": 0, - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "vapor_pressure": 1.8, - "atmospheric_pressure": 95.96, - "relative_humidity": 52.4, - "sensor_temperature_internal": 26.5, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "compass_heading": 86, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 1b20be28..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 9b462598..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ATM41", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM41',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/eleven-parameter-weather-station-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 17,\n values: [{name: 'solar_radiation',\n displayName: 'Solar radiation',\n convert: function (x) { return x[0] - 32768; },\n unit: 'W⋅m⁻²'},\n {name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return (x[1] - 32768) / 1000; },\n unit: 'mm'},\n {name: 'lightning_strike_count',\n displayName: 'Lightning strike count',\n convert: function (x) { return x[2] - 32768; }},\n {name: 'lightning_average_distance',\n displayName: 'Lightning average distance',\n convert: function (x) { return x[3] - 32768; },\n unit: 'km'},\n {name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[7] - 32768) / 10; },\n unit: '°C'},\n {name: 'vapor_pressure',\n displayName: 'Vapor pressure',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'relative_humidity',\n displayName: 'Relative humidity',\n convert: function (x) { return (x[10] - 32768) / 10; },\n unit: '%'},\n {name: 'sensor_temperature_internal',\n displayName: 'Sensor temperature (internal)',\n convert: function (x) { return (x[11] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[12] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[13] - 32768) / 10; },\n unit: '°'},\n {name: 'compass_heading',\n displayName: 'Compass heading',\n convert: function (x) { return x[14] - 32768; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[16] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 0eb9f1fc..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgNaAAOACoAAgACAAIAJgSuAFIEIgLSlfIIMgQmAAn/ogFaACIAEC/U=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 10b3b9e4..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgNaAAIL9Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 7722ae16..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "solar_radiation": 10, - "precipitation": 0, - "lightning_strike_count": 0, - "lightning_average_distance": 0, - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "vapor_pressure": 1.8, - "atmospheric_pressure": 95.96, - "relative_humidity": 52.4, - "sensor_temperature_internal": 26.5, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "compass_heading": 86, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index bbb472e4..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 36a2dfa0..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ATM41", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ATM41',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/eleven-parameter-weather-station-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 17,\n values: [{name: 'solar_radiation',\n displayName: 'Solar radiation',\n convert: function (x) { return x[0] - 32768; },\n unit: 'W⋅m⁻²'},\n {name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return (x[1] - 32768) / 1000; },\n unit: 'mm'},\n {name: 'lightning_strike_count',\n displayName: 'Lightning strike count',\n convert: function (x) { return x[2] - 32768; }},\n {name: 'lightning_average_distance',\n displayName: 'Lightning average distance',\n convert: function (x) { return x[3] - 32768; },\n unit: 'km'},\n {name: 'wind_speed',\n displayName: 'Wind speed',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'wind_direction',\n displayName: 'Wind direction',\n convert: function (x) { return (x[5] - 32768) / 10; },\n unit: '°'},\n {name: 'maximum_wind_speed',\n displayName: 'Maximum wind speed',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[7] - 32768) / 10; },\n unit: '°C'},\n {name: 'vapor_pressure',\n displayName: 'Vapor pressure',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'relative_humidity',\n displayName: 'Relative humidity',\n convert: function (x) { return (x[10] - 32768) / 10; },\n unit: '%'},\n {name: 'sensor_temperature_internal',\n displayName: 'Sensor temperature (internal)',\n convert: function (x) { return (x[11] - 32768) / 10; },\n unit: '°C'},\n {name: 'x_orientation_angle',\n displayName: 'X orientation angle',\n convert: function (x) { return (x[12] - 32768) / 10; },\n unit: '°'},\n {name: 'y_orientation_angle',\n displayName: 'Y orientation angle',\n convert: function (x) { return (x[13] - 32768) / 10; },\n unit: '°'},\n {name: 'compass_heading',\n displayName: 'Compass heading',\n convert: function (x) { return x[14] - 32768; },\n unit: '°'},\n {name: 'north_wind_speed',\n displayName: 'North wind speed',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: 'm⋅s⁻¹'},\n {name: 'east_wind_speed',\n displayName: 'East wind speed',\n convert: function (x) { return (x[16] - 32768) / 100; },\n unit: 'm⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 0eb9f1fc..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgNaAAOACoAAgACAAIAJgSuAFIEIgLSlfIIMgQmAAn/ogFaACIAEC/U=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 10b3b9e4..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgNaAAIL9Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 7722ae16..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "solar_radiation": 10, - "precipitation": 0, - "lightning_strike_count": 0, - "lightning_average_distance": 0, - "wind_speed": 0.09, - "wind_direction": 29.9, - "maximum_wind_speed": 0.2, - "air_temperature": 26.4, - "vapor_pressure": 1.8, - "atmospheric_pressure": 95.96, - "relative_humidity": 52.4, - "sensor_temperature_internal": 26.5, - "x_orientation_angle": 0.2, - "y_orientation_angle": -2.4, - "compass_heading": 86, - "north_wind_speed": 0.08, - "east_wind_speed": 0.04, - "battery_voltage": 3.061, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index bbb472e4..00000000 --- a/VENDORS/Decentlab/DL-ATM41/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "858", - "deviceType": "DL-ATM41", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.061, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/info.json b/VENDORS/Decentlab/DL-ATM41/info.json deleted file mode 100644 index 8576e73b..00000000 --- a/VENDORS/Decentlab/DL-ATM41/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/eleven-parameter-weather-station-for-lorawan", - "description": "The Decentlab DL-ATM41 consists of solar radiation, precipitation, vapor pressure, barometric pressure, humidity, temperature, horizontal wind speed, wind gust, wind direction, tilt, and lighting sensors. It is suitable for smart agriculture, urban heat islands, frost alarming, microclimate, and building automation." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ATM41/photo.png b/VENDORS/Decentlab/DL-ATM41/photo.png deleted file mode 100644 index 6f0b0911..00000000 Binary files a/VENDORS/Decentlab/DL-ATM41/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/converter.json deleted file mode 100644 index 59c71b17..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-BLG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-BLG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/black-globe-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage_ratio',\n displayName: 'Voltage ratio',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 2; }},\n {name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return 1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000; },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (1 / (0.0008271111 + 0.000208802 * Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000) + 0.000000080592 * Math.pow(Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000), 3) )) - 273.15; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload.json deleted file mode 100644 index 4bdffe8f..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AjDFAAOkDACBDGA=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 19c18c08..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AjDFAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_02.json deleted file mode 100644 index cb2a80f2..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AjDFAAOkDACBDGA=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_03.json deleted file mode 100644 index fbca1e7a..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AjDFAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result.json deleted file mode 100644 index f24873ef..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "voltage_ratio": 0.006409406661987305, - "thermistor_resistance": 115020.68221552655, - "temperature": 22.028848392450755, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_01.json deleted file mode 100644 index b302e996..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_02.json deleted file mode 100644 index a414c529..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "voltage_ratio": 0.006409406661987305, - "thermistor_resistance": 115020.68221552655, - "temperature": 22.028848392450755, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_03.json deleted file mode 100644 index 847b9e24..00000000 --- a/VENDORS/Decentlab/DL-BLG/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/converter.json deleted file mode 100644 index 52f54a5c..00000000 --- a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-BLG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-BLG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/black-globe-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage_ratio',\n displayName: 'Voltage ratio',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 2; }},\n {name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return 1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000; },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (1 / (0.0008271111 + 0.000208802 * Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000) + 0.000000080592 * Math.pow(Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000), 3) )) - 273.15; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/payload.json deleted file mode 100644 index c00301da..00000000 --- a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0230c50003a40c00810c60" -} diff --git a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/payload_01.json deleted file mode 100644 index c81627ee..00000000 --- a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0230c500020c60" -} diff --git a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/result.json deleted file mode 100644 index 95987873..00000000 --- a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "voltage_ratio": 0.006409406661987305, - "thermistor_resistance": 115020.68221552655, - "temperature": 22.028848392450755, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/result_01.json deleted file mode 100644 index dbe389e8..00000000 --- a/VENDORS/Decentlab/DL-BLG/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/converter.json deleted file mode 100644 index 660acb32..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-BLG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-BLG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/black-globe-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage_ratio',\n displayName: 'Voltage ratio',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 2; }},\n {name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return 1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000; },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (1 / (0.0008271111 + 0.000208802 * Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000) + 0.000000080592 * Math.pow(Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000), 3) )) - 273.15; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/payload.json deleted file mode 100644 index 1065e064..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0230c50003a40c00810c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/payload_01.json deleted file mode 100644 index 4d42d2ef..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0230c500020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/result.json deleted file mode 100644 index 8c5b7dba..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "voltage_ratio": 0.006409406661987305, - "thermistor_resistance": 115020.68221552655, - "temperature": 22.028848392450755, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/result_01.json deleted file mode 100644 index 20321654..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index efa25e8b..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-BLG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-BLG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/black-globe-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage_ratio',\n displayName: 'Voltage ratio',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 2; }},\n {name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return 1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000; },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (1 / (0.0008271111 + 0.000208802 * Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000) + 0.000000080592 * Math.pow(Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000), 3) )) - 273.15; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 1065e064..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0230c50003a40c00810c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 4d42d2ef..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0230c500020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 8c5b7dba..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "voltage_ratio": 0.006409406661987305, - "thermistor_resistance": 115020.68221552655, - "temperature": 22.028848392450755, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 20321654..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 10032cee..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-BLG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-BLG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/black-globe-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage_ratio',\n displayName: 'Voltage ratio',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 2; }},\n {name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return 1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000; },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (1 / (0.0008271111 + 0.000208802 * Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000) + 0.000000080592 * Math.pow(Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000), 3) )) - 273.15; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 7ec29f30..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AjDFAAOkDACBDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index a17b7487..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AjDFAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 7ce6f383..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "voltage_ratio": 0.006409406661987305, - "thermistor_resistance": 115020.68221552655, - "temperature": 22.028848392450755, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index cb017057..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 804101db..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-BLG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-BLG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/black-globe-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage_ratio',\n displayName: 'Voltage ratio',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 2; }},\n {name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return 1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000; },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (1 / (0.0008271111 + 0.000208802 * Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000) + 0.000000080592 * Math.pow(Math.log(1000 / (((x[0] + x[1]*65536) / 8388608 - 1) / 2) - 41000), 3) )) - 273.15; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 7ec29f30..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AjDFAAOkDACBDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index a17b7487..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AjDFAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 7ce6f383..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "voltage_ratio": 0.006409406661987305, - "thermistor_resistance": 115020.68221552655, - "temperature": 22.028848392450755, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index cb017057..00000000 --- a/VENDORS/Decentlab/DL-BLG/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "12485", - "deviceType": "DL-BLG", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/info.json b/VENDORS/Decentlab/DL-BLG/info.json deleted file mode 100644 index 2fa39b35..00000000 --- a/VENDORS/Decentlab/DL-BLG/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/black-globe-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-BLG is equipped with a black globe temperature sensor. It is suitable for use in workplace safety, heat stress measurement, WBGT calculation for heat stress and meteorology." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-BLG/photo.png b/VENDORS/Decentlab/DL-BLG/photo.png deleted file mode 100644 index 8fc5ee43..00000000 Binary files a/VENDORS/Decentlab/DL-BLG/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/converter.json deleted file mode 100644 index ad3aca88..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-CTD10", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CTD10',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'water_depth',\n displayName: 'Water depth',\n convert: function (x) { return x[0] - 32768; },\n unit: 'mm'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'},\n {name: 'freezing_flag',\n displayName: 'Freezing flag',\n convert: function (x) { return x[3]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload.json deleted file mode 100644 index 7ec519b6..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgfZAAOQiICBAGQAAAxg", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 5b56a146..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgfZAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 666bf2a5..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgfZAAOQiICBAGQAAAxg", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 5ee5f973..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgfZAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result.json deleted file mode 100644 index 607ba00a..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "water_depth": 4232, - "temperature": 12.9, - "electrical_conductivity": 100, - "freezing_flag": 0, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_01.json deleted file mode 100644 index e7506c37..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_02.json deleted file mode 100644 index 146d479f..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "water_depth": 4232, - "temperature": 12.9, - "electrical_conductivity": 100, - "freezing_flag": 0, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_03.json deleted file mode 100644 index a7239182..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/converter.json deleted file mode 100644 index 6ee09816..00000000 --- a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-CTD10", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CTD10',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'water_depth',\n displayName: 'Water depth',\n convert: function (x) { return x[0] - 32768; },\n unit: 'mm'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'},\n {name: 'freezing_flag',\n displayName: 'Freezing flag',\n convert: function (x) { return x[3]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/payload.json deleted file mode 100644 index ed695ff1..00000000 --- a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0207d9000390888081006400000c60" -} diff --git a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/payload_01.json deleted file mode 100644 index 2ced2882..00000000 --- a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0207d900020c60" -} diff --git a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/result.json deleted file mode 100644 index 0ca02ea8..00000000 --- a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "water_depth": 4232, - "temperature": 12.9, - "electrical_conductivity": 100, - "freezing_flag": 0, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/result_01.json deleted file mode 100644 index 8292d4b2..00000000 --- a/VENDORS/Decentlab/DL-CTD10/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/converter.json deleted file mode 100644 index e4daa3a1..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-CTD10", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CTD10',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'water_depth',\n displayName: 'Water depth',\n convert: function (x) { return x[0] - 32768; },\n unit: 'mm'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'},\n {name: 'freezing_flag',\n displayName: 'Freezing flag',\n convert: function (x) { return x[3]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/payload.json deleted file mode 100644 index 67b87251..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0207d9000390888081006400000c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/payload_01.json deleted file mode 100644 index 544a1910..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0207d900020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/result.json deleted file mode 100644 index fdfa9278..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "water_depth": 4232, - "temperature": 12.9, - "electrical_conductivity": 100, - "freezing_flag": 0, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/result_01.json deleted file mode 100644 index 347fd289..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 328989fb..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-CTD10", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CTD10',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'water_depth',\n displayName: 'Water depth',\n convert: function (x) { return x[0] - 32768; },\n unit: 'mm'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'},\n {name: 'freezing_flag',\n displayName: 'Freezing flag',\n convert: function (x) { return x[3]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 67b87251..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0207d9000390888081006400000c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 544a1910..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0207d900020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index fdfa9278..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "water_depth": 4232, - "temperature": 12.9, - "electrical_conductivity": 100, - "freezing_flag": 0, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 347fd289..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 345d2c44..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-CTD10", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CTD10',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'water_depth',\n displayName: 'Water depth',\n convert: function (x) { return x[0] - 32768; },\n unit: 'mm'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'},\n {name: 'freezing_flag',\n displayName: 'Freezing flag',\n convert: function (x) { return x[3]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 4eca9fb5..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgfZAAOQiICBAGQAAAxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 9e6d16e7..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgfZAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index e819f34f..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "water_depth": 4232, - "temperature": 12.9, - "electrical_conductivity": 100, - "freezing_flag": 0, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index dcbbdc6b..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 63ac59ec..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-CTD10", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CTD10',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'water_depth',\n displayName: 'Water depth',\n convert: function (x) { return x[0] - 32768; },\n unit: 'mm'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'},\n {name: 'freezing_flag',\n displayName: 'Freezing flag',\n convert: function (x) { return x[3]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 4eca9fb5..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgfZAAOQiICBAGQAAAxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 9e6d16e7..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgfZAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index e819f34f..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "water_depth": 4232, - "temperature": 12.9, - "electrical_conductivity": 100, - "freezing_flag": 0, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index dcbbdc6b..00000000 --- a/VENDORS/Decentlab/DL-CTD10/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2009", - "deviceType": "DL-CTD10", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/info.json b/VENDORS/Decentlab/DL-CTD10/info.json deleted file mode 100644 index 67b0fa86..00000000 --- a/VENDORS/Decentlab/DL-CTD10/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan", - "description": "The Decentlab DL-CTD10 consists of pressure/liquid level, temperature, and electrical conductivity sensors. It is suitable for use in monitoring level/depth and water quality in tanks for liquids, groundwater and wells, running or open water level and quality, and salinity and chloride monitoring." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CTD10/photo.png b/VENDORS/Decentlab/DL-CTD10/photo.png deleted file mode 100644 index dc1c25c5..00000000 Binary files a/VENDORS/Decentlab/DL-CTD10/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/converter.json deleted file mode 100644 index 9522f81d..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-CWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload.json deleted file mode 100644 index fc693f71..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AkY5AAOKd4qVl3qHTIBHil4LdA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 0d2a9f45..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AkY5AAILdA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 6fe01ec0..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AkY5AAOKd4qVl3qHTIBHil4LdA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_03.json deleted file mode 100644 index b657a3b6..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AkY5AAILdA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result.json deleted file mode 100644 index 15f8d734..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "surface_temperature": 26.79, - "air_temperature": 27.09, - "air_humidity": 60.1, - "dew_point": 18.68, - "angle": 71, - "sensor_temperature": 26.54, - "battery_voltage": 2.932, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_01.json deleted file mode 100644 index a5339ee4..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.932, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_02.json deleted file mode 100644 index d5d9aebe..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "surface_temperature": 26.79, - "air_temperature": 27.09, - "air_humidity": 60.1, - "dew_point": 18.68, - "angle": 71, - "sensor_temperature": 26.54, - "battery_voltage": 2.932, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_03.json deleted file mode 100644 index 2627936a..00000000 --- a/VENDORS/Decentlab/DL-CWS/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.932, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/converter.json deleted file mode 100644 index 3b3b94f8..00000000 --- a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-CWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/payload.json deleted file mode 100644 index b9ec3d50..00000000 --- a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02463900038a778a95977a874c80478a5e0b74" -} diff --git a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/payload_01.json deleted file mode 100644 index 910d3b28..00000000 --- a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02463900020b74" -} diff --git a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/result.json deleted file mode 100644 index 2dda155e..00000000 --- a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "surface_temperature": 26.79, - "air_temperature": 27.09, - "air_humidity": 60.1, - "dew_point": 18.68, - "angle": 71, - "sensor_temperature": 26.54, - "battery_voltage": 2.932, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/result_01.json deleted file mode 100644 index 2c7803ee..00000000 --- a/VENDORS/Decentlab/DL-CWS/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.932, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/converter.json deleted file mode 100644 index 60dc95ba..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-CWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/payload.json deleted file mode 100644 index c263c828..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02463900038a778a95977a874c80478a5e0b74", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/payload_01.json deleted file mode 100644 index c4bb0c97..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02463900020b74", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/result.json deleted file mode 100644 index 4b5df3c9..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "surface_temperature": 26.79, - "air_temperature": 27.09, - "air_humidity": 60.1, - "dew_point": 18.68, - "angle": 71, - "sensor_temperature": 26.54, - "battery_voltage": 2.932, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/result_01.json deleted file mode 100644 index 5fdf462a..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.932, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 8aa91d69..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-CWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index c263c828..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02463900038a778a95977a874c80478a5e0b74", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index c4bb0c97..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02463900020b74", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 4b5df3c9..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "surface_temperature": 26.79, - "air_temperature": 27.09, - "air_humidity": 60.1, - "dew_point": 18.68, - "angle": 71, - "sensor_temperature": 26.54, - "battery_voltage": 2.932, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 5fdf462a..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.932, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 6b989f14..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-CWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index ce396b36..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkY5AAOKd4qVl3qHTIBHil4LdA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 60248225..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkY5AAILdA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index ed00389a..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "surface_temperature": 26.79, - "air_temperature": 27.09, - "air_humidity": 60.1, - "dew_point": 18.68, - "angle": 71, - "sensor_temperature": 26.54, - "battery_voltage": 2.932, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index ee41a426..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.932, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 27f633c4..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-CWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index ce396b36..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkY5AAOKd4qVl3qHTIBHil4LdA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 60248225..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkY5AAILdA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index ed00389a..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "surface_temperature": 26.79, - "air_temperature": 27.09, - "air_humidity": 60.1, - "dew_point": 18.68, - "angle": 71, - "sensor_temperature": 26.54, - "battery_voltage": 2.932, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index ee41a426..00000000 --- a/VENDORS/Decentlab/DL-CWS/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17977", - "deviceType": "DL-CWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.932, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/info.json b/VENDORS/Decentlab/DL-CWS/info.json deleted file mode 100644 index 4d8a0e19..00000000 --- a/VENDORS/Decentlab/DL-CWS/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-for-lorawan", - "description": "The Decentlab DL-CWS includes a high-precision infrared pyrometer, temperature, humidity and dew point sensors. It is suitable for use in road weather information systems, winter road maintenance, frost alarming, ice alerting, and smart agriculture." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS/photo.png b/VENDORS/Decentlab/DL-CWS/photo.png deleted file mode 100644 index b09d63b9..00000000 Binary files a/VENDORS/Decentlab/DL-CWS/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/converter.json deleted file mode 100644 index de2bad52..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-CWS2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature_radiation_shield',\n displayName: 'Air temperature (radiation shield)',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity_radiation_shield',\n displayName: 'Air humidity (radiation shield)',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload.json deleted file mode 100644 index 4d85d6e0..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AljAAAdGdvoKgcmBP6bYgTeAJYEwC5E=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 666b9280..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AljAAAQLkQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_02.json deleted file mode 100644 index fb2354a6..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AljAAAdGdvoKgcmBP6bYgTeAJYEwC5E=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_03.json deleted file mode 100644 index ccf7fadc..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AljAAAQLkQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result.json deleted file mode 100644 index dfe3ebe6..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "air_temperature_radiation_shield": 3.167391470206759, - "air_humidity_radiation_shield": 97.67299916075379, - "surface_temperature": 4.57, - "air_temperature": 3.19, - "air_humidity": 99.44, - "dew_point": 3.11, - "angle": 37, - "sensor_temperature": 3.04, - "battery_voltage": 2.961, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_01.json deleted file mode 100644 index 6bdcc0ec..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.961, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_02.json deleted file mode 100644 index 561bca64..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "air_temperature_radiation_shield": 3.167391470206759, - "air_humidity_radiation_shield": 97.67299916075379, - "surface_temperature": 4.57, - "air_temperature": 3.19, - "air_humidity": 99.44, - "dew_point": 3.11, - "angle": 37, - "sensor_temperature": 3.04, - "battery_voltage": 2.961, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_03.json deleted file mode 100644 index 0f1752ef..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.961, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/converter.json deleted file mode 100644 index 710bd209..00000000 --- a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-CWS2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature_radiation_shield',\n displayName: 'Air temperature (radiation shield)',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity_radiation_shield',\n displayName: 'Air humidity (radiation shield)',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/payload.json deleted file mode 100644 index e5883482..00000000 --- a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0258c000074676fa0a81c9813fa6d88137802581300b91" -} diff --git a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/payload_01.json deleted file mode 100644 index 8eac2c79..00000000 --- a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0258c000040b91" -} diff --git a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/result.json deleted file mode 100644 index c31f4f1f..00000000 --- a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "air_temperature_radiation_shield": 3.167391470206759, - "air_humidity_radiation_shield": 97.67299916075379, - "surface_temperature": 4.57, - "air_temperature": 3.19, - "air_humidity": 99.44, - "dew_point": 3.11, - "angle": 37, - "sensor_temperature": 3.04, - "battery_voltage": 2.961, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/result_01.json deleted file mode 100644 index bbc64ce0..00000000 --- a/VENDORS/Decentlab/DL-CWS2/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.961, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/converter.json deleted file mode 100644 index ae7dff2e..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-CWS2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature_radiation_shield',\n displayName: 'Air temperature (radiation shield)',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity_radiation_shield',\n displayName: 'Air humidity (radiation shield)',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/payload.json deleted file mode 100644 index aa3420b0..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0258c000074676fa0a81c9813fa6d88137802581300b91", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/payload_01.json deleted file mode 100644 index 28419e2b..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0258c000040b91", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/result.json deleted file mode 100644 index cf9a81b2..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature_radiation_shield": 3.167391470206759, - "air_humidity_radiation_shield": 97.67299916075379, - "surface_temperature": 4.57, - "air_temperature": 3.19, - "air_humidity": 99.44, - "dew_point": 3.11, - "angle": 37, - "sensor_temperature": 3.04, - "battery_voltage": 2.961, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/result_01.json deleted file mode 100644 index 0a38c7a9..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.961, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index fe537171..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-CWS2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature_radiation_shield',\n displayName: 'Air temperature (radiation shield)',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity_radiation_shield',\n displayName: 'Air humidity (radiation shield)',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index aa3420b0..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0258c000074676fa0a81c9813fa6d88137802581300b91", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 28419e2b..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0258c000040b91", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index cf9a81b2..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature_radiation_shield": 3.167391470206759, - "air_humidity_radiation_shield": 97.67299916075379, - "surface_temperature": 4.57, - "air_temperature": 3.19, - "air_humidity": 99.44, - "dew_point": 3.11, - "angle": 37, - "sensor_temperature": 3.04, - "battery_voltage": 2.961, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 0a38c7a9..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.961, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index d5ca8914..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-CWS2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature_radiation_shield',\n displayName: 'Air temperature (radiation shield)',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity_radiation_shield',\n displayName: 'Air humidity (radiation shield)',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 599def34..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AljAAAdGdvoKgcmBP6bYgTeAJYEwC5E=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index b25537a7..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AljAAAQLkQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 3a15fa0b..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature_radiation_shield": 3.167391470206759, - "air_humidity_radiation_shield": 97.67299916075379, - "surface_temperature": 4.57, - "air_temperature": 3.19, - "air_humidity": 99.44, - "dew_point": 3.11, - "angle": 37, - "sensor_temperature": 3.04, - "battery_voltage": 2.961, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 4816b797..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.961, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index c6757543..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-CWS2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-CWS2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-winter-road-maintenance-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature_radiation_shield',\n displayName: 'Air temperature (radiation shield)',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity_radiation_shield',\n displayName: 'Air humidity (radiation shield)',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 6,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'angle',\n displayName: 'Angle',\n convert: function (x) { return (x[4] - 32768); },\n unit: '°'},\n {name: 'sensor_temperature',\n displayName: 'Sensor temperature',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 599def34..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AljAAAdGdvoKgcmBP6bYgTeAJYEwC5E=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index b25537a7..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AljAAAQLkQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 3a15fa0b..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature_radiation_shield": 3.167391470206759, - "air_humidity_radiation_shield": 97.67299916075379, - "surface_temperature": 4.57, - "air_temperature": 3.19, - "air_humidity": 99.44, - "dew_point": 3.11, - "angle": 37, - "sensor_temperature": 3.04, - "battery_voltage": 2.961, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 4816b797..00000000 --- a/VENDORS/Decentlab/DL-CWS2/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22720", - "deviceType": "DL-CWS2", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.961, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/info.json b/VENDORS/Decentlab/DL-CWS2/info.json deleted file mode 100644 index 1973c83c..00000000 --- a/VENDORS/Decentlab/DL-CWS2/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/high-precision-winter-road-maintenance-sensor-with-radiation-shield-for-lorawan", - "description": "The Decentlab DL-CWS2 includes a high-precision infrared pyrometer, temperature, humidity and dew point sensors. It is suitable for use in road weather information systems, winter road maintenance, frost alarming, ice alerting, and smart agriculture." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-CWS2/photo.png b/VENDORS/Decentlab/DL-CWS2/photo.png deleted file mode 100644 index b09d63b9..00000000 Binary files a/VENDORS/Decentlab/DL-CWS2/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/converter.json deleted file mode 100644 index 1585e176..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-002", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-002',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'pulse_count',\n displayName: 'Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'pulse_interval',\n displayName: 'Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_pulse_count',\n displayName: 'Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/payload.json deleted file mode 100644 index d4ae578c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhmeAAMAAAJYAAAAAAyb", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 5a70373f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhmeAAMAAAJYAAAAAAyb", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/result.json deleted file mode 100644 index c1547ef6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "6558", - "deviceType": "DL-DLR2-002", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "pulse_count": 0, - "pulse_interval": 600, - "cumulative_pulse_count": 0, - "battery_voltage": 3.227, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/result_01.json deleted file mode 100644 index 4646061b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "6558", - "deviceType": "DL-DLR2-002", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "pulse_count": 0, - "pulse_interval": 600, - "cumulative_pulse_count": 0, - "battery_voltage": 3.227, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/converter.json deleted file mode 100644 index fc39808e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-002", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-002',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'pulse_count',\n displayName: 'Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'pulse_interval',\n displayName: 'Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_pulse_count',\n displayName: 'Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/payload.json deleted file mode 100644 index 45cfdc65..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02199e000300000258000000000c9b" -} diff --git a/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/result.json deleted file mode 100644 index 8b8fe26f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/LORIOT/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "6558", - "deviceType": "DL-DLR2-002", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "pulse_count": 0, - "pulse_interval": 600, - "cumulative_pulse_count": 0, - "battery_voltage": 3.227, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/converter.json deleted file mode 100644 index 41d7b603..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-002", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-002',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'pulse_count',\n displayName: 'Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'pulse_interval',\n displayName: 'Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_pulse_count',\n displayName: 'Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/payload.json deleted file mode 100644 index a9e7c820..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02199e000300000258000000000c9b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/result.json deleted file mode 100644 index 783ffefb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingPark/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "6558", - "deviceType": "DL-DLR2-002", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pulse_count": 0, - "pulse_interval": 600, - "cumulative_pulse_count": 0, - "battery_voltage": 3.227, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 1e5814db..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-002", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-002',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'pulse_count',\n displayName: 'Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'pulse_interval',\n displayName: 'Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_pulse_count',\n displayName: 'Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index a9e7c820..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02199e000300000258000000000c9b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 783ffefb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "6558", - "deviceType": "DL-DLR2-002", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pulse_count": 0, - "pulse_interval": 600, - "cumulative_pulse_count": 0, - "battery_voltage": 3.227, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 171c839b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-002", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-002',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'pulse_count',\n displayName: 'Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'pulse_interval',\n displayName: 'Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_pulse_count',\n displayName: 'Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 1126afd2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhmeAAMAAAJYAAAAAAyb", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 31c2d7c1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "6558", - "deviceType": "DL-DLR2-002", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pulse_count": 0, - "pulse_interval": 600, - "cumulative_pulse_count": 0, - "battery_voltage": 3.227, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index b096a0f7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-002", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-002',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'pulse_count',\n displayName: 'Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'pulse_interval',\n displayName: 'Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_pulse_count',\n displayName: 'Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 1126afd2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhmeAAMAAAJYAAAAAAyb", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 31c2d7c1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "6558", - "deviceType": "DL-DLR2-002", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pulse_count": 0, - "pulse_interval": 600, - "cumulative_pulse_count": 0, - "battery_voltage": 3.227, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/info.json b/VENDORS/Decentlab/DL-DLR2-002/info.json deleted file mode 100644 index 859a5335..00000000 --- a/VENDORS/Decentlab/DL-DLR2-002/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-002 is an Analog or Digital Sensor Device for LoRaWAN® that consists of a Pulse Counter Dry Contact sensor interface." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-002/photo.png b/VENDORS/Decentlab/DL-DLR2-002/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-002/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/converter.json deleted file mode 100644 index 2c73ba2c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-003", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-003',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'input',\n displayName: 'Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/payload.json deleted file mode 100644 index 9f840a7f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhmbAAMAAQyN", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 848db00b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhmbAAMAAQyN", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/result.json deleted file mode 100644 index 578ff19b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6555", - "deviceType": "DL-DLR2-003", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "input": 1, - "battery_voltage": 3.213, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/result_01.json deleted file mode 100644 index efad5add..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6555", - "deviceType": "DL-DLR2-003", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "input": 1, - "battery_voltage": 3.213, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/converter.json deleted file mode 100644 index bdc20b58..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-003", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-003',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'input',\n displayName: 'Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/payload.json deleted file mode 100644 index 2028ffcf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02199b000300010c8d" -} diff --git a/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/result.json deleted file mode 100644 index f8834099..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6555", - "deviceType": "DL-DLR2-003", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "input": 1, - "battery_voltage": 3.213, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/converter.json deleted file mode 100644 index aa8bc1a5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-003", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-003',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'input',\n displayName: 'Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/payload.json deleted file mode 100644 index 1ed04d6d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02199b000300010c8d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/result.json deleted file mode 100644 index 2ef9b902..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6555", - "deviceType": "DL-DLR2-003", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "input": 1, - "battery_voltage": 3.213, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 690937b0..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-003", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-003',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'input',\n displayName: 'Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 1ed04d6d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02199b000300010c8d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 2ef9b902..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6555", - "deviceType": "DL-DLR2-003", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "input": 1, - "battery_voltage": 3.213, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index c2fd5f64..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-003", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-003',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'input',\n displayName: 'Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 32af74bb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhmbAAMAAQyN", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 1fa95052..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6555", - "deviceType": "DL-DLR2-003", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "input": 1, - "battery_voltage": 3.213, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 616f07c5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-003", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-003',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'input',\n displayName: 'Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 32af74bb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhmbAAMAAQyN", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 1fa95052..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6555", - "deviceType": "DL-DLR2-003", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "input": 1, - "battery_voltage": 3.213, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/info.json b/VENDORS/Decentlab/DL-DLR2-003/info.json deleted file mode 100644 index e5d43906..00000000 --- a/VENDORS/Decentlab/DL-DLR2-003/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-003 is an Analog or Digital Sensor Device for LoRaWAN® that consists of a Digital Input Dry Contact sensor interface." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-003/photo.png b/VENDORS/Decentlab/DL-DLR2-003/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-003/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/converter.json deleted file mode 100644 index b591f73b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-004", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-004',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 10.0\n },\n SENSORS: [\n {length: 1,\n values: [{name: 'current',\n displayName: 'Current',\n convert: function (x) { return 3 * (x[0] - 32768) / 32768 / 2 / this.PARAMETERS.R * 1000; },\n unit: 'mA'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload.json deleted file mode 100644 index 8c71ac84..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgiyAAOLuAxg", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_01.json deleted file mode 100644 index fe20730a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgiyAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_02.json deleted file mode 100644 index e7af0835..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgiyAAOLuAxg", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 9959008a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgiyAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result.json deleted file mode 100644 index a5357b78..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "current": 13.73291015625, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_01.json deleted file mode 100644 index 0ccd17bd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_02.json deleted file mode 100644 index 630545c1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "current": 13.73291015625, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_03.json deleted file mode 100644 index 4c755a45..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/converter.json deleted file mode 100644 index 37c1ae62..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-004", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-004',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 10.0\n },\n SENSORS: [\n {length: 1,\n values: [{name: 'current',\n displayName: 'Current',\n convert: function (x) { return 3 * (x[0] - 32768) / 32768 / 2 / this.PARAMETERS.R * 1000; },\n unit: 'mA'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/payload.json deleted file mode 100644 index f2953ec4..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0208b200038bb80c60" -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/payload_01.json deleted file mode 100644 index 9add8af3..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0208b200020c60" -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/result.json deleted file mode 100644 index b53830cd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "current": 13.73291015625, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/result_01.json deleted file mode 100644 index 004fdcf5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/converter.json deleted file mode 100644 index 551051e1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-004", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-004',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 10.0\n },\n SENSORS: [\n {length: 1,\n values: [{name: 'current',\n displayName: 'Current',\n convert: function (x) { return 3 * (x[0] - 32768) / 32768 / 2 / this.PARAMETERS.R * 1000; },\n unit: 'mA'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/payload.json deleted file mode 100644 index 6f3909c8..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0208b200038bb80c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/payload_01.json deleted file mode 100644 index 32548ca6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0208b200020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/result.json deleted file mode 100644 index 154d8b61..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "current": 13.73291015625, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/result_01.json deleted file mode 100644 index 32209e50..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 0e2b257c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-004", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-004',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 10.0\n },\n SENSORS: [\n {length: 1,\n values: [{name: 'current',\n displayName: 'Current',\n convert: function (x) { return 3 * (x[0] - 32768) / 32768 / 2 / this.PARAMETERS.R * 1000; },\n unit: 'mA'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 6f3909c8..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0208b200038bb80c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 32548ca6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0208b200020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 154d8b61..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "current": 13.73291015625, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 32209e50..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 973fe68a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-004", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-004',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 10.0\n },\n SENSORS: [\n {length: 1,\n values: [{name: 'current',\n displayName: 'Current',\n convert: function (x) { return 3 * (x[0] - 32768) / 32768 / 2 / this.PARAMETERS.R * 1000; },\n unit: 'mA'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index e51895c5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgiyAAOLuAxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index f1ca8e14..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgiyAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 8141a7a7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "current": 13.73291015625, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 1120621b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 398dd5c7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-004", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-004',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 10.0\n },\n SENSORS: [\n {length: 1,\n values: [{name: 'current',\n displayName: 'Current',\n convert: function (x) { return 3 * (x[0] - 32768) / 32768 / 2 / this.PARAMETERS.R * 1000; },\n unit: 'mA'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index e51895c5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgiyAAOLuAxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index f1ca8e14..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgiyAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 8141a7a7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "current": 13.73291015625, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 1120621b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2226", - "deviceType": "DL-DLR2-004", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/info.json b/VENDORS/Decentlab/DL-DLR2-004/info.json deleted file mode 100644 index 18eab026..00000000 --- a/VENDORS/Decentlab/DL-DLR2-004/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-004 is an Analog or Digital Sensor Device for LoRaWAN® that consists of an Analog 4 … 20 mA Sensor." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-004/photo.png b/VENDORS/Decentlab/DL-DLR2-004/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-004/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/converter.json deleted file mode 100644 index 370da524..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-005", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-005',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage',\n displayName: 'Voltage',\n convert: function (x) { return 3 * ((x[0] + x[1]*65536) / 8388608 - 1); },\n unit: 'V'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload.json deleted file mode 100644 index 526f6166..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhE6AAPFVQDYDG0=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 71a8e746..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhE6AAIMbQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 1a0dd88b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhE6AAPFVQDYDG0=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_03.json deleted file mode 100644 index c31202ef..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhE6AAIMbQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result.json deleted file mode 100644 index 65c81202..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "voltage": 2.0805662870407104, - "battery_voltage": 3.181, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_01.json deleted file mode 100644 index 6de78381..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.181, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_02.json deleted file mode 100644 index c7078dee..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "voltage": 2.0805662870407104, - "battery_voltage": 3.181, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_03.json deleted file mode 100644 index d2ddd482..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.181, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/converter.json deleted file mode 100644 index 6adf78b2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-005", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-005',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage',\n displayName: 'Voltage',\n convert: function (x) { return 3 * ((x[0] + x[1]*65536) / 8388608 - 1); },\n unit: 'V'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/payload.json deleted file mode 100644 index 4a7f9df6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02113a0003c55500d80c6d" -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/payload_01.json deleted file mode 100644 index 1cdb195a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02113a00020c6d" -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/result.json deleted file mode 100644 index 240dd420..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "voltage": 2.0805662870407104, - "battery_voltage": 3.181, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/result_01.json deleted file mode 100644 index afac1ab1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.181, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/converter.json deleted file mode 100644 index cb46457c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-005", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-005',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage',\n displayName: 'Voltage',\n convert: function (x) { return 3 * ((x[0] + x[1]*65536) / 8388608 - 1); },\n unit: 'V'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/payload.json deleted file mode 100644 index e272e58f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02113a0003c55500d80c6d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/payload_01.json deleted file mode 100644 index 439e75a3..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02113a00020c6d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/result.json deleted file mode 100644 index 5f9301ee..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "voltage": 2.0805662870407104, - "battery_voltage": 3.181, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/result_01.json deleted file mode 100644 index a1f1204b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.181, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index b040debe..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-005", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-005',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage',\n displayName: 'Voltage',\n convert: function (x) { return 3 * ((x[0] + x[1]*65536) / 8388608 - 1); },\n unit: 'V'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index e272e58f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02113a0003c55500d80c6d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 439e75a3..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02113a00020c6d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 5f9301ee..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "voltage": 2.0805662870407104, - "battery_voltage": 3.181, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index a1f1204b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.181, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 73be55d6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-005", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-005',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage',\n displayName: 'Voltage',\n convert: function (x) { return 3 * ((x[0] + x[1]*65536) / 8388608 - 1); },\n unit: 'V'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 01027213..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhE6AAPFVQDYDG0=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 9bb08b38..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhE6AAIMbQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 7bbe7854..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "voltage": 2.0805662870407104, - "battery_voltage": 3.181, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 3961fe78..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.181, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 3e7b0ecd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-005", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-005',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'voltage',\n displayName: 'Voltage',\n convert: function (x) { return 3 * ((x[0] + x[1]*65536) / 8388608 - 1); },\n unit: 'V'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 01027213..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhE6AAPFVQDYDG0=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 9bb08b38..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhE6AAIMbQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 7bbe7854..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "voltage": 2.0805662870407104, - "battery_voltage": 3.181, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 3961fe78..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4410", - "deviceType": "DL-DLR2-005", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.181, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/info.json b/VENDORS/Decentlab/DL-DLR2-005/info.json deleted file mode 100644 index 1eabd512..00000000 --- a/VENDORS/Decentlab/DL-DLR2-005/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-005 is an Analog or Digital Sensor Device for LoRaWAN® that consists of an Analog 0 … 3 V Sensor." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-005/photo.png b/VENDORS/Decentlab/DL-DLR2-005/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-005/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/converter.json deleted file mode 100644 index d6d575b0..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-006", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-006',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload.json deleted file mode 100644 index 7cd4f67c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAANAmgCGDFQ=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 4e388114..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAAIMVA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_02.json deleted file mode 100644 index aa604fc2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAANAmgCGDFQ=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 797b50bd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAAIMVA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result.json deleted file mode 100644 index c41c9621..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "potentiometer_position": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_01.json deleted file mode 100644 index 7fd2f88f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_02.json deleted file mode 100644 index 124ae6f7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "potentiometer_position": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_03.json deleted file mode 100644 index 9da03bfc..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/converter.json deleted file mode 100644 index e94caf18..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-006", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-006',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/payload.json deleted file mode 100644 index 6aa307ce..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0211110003409a00860c54" -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/payload_01.json deleted file mode 100644 index b4b6220e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02111100020c54" -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/result.json deleted file mode 100644 index 93a1f656..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "potentiometer_position": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/result_01.json deleted file mode 100644 index 2ca368e5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/converter.json deleted file mode 100644 index 099036fc..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-006", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-006',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/payload.json deleted file mode 100644 index eb142f74..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00860c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/payload_01.json deleted file mode 100644 index 14a91a75..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02111100020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/result.json deleted file mode 100644 index 704d4b65..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "potentiometer_position": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/result_01.json deleted file mode 100644 index 1d7e3cbd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 4d9bff12..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-006", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-006',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index eb142f74..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00860c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 14a91a75..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02111100020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 704d4b65..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "potentiometer_position": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 1d7e3cbd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index fe9748d1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-006", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-006',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index ab8d1044..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index b0ea35ca..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 6e393294..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "potentiometer_position": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 3766670c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index c755c440..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-006", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-006',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index ab8d1044..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index b0ea35ca..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 6e393294..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "potentiometer_position": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 3766670c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-DLR2-006", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/info.json b/VENDORS/Decentlab/DL-DLR2-006/info.json deleted file mode 100644 index d567363a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-006/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-006 is an Analog or Digital Sensor Device for LoRaWAN® that consists of an Analog Potentiometer Sensor." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-006/photo.png b/VENDORS/Decentlab/DL-DLR2-006/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-006/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/converter.json deleted file mode 100644 index 27cdbef6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-008", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-008',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -244.83 + 2.3419 * ((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2))) + 0.0010664 * Math.pow((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload.json deleted file mode 100644 index ab6ccccd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgffAAMX3gCNDGA=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 02838c10..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgffAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 979ecd3e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgffAAMX3gCNDGA=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 73eb9d83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgffAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result.json deleted file mode 100644 index 9b78e9dd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "temperature": 20.031064968287208, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_01.json deleted file mode 100644 index c2b7fda0..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_02.json deleted file mode 100644 index dee298b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "temperature": 20.031064968287208, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_03.json deleted file mode 100644 index c8a0df95..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/converter.json deleted file mode 100644 index 97b47b5e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-008", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-008',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -244.83 + 2.3419 * ((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2))) + 0.0010664 * Math.pow((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/payload.json deleted file mode 100644 index 18e4b37d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0207df000317de008d0c60" -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/payload_01.json deleted file mode 100644 index 231ae0e6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0207df00020c60" -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/result.json deleted file mode 100644 index 447b8b63..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "temperature": 20.031064968287208, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/result_01.json deleted file mode 100644 index 5700c10f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/converter.json deleted file mode 100644 index 9b605232..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-008", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-008',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -244.83 + 2.3419 * ((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2))) + 0.0010664 * Math.pow((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/payload.json deleted file mode 100644 index b20d7bc4..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0207df000317de008d0c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/payload_01.json deleted file mode 100644 index fcbaa227..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0207df00020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/result.json deleted file mode 100644 index 20be5dab..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "temperature": 20.031064968287208, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/result_01.json deleted file mode 100644 index 9b3b6edb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index a3dbafe3..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-008", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-008',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -244.83 + 2.3419 * ((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2))) + 0.0010664 * Math.pow((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index b20d7bc4..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0207df000317de008d0c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index fcbaa227..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0207df00020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 20be5dab..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "temperature": 20.031064968287208, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 9b3b6edb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 094a8802..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-008", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-008',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -244.83 + 2.3419 * ((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2))) + 0.0010664 * Math.pow((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index b53f3d9f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgffAAMX3gCNDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index a8481476..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgffAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index e43896eb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "temperature": 20.031064968287208, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index ba294091..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index fd7c735d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-008", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-008',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -244.83 + 2.3419 * ((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2))) + 0.0010664 * Math.pow((((x[0] + x[1]*65536) / 8388608 - 1) / 2) * this.PARAMETERS.R / (1 - (((x[0] + x[1]*65536) / 8388608 - 1) / 2)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index b53f3d9f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgffAAMX3gCNDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index a8481476..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgffAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index e43896eb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "temperature": 20.031064968287208, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index ba294091..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2015", - "deviceType": "DL-DLR2-008", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/info.json b/VENDORS/Decentlab/DL-DLR2-008/info.json deleted file mode 100644 index 1ccfa99c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-008/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-008 is an Analog or Digital Sensor Device for LoRaWAN® that consists of an Analog PT100 Sensor." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-008/photo.png b/VENDORS/Decentlab/DL-DLR2-008/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-008/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/converter.json deleted file mode 100644 index 41937571..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-009", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-009',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)); },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -245.18 + 0.23469 * (((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1))) + 0.0000104876 * Math.pow(((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload.json deleted file mode 100644 index fac869f2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AkxiAANXNACtCuE=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_01.json deleted file mode 100644 index b7c40d45..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AkxiAAIK4Q==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 4ad64888..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AkxiAANXNACtCuE=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 438600ae..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AkxiAAIK4Q==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result.json deleted file mode 100644 index 165c2adf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "thermistor_resistance": 1097.0478279778865, - "temperature": 24.908127512458456, - "battery_voltage": 2.785, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_01.json deleted file mode 100644 index 8d038d31..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.785, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_02.json deleted file mode 100644 index c778a02b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "thermistor_resistance": 1097.0478279778865, - "temperature": 24.908127512458456, - "battery_voltage": 2.785, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_03.json deleted file mode 100644 index 91870054..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.785, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/converter.json deleted file mode 100644 index 5ccf7bd2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-009", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-009',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)); },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -245.18 + 0.23469 * (((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1))) + 0.0000104876 * Math.pow(((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/payload.json deleted file mode 100644 index 2714bf3b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "024c620003573400ad0ae1" -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/payload_01.json deleted file mode 100644 index 52a4b75e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "024c6200020ae1" -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/result.json deleted file mode 100644 index 87bff0be..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "thermistor_resistance": 1097.0478279778865, - "temperature": 24.908127512458456, - "battery_voltage": 2.785, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/result_01.json deleted file mode 100644 index 943359bb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.785, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/converter.json deleted file mode 100644 index ca3dc6dd..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-009", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-009',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)); },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -245.18 + 0.23469 * (((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1))) + 0.0000104876 * Math.pow(((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/payload.json deleted file mode 100644 index 0a69d406..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "024c620003573400ad0ae1", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/payload_01.json deleted file mode 100644 index e714e853..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "024c6200020ae1", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/result.json deleted file mode 100644 index 84565670..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "thermistor_resistance": 1097.0478279778865, - "temperature": 24.908127512458456, - "battery_voltage": 2.785, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/result_01.json deleted file mode 100644 index 03fb8485..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.785, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index ef548913..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-009", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-009',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)); },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -245.18 + 0.23469 * (((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1))) + 0.0000104876 * Math.pow(((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 0a69d406..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "024c620003573400ad0ae1", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index e714e853..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "024c6200020ae1", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 84565670..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "thermistor_resistance": 1097.0478279778865, - "temperature": 24.908127512458456, - "battery_voltage": 2.785, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 03fb8485..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.785, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index c1c35425..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-009", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-009',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)); },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -245.18 + 0.23469 * (((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1))) + 0.0000104876 * Math.pow(((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 4051ef34..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkxiAANXNACtCuE=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index c5a073e8..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkxiAAIK4Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 57571135..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "thermistor_resistance": 1097.0478279778865, - "temperature": 24.908127512458456, - "battery_voltage": 2.785, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 4d9fe95d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.785, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 3b689630..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-009", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-009',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n R: 2000\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'thermistor_resistance',\n displayName: 'Thermistor resistance',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)); },\n unit: 'Ω'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return -245.18 + 0.23469 * (((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1))) + 0.0000104876 * Math.pow(((x[0] + x[1]*65536) / 8388608 - 1) * 2000 / (1 - ((x[0] + x[1]*65536) / 8388608 - 1)), 2); },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 4051ef34..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkxiAANXNACtCuE=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index c5a073e8..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkxiAAIK4Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 57571135..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "thermistor_resistance": 1097.0478279778865, - "temperature": 24.908127512458456, - "battery_voltage": 2.785, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 4d9fe95d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19554", - "deviceType": "DL-DLR2-009", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.785, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/info.json b/VENDORS/Decentlab/DL-DLR2-009/info.json deleted file mode 100644 index 376e376a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-009/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-009 is an Analog or Digital Sensor Device for LoRaWAN® that consists of an Analog PT1000 Sensor." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-009/photo.png b/VENDORS/Decentlab/DL-DLR2-009/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-009/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/converter.json deleted file mode 100644 index 65c338eb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-010", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-010',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'ch0_pulse_count',\n displayName: 'CH0: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch0_pulse_interval',\n displayName: 'CH0: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch0_cumulative_pulse_count',\n displayName: 'CH0: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 4,\n values: [{name: 'ch1_pulse_count',\n displayName: 'CH1: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch1_pulse_interval',\n displayName: 'CH1: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch1_cumulative_pulse_count',\n displayName: 'CH1: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload.json deleted file mode 100644 index 185e85e6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhmPAAcABAJYC/AAAQAAAljezgAADDM=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 60098871..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhmPAAQMMw==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 09e82421..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhmPAAcABAJYC/AAAQAAAljezgAADDM=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_03.json deleted file mode 100644 index eae4698c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhmPAAQMMw==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result.json deleted file mode 100644 index 0faade1c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "ch0_pulse_count": 4, - "ch0_pulse_interval": 600, - "ch0_cumulative_pulse_count": 68592, - "ch1_pulse_count": 0, - "ch1_pulse_interval": 600, - "ch1_cumulative_pulse_count": 57038, - "battery_voltage": 3.123, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_01.json deleted file mode 100644 index 161a4eea..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_02.json deleted file mode 100644 index 79d931fa..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "ch0_pulse_count": 4, - "ch0_pulse_interval": 600, - "ch0_cumulative_pulse_count": 68592, - "ch1_pulse_count": 0, - "ch1_pulse_interval": 600, - "ch1_cumulative_pulse_count": 57038, - "battery_voltage": 3.123, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_03.json deleted file mode 100644 index 9f8438c6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/converter.json deleted file mode 100644 index 750f12a9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-010", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-010',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'ch0_pulse_count',\n displayName: 'CH0: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch0_pulse_interval',\n displayName: 'CH0: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch0_cumulative_pulse_count',\n displayName: 'CH0: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 4,\n values: [{name: 'ch1_pulse_count',\n displayName: 'CH1: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch1_pulse_interval',\n displayName: 'CH1: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch1_cumulative_pulse_count',\n displayName: 'CH1: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/payload.json deleted file mode 100644 index fb5cec02..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02198f0007000402580bf0000100000258dece00000c33" -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/payload_01.json deleted file mode 100644 index 341cfcb9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02198f00040c33" -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/result.json deleted file mode 100644 index 527c6e8d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "ch0_pulse_count": 4, - "ch0_pulse_interval": 600, - "ch0_cumulative_pulse_count": 68592, - "ch1_pulse_count": 0, - "ch1_pulse_interval": 600, - "ch1_cumulative_pulse_count": 57038, - "battery_voltage": 3.123, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/result_01.json deleted file mode 100644 index 9f77123f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/converter.json deleted file mode 100644 index b9ac1347..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-010", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-010',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'ch0_pulse_count',\n displayName: 'CH0: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch0_pulse_interval',\n displayName: 'CH0: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch0_cumulative_pulse_count',\n displayName: 'CH0: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 4,\n values: [{name: 'ch1_pulse_count',\n displayName: 'CH1: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch1_pulse_interval',\n displayName: 'CH1: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch1_cumulative_pulse_count',\n displayName: 'CH1: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/payload.json deleted file mode 100644 index fd366336..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02198f0007000402580bf0000100000258dece00000c33", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/payload_01.json deleted file mode 100644 index d34285f1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02198f00040c33", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/result.json deleted file mode 100644 index 31f0a15d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "ch0_pulse_count": 4, - "ch0_pulse_interval": 600, - "ch0_cumulative_pulse_count": 68592, - "ch1_pulse_count": 0, - "ch1_pulse_interval": 600, - "ch1_cumulative_pulse_count": 57038, - "battery_voltage": 3.123, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/result_01.json deleted file mode 100644 index fbf47aa3..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 879863fb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-010", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-010',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'ch0_pulse_count',\n displayName: 'CH0: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch0_pulse_interval',\n displayName: 'CH0: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch0_cumulative_pulse_count',\n displayName: 'CH0: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 4,\n values: [{name: 'ch1_pulse_count',\n displayName: 'CH1: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch1_pulse_interval',\n displayName: 'CH1: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch1_cumulative_pulse_count',\n displayName: 'CH1: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index fd366336..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02198f0007000402580bf0000100000258dece00000c33", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index d34285f1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02198f00040c33", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 31f0a15d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "ch0_pulse_count": 4, - "ch0_pulse_interval": 600, - "ch0_cumulative_pulse_count": 68592, - "ch1_pulse_count": 0, - "ch1_pulse_interval": 600, - "ch1_cumulative_pulse_count": 57038, - "battery_voltage": 3.123, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index fbf47aa3..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 9fb8948f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-010", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-010',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'ch0_pulse_count',\n displayName: 'CH0: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch0_pulse_interval',\n displayName: 'CH0: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch0_cumulative_pulse_count',\n displayName: 'CH0: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 4,\n values: [{name: 'ch1_pulse_count',\n displayName: 'CH1: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch1_pulse_interval',\n displayName: 'CH1: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch1_cumulative_pulse_count',\n displayName: 'CH1: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 4b70578a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhmPAAcABAJYC/AAAQAAAljezgAADDM=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 222e3680..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhmPAAQMMw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 27f7cbda..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "ch0_pulse_count": 4, - "ch0_pulse_interval": 600, - "ch0_cumulative_pulse_count": 68592, - "ch1_pulse_count": 0, - "ch1_pulse_interval": 600, - "ch1_cumulative_pulse_count": 57038, - "battery_voltage": 3.123, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 6331347a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 78e288e8..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-010", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-010',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'ch0_pulse_count',\n displayName: 'CH0: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch0_pulse_interval',\n displayName: 'CH0: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch0_cumulative_pulse_count',\n displayName: 'CH0: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 4,\n values: [{name: 'ch1_pulse_count',\n displayName: 'CH1: Pulse count',\n convert: function (x) { return x[0]; }},\n {name: 'ch1_pulse_interval',\n displayName: 'CH1: Pulse interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'ch1_cumulative_pulse_count',\n displayName: 'CH1: Cumulative pulse count',\n convert: function (x) { return (x[2] + x[3] * 65536); }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 4b70578a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhmPAAcABAJYC/AAAQAAAljezgAADDM=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 222e3680..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhmPAAQMMw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 27f7cbda..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "ch0_pulse_count": 4, - "ch0_pulse_interval": 600, - "ch0_cumulative_pulse_count": 68592, - "ch1_pulse_count": 0, - "ch1_pulse_interval": 600, - "ch1_cumulative_pulse_count": 57038, - "battery_voltage": 3.123, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 6331347a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6543", - "deviceType": "DL-DLR2-010", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/info.json b/VENDORS/Decentlab/DL-DLR2-010/info.json deleted file mode 100644 index 747022d8..00000000 --- a/VENDORS/Decentlab/DL-DLR2-010/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-010 is an Analog or Digital Sensor Device for LoRaWAN® that consists of a Dual Pulse Counter Dry Contact sensor interface." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-010/photo.png b/VENDORS/Decentlab/DL-DLR2-010/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-010/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/converter.json deleted file mode 100644 index c9f17317..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-011", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-011',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'ch0_input',\n displayName: 'CH0: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'ch1_input',\n displayName: 'CH1: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload.json deleted file mode 100644 index b80cf171..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AkNxAAcAAQAACvk=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_01.json deleted file mode 100644 index b109742f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AkNxAAQK+Q==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 495aa21c..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AkNxAAcAAQAACvk=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 6183cf78..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AkNxAAQK+Q==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result.json deleted file mode 100644 index f34b08e7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "ch0_input": 1, - "ch1_input": 0, - "battery_voltage": 2.809, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_01.json deleted file mode 100644 index 98d295ea..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.809, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_02.json deleted file mode 100644 index 2112927d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "ch0_input": 1, - "ch1_input": 0, - "battery_voltage": 2.809, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_03.json deleted file mode 100644 index 026288f1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.809, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/converter.json deleted file mode 100644 index 654b8a11..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-011", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-011',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'ch0_input',\n displayName: 'CH0: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'ch1_input',\n displayName: 'CH1: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/payload.json deleted file mode 100644 index f062d933..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0243710007000100000af9" -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/payload_01.json deleted file mode 100644 index c322d214..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02437100040af9" -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/result.json deleted file mode 100644 index 9140c1f8..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "ch0_input": 1, - "ch1_input": 0, - "battery_voltage": 2.809, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/result_01.json deleted file mode 100644 index 2c6c623f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.809, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/converter.json deleted file mode 100644 index 40b68a97..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-011", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-011',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'ch0_input',\n displayName: 'CH0: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'ch1_input',\n displayName: 'CH1: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/payload.json deleted file mode 100644 index 9801a695..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0243710007000100000af9", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/payload_01.json deleted file mode 100644 index bf768570..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02437100040af9", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/result.json deleted file mode 100644 index 40ab8f0f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "ch0_input": 1, - "ch1_input": 0, - "battery_voltage": 2.809, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/result_01.json deleted file mode 100644 index 356ba8b5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.809, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 73e633e4..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-011", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-011',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'ch0_input',\n displayName: 'CH0: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'ch1_input',\n displayName: 'CH1: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 9801a695..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0243710007000100000af9", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index bf768570..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02437100040af9", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 40ab8f0f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "ch0_input": 1, - "ch1_input": 0, - "battery_voltage": 2.809, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 356ba8b5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.809, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 453a2f34..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-011", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-011',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'ch0_input',\n displayName: 'CH0: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'ch1_input',\n displayName: 'CH1: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 3ffc976d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkNxAAcAAQAACvk=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 55adbef0..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkNxAAQK+Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 09e73d75..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "ch0_input": 1, - "ch1_input": 0, - "battery_voltage": 2.809, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index b24b0a6e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.809, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 31ed18d7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-011", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-011',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'ch0_input',\n displayName: 'CH0: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'ch1_input',\n displayName: 'CH1: Input',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 3ffc976d..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkNxAAcAAQAACvk=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 55adbef0..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkNxAAQK+Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 09e73d75..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "ch0_input": 1, - "ch1_input": 0, - "battery_voltage": 2.809, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index b24b0a6e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17265", - "deviceType": "DL-DLR2-011", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.809, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/info.json b/VENDORS/Decentlab/DL-DLR2-011/info.json deleted file mode 100644 index 1a87d83b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-011/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-011 is an Analog or Digital Sensor Device for LoRaWAN® that consists of a Dual Digital Input Dry Contact sensor interface." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-011/photo.png b/VENDORS/Decentlab/DL-DLR2-011/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-011/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/converter.json deleted file mode 100644 index bc41b4a2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DLR2-012", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-012',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'strain_gauge',\n displayName: 'Strain gauge',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 64 * 4 / 2.02 * 1000000; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload.json deleted file mode 100644 index 9102af33..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AheDAAMWLgCHDDM=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_01.json deleted file mode 100644 index d2fac75b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AheDAAIMMw==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 1a1b9e41..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AheDAAMWLgCHDDM=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_03.json deleted file mode 100644 index b035420f..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AheDAAIMMw==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result.json deleted file mode 100644 index 543076b3..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "strain_gauge": 1713.0065082323433, - "battery_voltage": 3.123, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_01.json deleted file mode 100644 index 0c3252b1..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_02.json deleted file mode 100644 index 0a1c5085..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "strain_gauge": 1713.0065082323433, - "battery_voltage": 3.123, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_03.json deleted file mode 100644 index 4a6430de..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/converter.json deleted file mode 100644 index aa3d003b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DLR2-012", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-012',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'strain_gauge',\n displayName: 'Strain gauge',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 64 * 4 / 2.02 * 1000000; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/payload.json deleted file mode 100644 index a7a39408..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0217830003162e00870c33" -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/payload_01.json deleted file mode 100644 index f4f3371e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02178300020c33" -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/result.json deleted file mode 100644 index 9910350a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "strain_gauge": 1713.0065082323433, - "battery_voltage": 3.123, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/result_01.json deleted file mode 100644 index 7d94614a..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/converter.json deleted file mode 100644 index 39fb1806..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DLR2-012", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-012',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'strain_gauge',\n displayName: 'Strain gauge',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 64 * 4 / 2.02 * 1000000; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/payload.json deleted file mode 100644 index ba027b6e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0217830003162e00870c33", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/payload_01.json deleted file mode 100644 index 26380c79..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02178300020c33", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/result.json deleted file mode 100644 index a815d4be..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "strain_gauge": 1713.0065082323433, - "battery_voltage": 3.123, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/result_01.json deleted file mode 100644 index 714ccaa7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 72f3735b..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DLR2-012", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-012',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'strain_gauge',\n displayName: 'Strain gauge',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 64 * 4 / 2.02 * 1000000; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index ba027b6e..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0217830003162e00870c33", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 26380c79..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02178300020c33", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index a815d4be..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "strain_gauge": 1713.0065082323433, - "battery_voltage": 3.123, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 714ccaa7..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 6b7457ea..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DLR2-012", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-012',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'strain_gauge',\n displayName: 'Strain gauge',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 64 * 4 / 2.02 * 1000000; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 30b3d8ad..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AheDAAMWLgCHDDM=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 36b29110..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AheDAAIMMw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index a27a39e6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "strain_gauge": 1713.0065082323433, - "battery_voltage": 3.123, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index e9dc0955..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 9d9778b5..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DLR2-012", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DLR2-012',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'strain_gauge',\n displayName: 'Strain gauge',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) / 64 * 4 / 2.02 * 1000000; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 30b3d8ad..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AheDAAMWLgCHDDM=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 36b29110..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AheDAAIMMw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index a27a39e6..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "strain_gauge": 1713.0065082323433, - "battery_voltage": 3.123, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index e9dc0955..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6019", - "deviceType": "DL-DLR2-012", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.123, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/info.json b/VENDORS/Decentlab/DL-DLR2-012/info.json deleted file mode 100644 index 0d8aabcb..00000000 --- a/VENDORS/Decentlab/DL-DLR2-012/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/analog-or-digital-sensor-device-for-lorawan", - "description": "The Decentlab DL-DLR2-012 is an Analog or Digital Sensor Device for LoRaWAN® that consists of an Analog Strain Gauge Sensor." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DLR2-012/photo.png b/VENDORS/Decentlab/DL-DLR2-012/photo.png deleted file mode 100644 index 37cd9c3a..00000000 Binary files a/VENDORS/Decentlab/DL-DLR2-012/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/converter.json deleted file mode 100644 index 67ed0e96..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DS18", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DS18',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[0] - 32768) / 16; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload.json deleted file mode 100644 index f0983c85..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgI9AAOBXgwV", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 66e8457a..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgI9AAIMFQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_02.json deleted file mode 100644 index bfe11ecf..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgI9AAOBXgwV", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 583d65b0..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgI9AAIMFQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result.json deleted file mode 100644 index d0ff78c2..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "temperature": 21.875, - "battery_voltage": 3.093, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_01.json deleted file mode 100644 index cc2e8048..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.093, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_02.json deleted file mode 100644 index 61aa5220..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "temperature": 21.875, - "battery_voltage": 3.093, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_03.json deleted file mode 100644 index f1808b15..00000000 --- a/VENDORS/Decentlab/DL-DS18/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.093, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/converter.json deleted file mode 100644 index 5aac4827..00000000 --- a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DS18", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DS18',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[0] - 32768) / 16; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/payload.json deleted file mode 100644 index a2cb3807..00000000 --- a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02023d0003815e0c15" -} diff --git a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/payload_01.json deleted file mode 100644 index 9e1f9e50..00000000 --- a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02023d00020c15" -} diff --git a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/result.json deleted file mode 100644 index bb2c5a6e..00000000 --- a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "temperature": 21.875, - "battery_voltage": 3.093, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/result_01.json deleted file mode 100644 index ad42c31f..00000000 --- a/VENDORS/Decentlab/DL-DS18/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.093, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/converter.json deleted file mode 100644 index ae95adc3..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DS18", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DS18',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[0] - 32768) / 16; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/payload.json deleted file mode 100644 index 21612b17..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02023d0003815e0c15", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/payload_01.json deleted file mode 100644 index df5454da..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02023d00020c15", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/result.json deleted file mode 100644 index dc6ea1c2..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "temperature": 21.875, - "battery_voltage": 3.093, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/result_01.json deleted file mode 100644 index 6a447ada..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.093, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index b62f0087..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DS18", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DS18',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[0] - 32768) / 16; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 21612b17..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02023d0003815e0c15", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index df5454da..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02023d00020c15", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index dc6ea1c2..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "temperature": 21.875, - "battery_voltage": 3.093, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 6a447ada..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.093, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index a8c79720..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DS18", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DS18',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[0] - 32768) / 16; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 835b5946..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgI9AAOBXgwV", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 0e0f55e8..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgI9AAIMFQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index ad4fe9b4..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "temperature": 21.875, - "battery_voltage": 3.093, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 1925ef89..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.093, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index eaec391d..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DS18", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DS18',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[0] - 32768) / 16; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 835b5946..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgI9AAOBXgwV", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 0e0f55e8..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgI9AAIMFQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index ad4fe9b4..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "temperature": 21.875, - "battery_voltage": 3.093, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 1925ef89..00000000 --- a/VENDORS/Decentlab/DL-DS18/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "573", - "deviceType": "DL-DS18", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.093, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/info.json b/VENDORS/Decentlab/DL-DS18/info.json deleted file mode 100644 index ae5b2db0..00000000 --- a/VENDORS/Decentlab/DL-DS18/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/temperature-sensor-for-lorawan", - "description": "The Decentlab DL-DS18 is equipped with a temperature sensor for measuring temperature. Suitable for applications such as outdoor remote monitoring, cold chain, storage, building automation, smart agriculture, open water, and tank temperature, etc." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DS18/photo.png b/VENDORS/Decentlab/DL-DS18/photo.png deleted file mode 100644 index 7958c70f..00000000 Binary files a/VENDORS/Decentlab/DL-DS18/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/converter.json deleted file mode 100644 index c7afb3e1..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-DWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/weighing-scale-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f02: 232263168,\n s: 0.000302459,\n m0: 1370\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - this.PARAMETERS.f02) * this.PARAMETERS.s + this.PARAMETERS.m0; },\n unit: 'g'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload.json deleted file mode 100644 index 0f95e527..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgPUAAM79n//O/YMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 99fac371..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgPUAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_02.json deleted file mode 100644 index a9398c6f..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgPUAAM79n//O/YMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_03.json deleted file mode 100644 index c28b040b..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgPUAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result.json deleted file mode 100644 index bb3d929e..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "frequency": 15350.468459120457, - "weight": 2390.4101368512333, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_01.json deleted file mode 100644 index a54b8962..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_02.json deleted file mode 100644 index 5ab139d7..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "frequency": 15350.468459120457, - "weight": 2390.4101368512333, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_03.json deleted file mode 100644 index 5e540112..00000000 --- a/VENDORS/Decentlab/DL-DWS/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/converter.json deleted file mode 100644 index d25ab16d..00000000 --- a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-DWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/weighing-scale-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f02: 232263168,\n s: 0.000302459,\n m0: 1370\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - this.PARAMETERS.f02) * this.PARAMETERS.s + this.PARAMETERS.m0; },\n unit: 'g'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/payload.json deleted file mode 100644 index 2f5c58e5..00000000 --- a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0203d400033bf67fff3bf60c60" -} diff --git a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/payload_01.json deleted file mode 100644 index 74b4dadb..00000000 --- a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0203d400020c60" -} diff --git a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/result.json deleted file mode 100644 index e1ac03cc..00000000 --- a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "frequency": 15350.468459120457, - "weight": 2390.4101368512333, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/result_01.json deleted file mode 100644 index c567860e..00000000 --- a/VENDORS/Decentlab/DL-DWS/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/converter.json deleted file mode 100644 index 656dbf64..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-DWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/weighing-scale-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f02: 232263168,\n s: 0.000302459,\n m0: 1370\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - this.PARAMETERS.f02) * this.PARAMETERS.s + this.PARAMETERS.m0; },\n unit: 'g'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/payload.json deleted file mode 100644 index 11b9e666..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0203d400033bf67fff3bf60c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/payload_01.json deleted file mode 100644 index 71b9cb14..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0203d400020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/result.json deleted file mode 100644 index d58415f5..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "frequency": 15350.468459120457, - "weight": 2390.4101368512333, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/result_01.json deleted file mode 100644 index d9e92e3c..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index fbfe01dd..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-DWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/weighing-scale-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f02: 232263168,\n s: 0.000302459,\n m0: 1370\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - this.PARAMETERS.f02) * this.PARAMETERS.s + this.PARAMETERS.m0; },\n unit: 'g'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 11b9e666..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0203d400033bf67fff3bf60c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 71b9cb14..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0203d400020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index d58415f5..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "frequency": 15350.468459120457, - "weight": 2390.4101368512333, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index d9e92e3c..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index b2a08465..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-DWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/weighing-scale-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f02: 232263168,\n s: 0.000302459,\n m0: 1370\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - this.PARAMETERS.f02) * this.PARAMETERS.s + this.PARAMETERS.m0; },\n unit: 'g'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 5802c70d..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgPUAAM79n//O/YMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 20d7c572..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgPUAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 74bfd368..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "frequency": 15350.468459120457, - "weight": 2390.4101368512333, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 4673198a..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 16007a3b..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-DWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-DWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/weighing-scale-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f02: 232263168,\n s: 0.000302459,\n m0: 1370\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - this.PARAMETERS.f02) * this.PARAMETERS.s + this.PARAMETERS.m0; },\n unit: 'g'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 5802c70d..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgPUAAM79n//O/YMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 20d7c572..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgPUAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 74bfd368..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "frequency": 15350.468459120457, - "weight": 2390.4101368512333, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 4673198a..00000000 --- a/VENDORS/Decentlab/DL-DWS/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-DWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/info.json b/VENDORS/Decentlab/DL-DWS/info.json deleted file mode 100644 index e6a05d48..00000000 --- a/VENDORS/Decentlab/DL-DWS/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/weighing-scale-for-lorawan", - "description": "The Decentlab DL-DWS is a weighing scale for LoRaWAN® that comes with a 'vibrating wire for weight' sensor. Suitable for applications such as logistics, inventory, and weighing." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-DWS/photo.png b/VENDORS/Decentlab/DL-DWS/photo.png deleted file mode 100644 index 857cb45b..00000000 Binary files a/VENDORS/Decentlab/DL-DWS/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/converter.json deleted file mode 100644 index c7f47375..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-GMM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-GMM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/greenhouse-multi-monitor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 7,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 10; },\n unit: '%'},\n {name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return (x[3] - 32768) / 1; },\n unit: 'ppm'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'vapor_pressure_deficit',\n displayName: 'Vapor pressure deficit',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload.json deleted file mode 100644 index d1cd106a..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlMrAAOHJokggRSCl6VzgM+BcAu8", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 69dd3157..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlKFAAILvA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 8e98666d..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlMrAAOHJokggRSCl6VzgM+BcAu8", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 4bd638f2..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlKFAAILvA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result.json deleted file mode 100644 index 2538720e..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "21291", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "photosynthetically_active_radiation": 183, - "air_temperature": 23.36, - "air_humidity": 27.6, - "co2_concentration": 663, - "atmospheric_pressure": 95.87, - "vapor_pressure_deficit": 2.07, - "dew_point": 3.68, - "battery_voltage": 3.004, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_01.json deleted file mode 100644 index 161d7cb1..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.004, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_02.json deleted file mode 100644 index e070062b..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "21291", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "photosynthetically_active_radiation": 183, - "air_temperature": 23.36, - "air_humidity": 27.6, - "co2_concentration": 663, - "atmospheric_pressure": 95.87, - "vapor_pressure_deficit": 2.07, - "dew_point": 3.68, - "battery_voltage": 3.004, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_03.json deleted file mode 100644 index 17d1e954..00000000 --- a/VENDORS/Decentlab/DL-GMM/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.004, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/converter.json deleted file mode 100644 index 54d56d69..00000000 --- a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-GMM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-GMM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/greenhouse-multi-monitor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 7,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 10; },\n unit: '%'},\n {name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return (x[3] - 32768) / 1; },\n unit: 'ppm'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'vapor_pressure_deficit',\n displayName: 'Vapor pressure deficit',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/payload.json deleted file mode 100644 index 5798f188..00000000 --- a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02532b00038726892081148297a57380cf81700bbc" -} diff --git a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/payload_01.json deleted file mode 100644 index 87d51827..00000000 --- a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02528500020bbc" -} diff --git a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/result.json deleted file mode 100644 index ff56a916..00000000 --- a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/result.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "21291", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "photosynthetically_active_radiation": 183, - "air_temperature": 23.36, - "air_humidity": 27.6, - "co2_concentration": 663, - "atmospheric_pressure": 95.87, - "vapor_pressure_deficit": 2.07, - "dew_point": 3.68, - "battery_voltage": 3.004, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/result_01.json deleted file mode 100644 index 133fb36b..00000000 --- a/VENDORS/Decentlab/DL-GMM/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.004, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/converter.json deleted file mode 100644 index 14717b69..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-GMM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-GMM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/greenhouse-multi-monitor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 7,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 10; },\n unit: '%'},\n {name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return (x[3] - 32768) / 1; },\n unit: 'ppm'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'vapor_pressure_deficit',\n displayName: 'Vapor pressure deficit',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/payload.json deleted file mode 100644 index 7688a40f..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02532b00038726892081148297a57380cf81700bbc", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/payload_01.json deleted file mode 100644 index e33f4fa3..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02528500020bbc", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/result.json deleted file mode 100644 index c18c4ef5..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/result.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "21291", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "photosynthetically_active_radiation": 183, - "air_temperature": 23.36, - "air_humidity": 27.6, - "co2_concentration": 663, - "atmospheric_pressure": 95.87, - "vapor_pressure_deficit": 2.07, - "dew_point": 3.68, - "battery_voltage": 3.004, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/result_01.json deleted file mode 100644 index 358bd2f5..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.004, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 54654b35..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-GMM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-GMM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/greenhouse-multi-monitor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 7,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 10; },\n unit: '%'},\n {name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return (x[3] - 32768) / 1; },\n unit: 'ppm'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'vapor_pressure_deficit',\n displayName: 'Vapor pressure deficit',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 7688a40f..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02532b00038726892081148297a57380cf81700bbc", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index e33f4fa3..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02528500020bbc", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index c18c4ef5..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "21291", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "photosynthetically_active_radiation": 183, - "air_temperature": 23.36, - "air_humidity": 27.6, - "co2_concentration": 663, - "atmospheric_pressure": 95.87, - "vapor_pressure_deficit": 2.07, - "dew_point": 3.68, - "battery_voltage": 3.004, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 358bd2f5..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.004, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index e77133cc..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-GMM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-GMM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/greenhouse-multi-monitor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 7,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 10; },\n unit: '%'},\n {name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return (x[3] - 32768) / 1; },\n unit: 'ppm'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'vapor_pressure_deficit',\n displayName: 'Vapor pressure deficit',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index cd1c1749..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlMrAAOHJokggRSCl6VzgM+BcAu8", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index e63c72a1..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlKFAAILvA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index a84564ed..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "21291", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "photosynthetically_active_radiation": 183, - "air_temperature": 23.36, - "air_humidity": 27.6, - "co2_concentration": 663, - "atmospheric_pressure": 95.87, - "vapor_pressure_deficit": 2.07, - "dew_point": 3.68, - "battery_voltage": 3.004, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 720a8315..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.004, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index c3534717..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-GMM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-GMM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/greenhouse-multi-monitor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 7,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return (x[0] - 32768) / 10; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return (x[2] - 32768) / 10; },\n unit: '%'},\n {name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return (x[3] - 32768) / 1; },\n unit: 'ppm'},\n {name: 'atmospheric_pressure',\n displayName: 'Atmospheric pressure',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'vapor_pressure_deficit',\n displayName: 'Vapor pressure deficit',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: 'kPa'},\n {name: 'dew_point',\n displayName: 'Dew point',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index cd1c1749..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlMrAAOHJokggRSCl6VzgM+BcAu8", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index e63c72a1..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlKFAAILvA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index a84564ed..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "21291", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "photosynthetically_active_radiation": 183, - "air_temperature": 23.36, - "air_humidity": 27.6, - "co2_concentration": 663, - "atmospheric_pressure": 95.87, - "vapor_pressure_deficit": 2.07, - "dew_point": 3.68, - "battery_voltage": 3.004, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 720a8315..00000000 --- a/VENDORS/Decentlab/DL-GMM/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21125", - "deviceType": "DL-GMM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.004, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/info.json b/VENDORS/Decentlab/DL-GMM/info.json deleted file mode 100644 index 0366eb14..00000000 --- a/VENDORS/Decentlab/DL-GMM/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/greenhouse-multi-monitor-for-lorawan", - "description": "The Decentlab DL-GMM includes a Photosynthetically Active Radiation (PAR), temperature, humidity, barometric pressure and CO2 sensors for LoRaWAN®. Suitable for applications such as smart agriculture, greenhouses, grow rooms, and vertical farms." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-GMM/photo.png b/VENDORS/Decentlab/DL-GMM/photo.png deleted file mode 100644 index 9c3cdb84..00000000 Binary files a/VENDORS/Decentlab/DL-GMM/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/converter.json deleted file mode 100644 index f18d4538..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-IAM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IAM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/indoor-ambiance-monitor-including-co2-tvoc-and-motion-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]},\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[0] * 2; },\n unit: 'Pa'}]},\n {length: 2,\n values: [{name: 'ambient_light_visible_infrared',\n displayName: 'Ambient light (visible + infrared)',\n convert: function (x) { return x[0]; }},\n {name: 'ambient_light_infrared',\n displayName: 'Ambient light (infrared)',\n convert: function (x) { return x[1]; }},\n {name: 'illuminance',\n displayName: 'Illuminance',\n convert: function (x) { return Math.max(Math.max(1.0 * x[0] - 1.64 * x[1], 0.59 * x[0] - 0.86 * x[1]), 0) * 1.5504; },\n unit: 'lx'}]},\n {length: 3,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[1]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[2]; }}]},\n {length: 1,\n values: [{name: 'activity_counter',\n displayName: 'Activity counter',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'total_voc',\n displayName: 'Total VOC',\n convert: function (x) { return x[0]; },\n unit: 'ppb'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload.json deleted file mode 100644 index ec39f6b6..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Agu9AH8LkmpRXUi8TgJiAGmBxwAAk9QACwER", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 0c8bbc47..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Agu9AG8LkmpRXUi8TgJiAGkACwER", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 898fb92f..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Agu9AAELkg==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_03.json deleted file mode 100644 index d01a6776..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Agu9AH8LkmpRXUi8TgJiAGmBxwAAk9QACwER", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_04.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_04.json deleted file mode 100644 index 8621edca..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_04.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Agu9AG8LkmpRXUi8TgJiAGkACwER", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_05.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_05.json deleted file mode 100644 index db71f3ef..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/payload_05.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Agu9AAELkg==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result.json deleted file mode 100644 index 329cedab..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "co2_concentration": 455, - "co2_sensor_status": 0, - "raw_ir_reading": 37844, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_01.json deleted file mode 100644 index 99b9ab59..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_02.json deleted file mode 100644 index 178f1e00..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.962, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_03.json deleted file mode 100644 index 51ba832c..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "co2_concentration": 455, - "co2_sensor_status": 0, - "raw_ir_reading": 37844, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_04.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_04.json deleted file mode 100644 index 501d0808..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_04.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_05.json b/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_05.json deleted file mode 100644 index 7b53e67a..00000000 --- a/VENDORS/Decentlab/DL-IAM/ChirpStack/uplink/result_05.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.962, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/converter.json deleted file mode 100644 index f3c39955..00000000 --- a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-IAM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IAM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/indoor-ambiance-monitor-including-co2-tvoc-and-motion-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]},\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[0] * 2; },\n unit: 'Pa'}]},\n {length: 2,\n values: [{name: 'ambient_light_visible_infrared',\n displayName: 'Ambient light (visible + infrared)',\n convert: function (x) { return x[0]; }},\n {name: 'ambient_light_infrared',\n displayName: 'Ambient light (infrared)',\n convert: function (x) { return x[1]; }},\n {name: 'illuminance',\n displayName: 'Illuminance',\n convert: function (x) { return Math.max(Math.max(1.0 * x[0] - 1.64 * x[1], 0.59 * x[0] - 0.86 * x[1]), 0) * 1.5504; },\n unit: 'lx'}]},\n {length: 3,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[1]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[2]; }}]},\n {length: 1,\n values: [{name: 'activity_counter',\n displayName: 'Activity counter',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'total_voc',\n displayName: 'Total VOC',\n convert: function (x) { return x[0]; },\n unit: 'ppb'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload.json deleted file mode 100644 index 04ab968b..00000000 --- a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020bbd007f0b926a515d48bc4e0262006981c7000093d4000b0111" -} diff --git a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload_01.json deleted file mode 100644 index 3fc4f5ee..00000000 --- a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020bbd006f0b926a515d48bc4e02620069000b0111" -} diff --git a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload_02.json b/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload_02.json deleted file mode 100644 index 909df582..00000000 --- a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/payload_02.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020bbd00010b92" -} diff --git a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result.json deleted file mode 100644 index aa9faf9a..00000000 --- a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "co2_concentration": 455, - "co2_sensor_status": 0, - "raw_ir_reading": 37844, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result_01.json deleted file mode 100644 index f6221b32..00000000 --- a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result_02.json b/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result_02.json deleted file mode 100644 index c831954a..00000000 --- a/VENDORS/Decentlab/DL-IAM/LORIOT/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.962, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/converter.json deleted file mode 100644 index d31b53a3..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-IAM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IAM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/indoor-ambiance-monitor-including-co2-tvoc-and-motion-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]},\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[0] * 2; },\n unit: 'Pa'}]},\n {length: 2,\n values: [{name: 'ambient_light_visible_infrared',\n displayName: 'Ambient light (visible + infrared)',\n convert: function (x) { return x[0]; }},\n {name: 'ambient_light_infrared',\n displayName: 'Ambient light (infrared)',\n convert: function (x) { return x[1]; }},\n {name: 'illuminance',\n displayName: 'Illuminance',\n convert: function (x) { return Math.max(Math.max(1.0 * x[0] - 1.64 * x[1], 0.59 * x[0] - 0.86 * x[1]), 0) * 1.5504; },\n unit: 'lx'}]},\n {length: 3,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[1]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[2]; }}]},\n {length: 1,\n values: [{name: 'activity_counter',\n displayName: 'Activity counter',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'total_voc',\n displayName: 'Total VOC',\n convert: function (x) { return x[0]; },\n unit: 'ppb'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload.json deleted file mode 100644 index be1ca67e..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020bbd007f0b926a515d48bc4e0262006981c7000093d4000b0111", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload_01.json deleted file mode 100644 index b081525a..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020bbd006f0b926a515d48bc4e02620069000b0111", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload_02.json b/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload_02.json deleted file mode 100644 index f57be120..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/payload_02.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020bbd00010b92", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result.json deleted file mode 100644 index 71e0799a..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "co2_concentration": 455, - "co2_sensor_status": 0, - "raw_ir_reading": 37844, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result_01.json deleted file mode 100644 index 664d39cc..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result_02.json b/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result_02.json deleted file mode 100644 index 3bbfef45..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingPark/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.962, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 238a4594..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-IAM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IAM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/indoor-ambiance-monitor-including-co2-tvoc-and-motion-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]},\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[0] * 2; },\n unit: 'Pa'}]},\n {length: 2,\n values: [{name: 'ambient_light_visible_infrared',\n displayName: 'Ambient light (visible + infrared)',\n convert: function (x) { return x[0]; }},\n {name: 'ambient_light_infrared',\n displayName: 'Ambient light (infrared)',\n convert: function (x) { return x[1]; }},\n {name: 'illuminance',\n displayName: 'Illuminance',\n convert: function (x) { return Math.max(Math.max(1.0 * x[0] - 1.64 * x[1], 0.59 * x[0] - 0.86 * x[1]), 0) * 1.5504; },\n unit: 'lx'}]},\n {length: 3,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[1]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[2]; }}]},\n {length: 1,\n values: [{name: 'activity_counter',\n displayName: 'Activity counter',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'total_voc',\n displayName: 'Total VOC',\n convert: function (x) { return x[0]; },\n unit: 'ppb'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index be1ca67e..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020bbd007f0b926a515d48bc4e0262006981c7000093d4000b0111", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index b081525a..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020bbd006f0b926a515d48bc4e02620069000b0111", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload_02.json b/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload_02.json deleted file mode 100644 index f57be120..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/payload_02.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020bbd00010b92", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 71e0799a..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "co2_concentration": 455, - "co2_sensor_status": 0, - "raw_ir_reading": 37844, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 664d39cc..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result_02.json b/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result_02.json deleted file mode 100644 index 3bbfef45..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingParkEnterprise/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.962, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 6e5b53f4..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-IAM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IAM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/indoor-ambiance-monitor-including-co2-tvoc-and-motion-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]},\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[0] * 2; },\n unit: 'Pa'}]},\n {length: 2,\n values: [{name: 'ambient_light_visible_infrared',\n displayName: 'Ambient light (visible + infrared)',\n convert: function (x) { return x[0]; }},\n {name: 'ambient_light_infrared',\n displayName: 'Ambient light (infrared)',\n convert: function (x) { return x[1]; }},\n {name: 'illuminance',\n displayName: 'Illuminance',\n convert: function (x) { return Math.max(Math.max(1.0 * x[0] - 1.64 * x[1], 0.59 * x[0] - 0.86 * x[1]), 0) * 1.5504; },\n unit: 'lx'}]},\n {length: 3,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[1]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[2]; }}]},\n {length: 1,\n values: [{name: 'activity_counter',\n displayName: 'Activity counter',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'total_voc',\n displayName: 'Total VOC',\n convert: function (x) { return x[0]; },\n unit: 'ppb'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 170147f4..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Agu9AH8LkmpRXUi8TgJiAGmBxwAAk9QACwER", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 21eec8de..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Agu9AG8LkmpRXUi8TgJiAGkACwER", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload_02.json b/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload_02.json deleted file mode 100644 index 7a48986f..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/payload_02.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Agu9AAELkg==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index e55b8afb..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "co2_concentration": 455, - "co2_sensor_status": 0, - "raw_ir_reading": 37844, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index fefd214d..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result_02.json b/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result_02.json deleted file mode 100644 index 2e24fee0..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackCommunity/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.962, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index a70c9d82..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-IAM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IAM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/indoor-ambiance-monitor-including-co2-tvoc-and-motion-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]},\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[0] * 2; },\n unit: 'Pa'}]},\n {length: 2,\n values: [{name: 'ambient_light_visible_infrared',\n displayName: 'Ambient light (visible + infrared)',\n convert: function (x) { return x[0]; }},\n {name: 'ambient_light_infrared',\n displayName: 'Ambient light (infrared)',\n convert: function (x) { return x[1]; }},\n {name: 'illuminance',\n displayName: 'Illuminance',\n convert: function (x) { return Math.max(Math.max(1.0 * x[0] - 1.64 * x[1], 0.59 * x[0] - 0.86 * x[1]), 0) * 1.5504; },\n unit: 'lx'}]},\n {length: 3,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[1]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[2]; }}]},\n {length: 1,\n values: [{name: 'activity_counter',\n displayName: 'Activity counter',\n convert: function (x) { return x[0]; }}]},\n {length: 1,\n values: [{name: 'total_voc',\n displayName: 'Total VOC',\n convert: function (x) { return x[0]; },\n unit: 'ppb'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 170147f4..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Agu9AH8LkmpRXUi8TgJiAGmBxwAAk9QACwER", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 21eec8de..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Agu9AG8LkmpRXUi8TgJiAGkACwER", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload_02.json b/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload_02.json deleted file mode 100644 index 7a48986f..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/payload_02.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Agu9AAELkg==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index e55b8afb..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "co2_concentration": 455, - "co2_sensor_status": 0, - "raw_ir_reading": 37844, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index fefd214d..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.962, - "air_temperature": 27.67833981841764, - "air_humidity": 36.438544289311054, - "barometric_pressure": 96412, - "ambient_light_visible_infrared": 610, - "ambient_light_infrared": 105, - "illuminance": 678.76512, - "activity_counter": 11, - "total_voc": 273, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result_02.json b/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result_02.json deleted file mode 100644 index 2e24fee0..00000000 --- a/VENDORS/Decentlab/DL-IAM/ThingsStackIndustries/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "3005", - "deviceType": "DL-IAM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.962, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/info.json b/VENDORS/Decentlab/DL-IAM/info.json deleted file mode 100644 index 884af733..00000000 --- a/VENDORS/Decentlab/DL-IAM/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/indoor-ambiance-monitor-including-co2-tvoc-and-motion-sensor-for-lorawan", - "description": "The Decentlab DL-IAM (Indoor Ambiance Monitor) is a LoRaWAN® end device that consists of a CO2 sensor, TVOC sensor, temperature sensor, humidity sensor, barometric pressure sensor, ambient light intensity sensor, and PIR motion sensor. Suitable for building automation, activity and visitor frequency monitoring, energy and HVAC optimization, shop and workplace comfort enhancement." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IAM/photo.png b/VENDORS/Decentlab/DL-IAM/photo.png deleted file mode 100644 index 1e466695..00000000 Binary files a/VENDORS/Decentlab/DL-IAM/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/converter.json deleted file mode 100644 index 24073947..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-IFD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IFD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/fruit-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'fruit_size',\n displayName: 'Fruit size',\n convert: function (x) { return x[0] / 100; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload.json deleted file mode 100644 index 657225f4..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlbcAAMCvAxI", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_01.json deleted file mode 100644 index bded1433..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlbcAAIMSA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 85f97b95..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlbcAAMCvAxI", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 6139dbe3..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlbcAAIMSA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result.json deleted file mode 100644 index 2b4754d9..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "fruit_size": 7, - "battery_voltage": 3.144, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_01.json deleted file mode 100644 index aff723c9..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.144, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_02.json deleted file mode 100644 index c01d2881..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "fruit_size": 7, - "battery_voltage": 3.144, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_03.json deleted file mode 100644 index 62faef9c..00000000 --- a/VENDORS/Decentlab/DL-IFD/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.144, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/converter.json deleted file mode 100644 index dc7bb282..00000000 --- a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-IFD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IFD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/fruit-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'fruit_size',\n displayName: 'Fruit size',\n convert: function (x) { return x[0] / 100; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/payload.json deleted file mode 100644 index de8ffc72..00000000 --- a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0256dc000302bc0c48" -} diff --git a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/payload_01.json deleted file mode 100644 index c79a3893..00000000 --- a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0256dc00020c48" -} diff --git a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/result.json deleted file mode 100644 index a91a1447..00000000 --- a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "fruit_size": 7, - "battery_voltage": 3.144, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/result_01.json deleted file mode 100644 index 65dc6478..00000000 --- a/VENDORS/Decentlab/DL-IFD/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.144, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/converter.json deleted file mode 100644 index 0addf933..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-IFD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IFD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/fruit-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'fruit_size',\n displayName: 'Fruit size',\n convert: function (x) { return x[0] / 100; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/payload.json deleted file mode 100644 index 88b2bceb..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256dc000302bc0c48", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/payload_01.json deleted file mode 100644 index 7d148989..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256dc00020c48", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/result.json deleted file mode 100644 index 39fd78f6..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "fruit_size": 7, - "battery_voltage": 3.144, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/result_01.json deleted file mode 100644 index e689286f..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.144, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index e9206a03..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-IFD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IFD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/fruit-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'fruit_size',\n displayName: 'Fruit size',\n convert: function (x) { return x[0] / 100; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 88b2bceb..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256dc000302bc0c48", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 7d148989..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256dc00020c48", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 39fd78f6..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "fruit_size": 7, - "battery_voltage": 3.144, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index e689286f..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.144, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 48e3e913..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-IFD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IFD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/fruit-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'fruit_size',\n displayName: 'Fruit size',\n convert: function (x) { return x[0] / 100; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index eddf3d48..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbcAAMCvAxI", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 91f63354..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbcAAIMSA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 2ee17ec9..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "fruit_size": 7, - "battery_voltage": 3.144, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 28310f5a..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.144, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 7356ee11..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-IFD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-IFD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/fruit-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'fruit_size',\n displayName: 'Fruit size',\n convert: function (x) { return x[0] / 100; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index eddf3d48..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbcAAMCvAxI", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 91f63354..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbcAAIMSA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 2ee17ec9..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "fruit_size": 7, - "battery_voltage": 3.144, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 28310f5a..00000000 --- a/VENDORS/Decentlab/DL-IFD/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22236", - "deviceType": "DL-IFD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.144, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/info.json b/VENDORS/Decentlab/DL-IFD/info.json deleted file mode 100644 index 7dd3918e..00000000 --- a/VENDORS/Decentlab/DL-IFD/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/fruit-dendrometer-sensor-for-lorawan", - "description": "The Decentlab DL-IFD is a fruit dendrometer sensor for LoRaWAN®. Suitable for applications such as outdoor remote monitoring, irrigation control, field monitoring, smart agriculture and scientific research." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-IFD/photo.png b/VENDORS/Decentlab/DL-IFD/photo.png deleted file mode 100644 index eca63cf9..00000000 Binary files a/VENDORS/Decentlab/DL-IFD/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/converter.json deleted file mode 100644 index ec875053..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ILT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ILT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/leaf-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'leaf_temperature',\n displayName: 'Leaf temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload.json deleted file mode 100644 index 7821c109..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlbSAAOKjAyd", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 4bf410b6..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlbSAAIMnQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_02.json deleted file mode 100644 index ed6ca2f0..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlbSAAOKjAyd", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 61efbbdf..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlbSAAIMnQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result.json deleted file mode 100644 index 2c5b1e06..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "leaf_temperature": 27, - "battery_voltage": 3.229, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_01.json deleted file mode 100644 index 799201a5..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.229, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_02.json deleted file mode 100644 index 91f6bb96..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "leaf_temperature": 27, - "battery_voltage": 3.229, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_03.json deleted file mode 100644 index 99493c66..00000000 --- a/VENDORS/Decentlab/DL-ILT/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.229, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/converter.json deleted file mode 100644 index a87081c0..00000000 --- a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ILT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ILT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/leaf-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'leaf_temperature',\n displayName: 'Leaf temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/payload.json deleted file mode 100644 index a8e010ff..00000000 --- a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0256d200038a8c0c9d" -} diff --git a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/payload_01.json deleted file mode 100644 index 8ddca334..00000000 --- a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0256d200020c9d" -} diff --git a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/result.json deleted file mode 100644 index 1eba36f5..00000000 --- a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "leaf_temperature": 27, - "battery_voltage": 3.229, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/result_01.json deleted file mode 100644 index 62b1dcc1..00000000 --- a/VENDORS/Decentlab/DL-ILT/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.229, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/converter.json deleted file mode 100644 index 6c04a6c6..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ILT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ILT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/leaf-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'leaf_temperature',\n displayName: 'Leaf temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/payload.json deleted file mode 100644 index 6bac0912..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256d200038a8c0c9d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/payload_01.json deleted file mode 100644 index aeaba35e..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256d200020c9d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/result.json deleted file mode 100644 index f9503dfc..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "leaf_temperature": 27, - "battery_voltage": 3.229, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/result_01.json deleted file mode 100644 index 3f31a1a2..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.229, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index cbcca1f7..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ILT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ILT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/leaf-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'leaf_temperature',\n displayName: 'Leaf temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 6bac0912..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256d200038a8c0c9d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index aeaba35e..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256d200020c9d", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index f9503dfc..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "leaf_temperature": 27, - "battery_voltage": 3.229, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 3f31a1a2..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.229, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 56c1dc0d..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ILT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ILT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/leaf-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'leaf_temperature',\n displayName: 'Leaf temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 1444342e..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbSAAOKjAyd", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index e2a5bf95..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbSAAIMnQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 37742cac..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "leaf_temperature": 27, - "battery_voltage": 3.229, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 0a6c8e59..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.229, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index b44203da..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ILT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ILT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/leaf-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'leaf_temperature',\n displayName: 'Leaf temperature',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 1444342e..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbSAAOKjAyd", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index e2a5bf95..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbSAAIMnQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 37742cac..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "leaf_temperature": 27, - "battery_voltage": 3.229, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 0a6c8e59..00000000 --- a/VENDORS/Decentlab/DL-ILT/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22226", - "deviceType": "DL-ILT", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.229, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/info.json b/VENDORS/Decentlab/DL-ILT/info.json deleted file mode 100644 index 1256df9d..00000000 --- a/VENDORS/Decentlab/DL-ILT/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/leaf-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-ILT is a leaf temperature sensor for LoRaWAN®. Suitable for applications such as outdoor remote monitoring, irrigation control, field monitoring, smart agriculture and scientific research." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ILT/photo.png b/VENDORS/Decentlab/DL-ILT/photo.png deleted file mode 100644 index b21adc30..00000000 Binary files a/VENDORS/Decentlab/DL-ILT/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/converter.json deleted file mode 100644 index 80903911..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ISD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/stem-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'stem_size',\n displayName: 'Stem size',\n convert: function (x) { return x[0] / 1000; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload.json deleted file mode 100644 index 583d4122..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlbhAAMLUgxS", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 5bc852cc..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlbhAAIMUg==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 2b9b66b7..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlbhAAMLUgxS", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 03255211..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlbhAAIMUg==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result.json deleted file mode 100644 index 254df759..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "stem_size": 2.898, - "battery_voltage": 3.154, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_01.json deleted file mode 100644 index e9b151ab..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.154, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_02.json deleted file mode 100644 index 6e40cdd3..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "stem_size": 2.898, - "battery_voltage": 3.154, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_03.json deleted file mode 100644 index 3479f24d..00000000 --- a/VENDORS/Decentlab/DL-ISD/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.154, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/converter.json deleted file mode 100644 index 1ae7ec75..00000000 --- a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ISD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/stem-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'stem_size',\n displayName: 'Stem size',\n convert: function (x) { return x[0] / 1000; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/payload.json deleted file mode 100644 index 0aabda01..00000000 --- a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0256e100030b520c52" -} diff --git a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/payload_01.json deleted file mode 100644 index a7a899b9..00000000 --- a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0256e100020c52" -} diff --git a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/result.json deleted file mode 100644 index 88211a3c..00000000 --- a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "stem_size": 2.898, - "battery_voltage": 3.154, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/result_01.json deleted file mode 100644 index 66b84e81..00000000 --- a/VENDORS/Decentlab/DL-ISD/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.154, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/converter.json deleted file mode 100644 index d363ce70..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ISD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/stem-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'stem_size',\n displayName: 'Stem size',\n convert: function (x) { return x[0] / 1000; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/payload.json deleted file mode 100644 index 2cce403c..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256e100030b520c52", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/payload_01.json deleted file mode 100644 index c2b91b6c..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256e100020c52", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/result.json deleted file mode 100644 index d92105c5..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "stem_size": 2.898, - "battery_voltage": 3.154, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/result_01.json deleted file mode 100644 index dde1515a..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.154, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 52e33e8d..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ISD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/stem-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'stem_size',\n displayName: 'Stem size',\n convert: function (x) { return x[0] / 1000; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 2cce403c..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256e100030b520c52", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index c2b91b6c..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0256e100020c52", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index d92105c5..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "stem_size": 2.898, - "battery_voltage": 3.154, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index dde1515a..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.154, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 2575511e..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ISD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/stem-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'stem_size',\n displayName: 'Stem size',\n convert: function (x) { return x[0] / 1000; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 2595b7e6..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbhAAMLUgxS", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 7b77854a..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbhAAIMUg==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 79115fcc..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "stem_size": 2.898, - "battery_voltage": 3.154, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index c8b1b836..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.154, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 8cecac2b..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ISD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/stem-dendrometer-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'stem_size',\n displayName: 'Stem size',\n convert: function (x) { return x[0] / 1000; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 2595b7e6..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbhAAMLUgxS", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 7b77854a..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlbhAAIMUg==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 79115fcc..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "stem_size": 2.898, - "battery_voltage": 3.154, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index c8b1b836..00000000 --- a/VENDORS/Decentlab/DL-ISD/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "22241", - "deviceType": "DL-ISD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.154, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/info.json b/VENDORS/Decentlab/DL-ISD/info.json deleted file mode 100644 index 8a60bd76..00000000 --- a/VENDORS/Decentlab/DL-ISD/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/stem-dendrometer-sensor-for-lorawan", - "description": "The Decentlab DL-ISD is a stem dendrometer sensor for LoRaWAN®. Suitable for applications such as outdoor remote monitoring, irrigation control, field monitoring, smart agriculture and scientific research." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISD/photo.png b/VENDORS/Decentlab/DL-ISD/photo.png deleted file mode 100644 index 3742b9bb..00000000 Binary files a/VENDORS/Decentlab/DL-ISD/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/converter.json deleted file mode 100644 index 1c1070c7..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ISF", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISF',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/sapflow-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'sap_flow',\n displayName: 'Sap flow',\n convert: function (x) { return (x[0] * 16 - 50000) / 1000; },\n unit: 'l⋅h⁻¹'},\n {name: 'heat_velocity_outer',\n displayName: 'Heat velocity (outer)',\n convert: function (x) { return (x[1] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'heat_velocity_inner',\n displayName: 'Heat velocity (inner)',\n convert: function (x) { return (x[2] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'alpha_outer',\n displayName: 'Alpha (outer)',\n convert: function (x) { return (x[3] * 32 - 1000000) / 100000; }},\n {name: 'alpha_inner',\n displayName: 'Alpha (inner)',\n convert: function (x) { return (x[4] * 32 - 1000000) / 100000; }},\n {name: 'beta_outer',\n displayName: 'Beta (outer)',\n convert: function (x) { return (x[5] * 32 - 1000000) / 100000; }},\n {name: 'beta_inner',\n displayName: 'Beta (inner)',\n convert: function (x) { return (x[6] * 32 - 1000000) / 100000; }},\n {name: 'tmax_outer',\n displayName: 'Tmax (outer)',\n convert: function (x) { return (x[7] * 2) / 1000; },\n unit: 's'},\n {name: 'tmax_inner',\n displayName: 'Tmax (inner)',\n convert: function (x) { return (x[8] * 2) / 1000; },\n unit: 's'},\n {name: 'temperature_outer',\n displayName: 'Temperature (outer)',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'max_voltage',\n displayName: 'Max voltage',\n convert: function (x) { return (x[10] - 32768) / 1000; },\n unit: 'V'},\n {name: 'min_voltage',\n displayName: 'Min voltage',\n convert: function (x) { return (x[11] - 32768) / 1000; },\n unit: 'V'},\n {name: 'diagnostic',\n displayName: 'Diagnostic',\n convert: function (x) { return x[12] + x[13] * 65536; }},\n {name: 'upstream_tmax_outer',\n displayName: 'Upstream Tmax (outer)',\n convert: function (x) { return (x[14] * 2) / 1000; },\n unit: 's'},\n {name: 'upstream_tmax_inner',\n displayName: 'Upstream Tmax (inner)',\n convert: function (x) { return (x[15] * 2) / 1000; },\n unit: 's'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload.json deleted file mode 100644 index a75d98c6..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Aj0BAAMMKQurDD55cHodeEN5kUkIRZl+TKzeqm4AAAAARX5BWgtZ", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_01.json deleted file mode 100644 index e9a68952..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Aj0BAAILWQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 525475e2..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Aj0BAAMMKQurDD55cHodeEN5kUkIRZl+TKzeqm4AAAAARX5BWgtZ", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_03.json deleted file mode 100644 index e3a2246a..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Aj0BAAILWQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result.json deleted file mode 100644 index 3959cfb7..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "sap_flow": -0.192, - "heat_velocity_outer": -2.208, - "heat_velocity_inner": 0.144, - "alpha_outer": -0.05184, - "alpha_inner": 0.00352, - "beta_outer": -0.14816, - "beta_inner": -0.04128, - "tmax_outer": 37.392, - "tmax_inner": 35.634, - "temperature_outer": -4.36, - "max_voltage": 11.486, - "min_voltage": 10.862, - "diagnostic": 0, - "upstream_tmax_outer": 35.58, - "upstream_tmax_inner": 33.46, - "battery_voltage": 2.905, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_01.json deleted file mode 100644 index 0cfd65c0..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.905, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_02.json deleted file mode 100644 index 457cfbab..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "sap_flow": -0.192, - "heat_velocity_outer": -2.208, - "heat_velocity_inner": 0.144, - "alpha_outer": -0.05184, - "alpha_inner": 0.00352, - "beta_outer": -0.14816, - "beta_inner": -0.04128, - "tmax_outer": 37.392, - "tmax_inner": 35.634, - "temperature_outer": -4.36, - "max_voltage": 11.486, - "min_voltage": 10.862, - "diagnostic": 0, - "upstream_tmax_outer": 35.58, - "upstream_tmax_inner": 33.46, - "battery_voltage": 2.905, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_03.json deleted file mode 100644 index 4ddebad7..00000000 --- a/VENDORS/Decentlab/DL-ISF/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.905, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/converter.json deleted file mode 100644 index 44509ae9..00000000 --- a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ISF", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISF',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/sapflow-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'sap_flow',\n displayName: 'Sap flow',\n convert: function (x) { return (x[0] * 16 - 50000) / 1000; },\n unit: 'l⋅h⁻¹'},\n {name: 'heat_velocity_outer',\n displayName: 'Heat velocity (outer)',\n convert: function (x) { return (x[1] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'heat_velocity_inner',\n displayName: 'Heat velocity (inner)',\n convert: function (x) { return (x[2] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'alpha_outer',\n displayName: 'Alpha (outer)',\n convert: function (x) { return (x[3] * 32 - 1000000) / 100000; }},\n {name: 'alpha_inner',\n displayName: 'Alpha (inner)',\n convert: function (x) { return (x[4] * 32 - 1000000) / 100000; }},\n {name: 'beta_outer',\n displayName: 'Beta (outer)',\n convert: function (x) { return (x[5] * 32 - 1000000) / 100000; }},\n {name: 'beta_inner',\n displayName: 'Beta (inner)',\n convert: function (x) { return (x[6] * 32 - 1000000) / 100000; }},\n {name: 'tmax_outer',\n displayName: 'Tmax (outer)',\n convert: function (x) { return (x[7] * 2) / 1000; },\n unit: 's'},\n {name: 'tmax_inner',\n displayName: 'Tmax (inner)',\n convert: function (x) { return (x[8] * 2) / 1000; },\n unit: 's'},\n {name: 'temperature_outer',\n displayName: 'Temperature (outer)',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'max_voltage',\n displayName: 'Max voltage',\n convert: function (x) { return (x[10] - 32768) / 1000; },\n unit: 'V'},\n {name: 'min_voltage',\n displayName: 'Min voltage',\n convert: function (x) { return (x[11] - 32768) / 1000; },\n unit: 'V'},\n {name: 'diagnostic',\n displayName: 'Diagnostic',\n convert: function (x) { return x[12] + x[13] * 65536; }},\n {name: 'upstream_tmax_outer',\n displayName: 'Upstream Tmax (outer)',\n convert: function (x) { return (x[14] * 2) / 1000; },\n unit: 's'},\n {name: 'upstream_tmax_inner',\n displayName: 'Upstream Tmax (inner)',\n convert: function (x) { return (x[15] * 2) / 1000; },\n unit: 's'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/payload.json deleted file mode 100644 index a3e5df95..00000000 --- a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "023d0100030c290bab0c3e79707a1d78437991490845997e4cacdeaa6e00000000457e415a0b59" -} diff --git a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/payload_01.json deleted file mode 100644 index f46630f0..00000000 --- a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "023d0100020b59" -} diff --git a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/result.json deleted file mode 100644 index 7ad4d03d..00000000 --- a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/result.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "sap_flow": -0.192, - "heat_velocity_outer": -2.208, - "heat_velocity_inner": 0.144, - "alpha_outer": -0.05184, - "alpha_inner": 0.00352, - "beta_outer": -0.14816, - "beta_inner": -0.04128, - "tmax_outer": 37.392, - "tmax_inner": 35.634, - "temperature_outer": -4.36, - "max_voltage": 11.486, - "min_voltage": 10.862, - "diagnostic": 0, - "upstream_tmax_outer": 35.58, - "upstream_tmax_inner": 33.46, - "battery_voltage": 2.905, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/result_01.json deleted file mode 100644 index 1e367015..00000000 --- a/VENDORS/Decentlab/DL-ISF/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.905, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/converter.json deleted file mode 100644 index c0e129a6..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ISF", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISF',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/sapflow-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'sap_flow',\n displayName: 'Sap flow',\n convert: function (x) { return (x[0] * 16 - 50000) / 1000; },\n unit: 'l⋅h⁻¹'},\n {name: 'heat_velocity_outer',\n displayName: 'Heat velocity (outer)',\n convert: function (x) { return (x[1] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'heat_velocity_inner',\n displayName: 'Heat velocity (inner)',\n convert: function (x) { return (x[2] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'alpha_outer',\n displayName: 'Alpha (outer)',\n convert: function (x) { return (x[3] * 32 - 1000000) / 100000; }},\n {name: 'alpha_inner',\n displayName: 'Alpha (inner)',\n convert: function (x) { return (x[4] * 32 - 1000000) / 100000; }},\n {name: 'beta_outer',\n displayName: 'Beta (outer)',\n convert: function (x) { return (x[5] * 32 - 1000000) / 100000; }},\n {name: 'beta_inner',\n displayName: 'Beta (inner)',\n convert: function (x) { return (x[6] * 32 - 1000000) / 100000; }},\n {name: 'tmax_outer',\n displayName: 'Tmax (outer)',\n convert: function (x) { return (x[7] * 2) / 1000; },\n unit: 's'},\n {name: 'tmax_inner',\n displayName: 'Tmax (inner)',\n convert: function (x) { return (x[8] * 2) / 1000; },\n unit: 's'},\n {name: 'temperature_outer',\n displayName: 'Temperature (outer)',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'max_voltage',\n displayName: 'Max voltage',\n convert: function (x) { return (x[10] - 32768) / 1000; },\n unit: 'V'},\n {name: 'min_voltage',\n displayName: 'Min voltage',\n convert: function (x) { return (x[11] - 32768) / 1000; },\n unit: 'V'},\n {name: 'diagnostic',\n displayName: 'Diagnostic',\n convert: function (x) { return x[12] + x[13] * 65536; }},\n {name: 'upstream_tmax_outer',\n displayName: 'Upstream Tmax (outer)',\n convert: function (x) { return (x[14] * 2) / 1000; },\n unit: 's'},\n {name: 'upstream_tmax_inner',\n displayName: 'Upstream Tmax (inner)',\n convert: function (x) { return (x[15] * 2) / 1000; },\n unit: 's'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/payload.json deleted file mode 100644 index ea2abf01..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "023d0100030c290bab0c3e79707a1d78437991490845997e4cacdeaa6e00000000457e415a0b59", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/payload_01.json deleted file mode 100644 index 066d628a..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "023d0100020b59", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/result.json deleted file mode 100644 index d3f94cd0..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/result.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "sap_flow": -0.192, - "heat_velocity_outer": -2.208, - "heat_velocity_inner": 0.144, - "alpha_outer": -0.05184, - "alpha_inner": 0.00352, - "beta_outer": -0.14816, - "beta_inner": -0.04128, - "tmax_outer": 37.392, - "tmax_inner": 35.634, - "temperature_outer": -4.36, - "max_voltage": 11.486, - "min_voltage": 10.862, - "diagnostic": 0, - "upstream_tmax_outer": 35.58, - "upstream_tmax_inner": 33.46, - "battery_voltage": 2.905, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/result_01.json deleted file mode 100644 index 450e85b8..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.905, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 9c73cda3..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ISF", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISF',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/sapflow-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'sap_flow',\n displayName: 'Sap flow',\n convert: function (x) { return (x[0] * 16 - 50000) / 1000; },\n unit: 'l⋅h⁻¹'},\n {name: 'heat_velocity_outer',\n displayName: 'Heat velocity (outer)',\n convert: function (x) { return (x[1] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'heat_velocity_inner',\n displayName: 'Heat velocity (inner)',\n convert: function (x) { return (x[2] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'alpha_outer',\n displayName: 'Alpha (outer)',\n convert: function (x) { return (x[3] * 32 - 1000000) / 100000; }},\n {name: 'alpha_inner',\n displayName: 'Alpha (inner)',\n convert: function (x) { return (x[4] * 32 - 1000000) / 100000; }},\n {name: 'beta_outer',\n displayName: 'Beta (outer)',\n convert: function (x) { return (x[5] * 32 - 1000000) / 100000; }},\n {name: 'beta_inner',\n displayName: 'Beta (inner)',\n convert: function (x) { return (x[6] * 32 - 1000000) / 100000; }},\n {name: 'tmax_outer',\n displayName: 'Tmax (outer)',\n convert: function (x) { return (x[7] * 2) / 1000; },\n unit: 's'},\n {name: 'tmax_inner',\n displayName: 'Tmax (inner)',\n convert: function (x) { return (x[8] * 2) / 1000; },\n unit: 's'},\n {name: 'temperature_outer',\n displayName: 'Temperature (outer)',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'max_voltage',\n displayName: 'Max voltage',\n convert: function (x) { return (x[10] - 32768) / 1000; },\n unit: 'V'},\n {name: 'min_voltage',\n displayName: 'Min voltage',\n convert: function (x) { return (x[11] - 32768) / 1000; },\n unit: 'V'},\n {name: 'diagnostic',\n displayName: 'Diagnostic',\n convert: function (x) { return x[12] + x[13] * 65536; }},\n {name: 'upstream_tmax_outer',\n displayName: 'Upstream Tmax (outer)',\n convert: function (x) { return (x[14] * 2) / 1000; },\n unit: 's'},\n {name: 'upstream_tmax_inner',\n displayName: 'Upstream Tmax (inner)',\n convert: function (x) { return (x[15] * 2) / 1000; },\n unit: 's'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index ea2abf01..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "023d0100030c290bab0c3e79707a1d78437991490845997e4cacdeaa6e00000000457e415a0b59", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 066d628a..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "023d0100020b59", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index d3f94cd0..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "sap_flow": -0.192, - "heat_velocity_outer": -2.208, - "heat_velocity_inner": 0.144, - "alpha_outer": -0.05184, - "alpha_inner": 0.00352, - "beta_outer": -0.14816, - "beta_inner": -0.04128, - "tmax_outer": 37.392, - "tmax_inner": 35.634, - "temperature_outer": -4.36, - "max_voltage": 11.486, - "min_voltage": 10.862, - "diagnostic": 0, - "upstream_tmax_outer": 35.58, - "upstream_tmax_inner": 33.46, - "battery_voltage": 2.905, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 450e85b8..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.905, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 1c3d3f9b..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ISF", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISF',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/sapflow-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'sap_flow',\n displayName: 'Sap flow',\n convert: function (x) { return (x[0] * 16 - 50000) / 1000; },\n unit: 'l⋅h⁻¹'},\n {name: 'heat_velocity_outer',\n displayName: 'Heat velocity (outer)',\n convert: function (x) { return (x[1] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'heat_velocity_inner',\n displayName: 'Heat velocity (inner)',\n convert: function (x) { return (x[2] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'alpha_outer',\n displayName: 'Alpha (outer)',\n convert: function (x) { return (x[3] * 32 - 1000000) / 100000; }},\n {name: 'alpha_inner',\n displayName: 'Alpha (inner)',\n convert: function (x) { return (x[4] * 32 - 1000000) / 100000; }},\n {name: 'beta_outer',\n displayName: 'Beta (outer)',\n convert: function (x) { return (x[5] * 32 - 1000000) / 100000; }},\n {name: 'beta_inner',\n displayName: 'Beta (inner)',\n convert: function (x) { return (x[6] * 32 - 1000000) / 100000; }},\n {name: 'tmax_outer',\n displayName: 'Tmax (outer)',\n convert: function (x) { return (x[7] * 2) / 1000; },\n unit: 's'},\n {name: 'tmax_inner',\n displayName: 'Tmax (inner)',\n convert: function (x) { return (x[8] * 2) / 1000; },\n unit: 's'},\n {name: 'temperature_outer',\n displayName: 'Temperature (outer)',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'max_voltage',\n displayName: 'Max voltage',\n convert: function (x) { return (x[10] - 32768) / 1000; },\n unit: 'V'},\n {name: 'min_voltage',\n displayName: 'Min voltage',\n convert: function (x) { return (x[11] - 32768) / 1000; },\n unit: 'V'},\n {name: 'diagnostic',\n displayName: 'Diagnostic',\n convert: function (x) { return x[12] + x[13] * 65536; }},\n {name: 'upstream_tmax_outer',\n displayName: 'Upstream Tmax (outer)',\n convert: function (x) { return (x[14] * 2) / 1000; },\n unit: 's'},\n {name: 'upstream_tmax_inner',\n displayName: 'Upstream Tmax (inner)',\n convert: function (x) { return (x[15] * 2) / 1000; },\n unit: 's'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index fcd2665a..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Aj0BAAMMKQurDD55cHodeEN5kUkIRZl+TKzeqm4AAAAARX5BWgtZ", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 72261dbb..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Aj0BAAILWQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 3f4d2c89..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "sap_flow": -0.192, - "heat_velocity_outer": -2.208, - "heat_velocity_inner": 0.144, - "alpha_outer": -0.05184, - "alpha_inner": 0.00352, - "beta_outer": -0.14816, - "beta_inner": -0.04128, - "tmax_outer": 37.392, - "tmax_inner": 35.634, - "temperature_outer": -4.36, - "max_voltage": 11.486, - "min_voltage": 10.862, - "diagnostic": 0, - "upstream_tmax_outer": 35.58, - "upstream_tmax_inner": 33.46, - "battery_voltage": 2.905, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 58cdb6b2..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.905, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index d0efbd23..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ISF", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ISF',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/sapflow-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'sap_flow',\n displayName: 'Sap flow',\n convert: function (x) { return (x[0] * 16 - 50000) / 1000; },\n unit: 'l⋅h⁻¹'},\n {name: 'heat_velocity_outer',\n displayName: 'Heat velocity (outer)',\n convert: function (x) { return (x[1] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'heat_velocity_inner',\n displayName: 'Heat velocity (inner)',\n convert: function (x) { return (x[2] * 16 - 50000) / 1000; },\n unit: 'cm⋅h⁻¹'},\n {name: 'alpha_outer',\n displayName: 'Alpha (outer)',\n convert: function (x) { return (x[3] * 32 - 1000000) / 100000; }},\n {name: 'alpha_inner',\n displayName: 'Alpha (inner)',\n convert: function (x) { return (x[4] * 32 - 1000000) / 100000; }},\n {name: 'beta_outer',\n displayName: 'Beta (outer)',\n convert: function (x) { return (x[5] * 32 - 1000000) / 100000; }},\n {name: 'beta_inner',\n displayName: 'Beta (inner)',\n convert: function (x) { return (x[6] * 32 - 1000000) / 100000; }},\n {name: 'tmax_outer',\n displayName: 'Tmax (outer)',\n convert: function (x) { return (x[7] * 2) / 1000; },\n unit: 's'},\n {name: 'tmax_inner',\n displayName: 'Tmax (inner)',\n convert: function (x) { return (x[8] * 2) / 1000; },\n unit: 's'},\n {name: 'temperature_outer',\n displayName: 'Temperature (outer)',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'max_voltage',\n displayName: 'Max voltage',\n convert: function (x) { return (x[10] - 32768) / 1000; },\n unit: 'V'},\n {name: 'min_voltage',\n displayName: 'Min voltage',\n convert: function (x) { return (x[11] - 32768) / 1000; },\n unit: 'V'},\n {name: 'diagnostic',\n displayName: 'Diagnostic',\n convert: function (x) { return x[12] + x[13] * 65536; }},\n {name: 'upstream_tmax_outer',\n displayName: 'Upstream Tmax (outer)',\n convert: function (x) { return (x[14] * 2) / 1000; },\n unit: 's'},\n {name: 'upstream_tmax_inner',\n displayName: 'Upstream Tmax (inner)',\n convert: function (x) { return (x[15] * 2) / 1000; },\n unit: 's'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index fcd2665a..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Aj0BAAMMKQurDD55cHodeEN5kUkIRZl+TKzeqm4AAAAARX5BWgtZ", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 72261dbb..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Aj0BAAILWQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 3f4d2c89..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "sap_flow": -0.192, - "heat_velocity_outer": -2.208, - "heat_velocity_inner": 0.144, - "alpha_outer": -0.05184, - "alpha_inner": 0.00352, - "beta_outer": -0.14816, - "beta_inner": -0.04128, - "tmax_outer": 37.392, - "tmax_inner": 35.634, - "temperature_outer": -4.36, - "max_voltage": 11.486, - "min_voltage": 10.862, - "diagnostic": 0, - "upstream_tmax_outer": 35.58, - "upstream_tmax_inner": 33.46, - "battery_voltage": 2.905, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 58cdb6b2..00000000 --- a/VENDORS/Decentlab/DL-ISF/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15617", - "deviceType": "DL-ISF", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.905, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/info.json b/VENDORS/Decentlab/DL-ISF/info.json deleted file mode 100644 index c5166d52..00000000 --- a/VENDORS/Decentlab/DL-ISF/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/sapflow-sensor-for-lorawan", - "description": "The Decentlab DL-ISF is a sap flow sensor for LoRaWAN®. Suitable for applications such as plant physiology, plant water use, hydraulic redistribution, hydrology, and irrigation scheduling." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ISF/photo.png b/VENDORS/Decentlab/DL-ISF/photo.png deleted file mode 100644 index 6a9f8c81..00000000 Binary files a/VENDORS/Decentlab/DL-ISF/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/converter.json deleted file mode 100644 index d09595a0..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ITST", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ITST',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/infrared-thermometer-/-surface-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature_target',\n displayName: 'Temperature target',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'temperature_head',\n displayName: 'Temperature head',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload.json deleted file mode 100644 index e492f9fa..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgLZAAME+QTEDFQ=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 1a0db943..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgLZAAIMVA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_02.json deleted file mode 100644 index ea9ace01..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgLZAAME+QTEDFQ=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_03.json deleted file mode 100644 index cd758cea..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgLZAAIMVA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result.json deleted file mode 100644 index b29389fa..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "temperature_target": 27.3, - "temperature_head": 22, - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_01.json deleted file mode 100644 index d03ddf96..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_02.json deleted file mode 100644 index 05de1879..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "temperature_target": 27.3, - "temperature_head": 22, - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_03.json deleted file mode 100644 index 80e48ce3..00000000 --- a/VENDORS/Decentlab/DL-ITST/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/converter.json deleted file mode 100644 index ebad0bf4..00000000 --- a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ITST", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ITST',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/infrared-thermometer-/-surface-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature_target',\n displayName: 'Temperature target',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'temperature_head',\n displayName: 'Temperature head',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/payload.json deleted file mode 100644 index 7e9125dd..00000000 --- a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0202d9000304f904c40c54" -} diff --git a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/payload_01.json deleted file mode 100644 index aaa1bfd9..00000000 --- a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0202d900020c54" -} diff --git a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/result.json deleted file mode 100644 index 64f889e0..00000000 --- a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "temperature_target": 27.3, - "temperature_head": 22, - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/result_01.json deleted file mode 100644 index b4d30d42..00000000 --- a/VENDORS/Decentlab/DL-ITST/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/converter.json deleted file mode 100644 index 3f459ebf..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ITST", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ITST',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/infrared-thermometer-/-surface-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature_target',\n displayName: 'Temperature target',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'temperature_head',\n displayName: 'Temperature head',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/payload.json deleted file mode 100644 index 5d171426..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202d9000304f904c40c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/payload_01.json deleted file mode 100644 index bdec2b04..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202d900020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/result.json deleted file mode 100644 index 585e4e94..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "temperature_target": 27.3, - "temperature_head": 22, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/result_01.json deleted file mode 100644 index b8fb83d3..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 6f123719..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ITST", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ITST',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/infrared-thermometer-/-surface-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature_target',\n displayName: 'Temperature target',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'temperature_head',\n displayName: 'Temperature head',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 5d171426..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202d9000304f904c40c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index bdec2b04..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202d900020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 585e4e94..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "temperature_target": 27.3, - "temperature_head": 22, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index b8fb83d3..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index cd325402..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ITST", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ITST',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/infrared-thermometer-/-surface-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature_target',\n displayName: 'Temperature target',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'temperature_head',\n displayName: 'Temperature head',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index fe909701..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgLZAAME+QTEDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 9530fcbc..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgLZAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 120c8227..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "temperature_target": 27.3, - "temperature_head": 22, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 56b06bed..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 8beb4feb..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ITST", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ITST',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/infrared-thermometer-/-surface-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'temperature_target',\n displayName: 'Temperature target',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'temperature_head',\n displayName: 'Temperature head',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index fe909701..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgLZAAME+QTEDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 9530fcbc..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgLZAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 120c8227..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "temperature_target": 27.3, - "temperature_head": 22, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 56b06bed..00000000 --- a/VENDORS/Decentlab/DL-ITST/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "729", - "deviceType": "DL-ITST", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/info.json b/VENDORS/Decentlab/DL-ITST/info.json deleted file mode 100644 index a131b122..00000000 --- a/VENDORS/Decentlab/DL-ITST/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/infrared-thermometer-/-surface-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-ITST is equipped with an infrared pyrometer (thermometer) for measuring surface temperature. Ideal for road surface monitoring, ice warning, and smart agriculture." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ITST/photo.png b/VENDORS/Decentlab/DL-ITST/photo.png deleted file mode 100644 index b7490d69..00000000 Binary files a/VENDORS/Decentlab/DL-ITST/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/converter.json deleted file mode 100644 index 6aa3c8a5..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-KL66", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-KL66',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/strain-/-weight-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f0: 15383.72,\n k: 46.4859\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'counter_reading',\n displayName: 'Counter reading',\n convert: function (x) { return x[0]; }},\n {name: 'measurement_interval',\n displayName: 'Measurement interval',\n convert: function (x) { return x[1] / 32768; }},\n {name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000; },\n unit: 'g'},\n {name: 'elongation',\n displayName: 'Elongation',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067; },\n unit: 'µm'},\n {name: 'strain',\n displayName: 'Strain',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067 / 0.066; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload.json deleted file mode 100644 index 0f95e527..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgPUAAM79n//O/YMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 99fac371..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgPUAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_02.json deleted file mode 100644 index a9398c6f..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgPUAAM79n//O/YMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_03.json deleted file mode 100644 index c28b040b..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgPUAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result.json deleted file mode 100644 index b14a291f..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "counter_reading": 15350, - "measurement_interval": 0.999969482421875, - "frequency": 15350.468459120457, - "weight": -47.5066896399347, - "elongation": 0.6988257799379214, - "strain": 10.588269392998809, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_01.json deleted file mode 100644 index 76dcaf16..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_02.json deleted file mode 100644 index ce4f1a35..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "counter_reading": 15350, - "measurement_interval": 0.999969482421875, - "frequency": 15350.468459120457, - "weight": -47.5066896399347, - "elongation": 0.6988257799379214, - "strain": 10.588269392998809, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_03.json deleted file mode 100644 index a22cb5c4..00000000 --- a/VENDORS/Decentlab/DL-KL66/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/converter.json deleted file mode 100644 index b9d73e1c..00000000 --- a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-KL66", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-KL66',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/strain-/-weight-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f0: 15383.72,\n k: 46.4859\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'counter_reading',\n displayName: 'Counter reading',\n convert: function (x) { return x[0]; }},\n {name: 'measurement_interval',\n displayName: 'Measurement interval',\n convert: function (x) { return x[1] / 32768; }},\n {name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000; },\n unit: 'g'},\n {name: 'elongation',\n displayName: 'Elongation',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067; },\n unit: 'µm'},\n {name: 'strain',\n displayName: 'Strain',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067 / 0.066; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/payload.json deleted file mode 100644 index 2f5c58e5..00000000 --- a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0203d400033bf67fff3bf60c60" -} diff --git a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/payload_01.json deleted file mode 100644 index 74b4dadb..00000000 --- a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0203d400020c60" -} diff --git a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/result.json deleted file mode 100644 index 3f7cb10a..00000000 --- a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "counter_reading": 15350, - "measurement_interval": 0.999969482421875, - "frequency": 15350.468459120457, - "weight": -47.5066896399347, - "elongation": 0.6988257799379214, - "strain": 10.588269392998809, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/result_01.json deleted file mode 100644 index 9cc0d4b9..00000000 --- a/VENDORS/Decentlab/DL-KL66/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/converter.json deleted file mode 100644 index 9d8b7642..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-KL66", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-KL66',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/strain-/-weight-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f0: 15383.72,\n k: 46.4859\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'counter_reading',\n displayName: 'Counter reading',\n convert: function (x) { return x[0]; }},\n {name: 'measurement_interval',\n displayName: 'Measurement interval',\n convert: function (x) { return x[1] / 32768; }},\n {name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000; },\n unit: 'g'},\n {name: 'elongation',\n displayName: 'Elongation',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067; },\n unit: 'µm'},\n {name: 'strain',\n displayName: 'Strain',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067 / 0.066; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/payload.json deleted file mode 100644 index 11b9e666..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0203d400033bf67fff3bf60c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/payload_01.json deleted file mode 100644 index 71b9cb14..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0203d400020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/result.json deleted file mode 100644 index d0e1c863..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "counter_reading": 15350, - "measurement_interval": 0.999969482421875, - "frequency": 15350.468459120457, - "weight": -47.5066896399347, - "elongation": 0.6988257799379214, - "strain": 10.588269392998809, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/result_01.json deleted file mode 100644 index fadc1c93..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index ce2b6280..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-KL66", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-KL66',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/strain-/-weight-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f0: 15383.72,\n k: 46.4859\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'counter_reading',\n displayName: 'Counter reading',\n convert: function (x) { return x[0]; }},\n {name: 'measurement_interval',\n displayName: 'Measurement interval',\n convert: function (x) { return x[1] / 32768; }},\n {name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000; },\n unit: 'g'},\n {name: 'elongation',\n displayName: 'Elongation',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067; },\n unit: 'µm'},\n {name: 'strain',\n displayName: 'Strain',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067 / 0.066; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 11b9e666..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0203d400033bf67fff3bf60c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 71b9cb14..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0203d400020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index d0e1c863..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "counter_reading": 15350, - "measurement_interval": 0.999969482421875, - "frequency": 15350.468459120457, - "weight": -47.5066896399347, - "elongation": 0.6988257799379214, - "strain": 10.588269392998809, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index fadc1c93..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 1d12fbeb..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-KL66", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-KL66',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/strain-/-weight-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f0: 15383.72,\n k: 46.4859\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'counter_reading',\n displayName: 'Counter reading',\n convert: function (x) { return x[0]; }},\n {name: 'measurement_interval',\n displayName: 'Measurement interval',\n convert: function (x) { return x[1] / 32768; }},\n {name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000; },\n unit: 'g'},\n {name: 'elongation',\n displayName: 'Elongation',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067; },\n unit: 'µm'},\n {name: 'strain',\n displayName: 'Strain',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067 / 0.066; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 5802c70d..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgPUAAM79n//O/YMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 20d7c572..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgPUAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 680e28e7..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "counter_reading": 15350, - "measurement_interval": 0.999969482421875, - "frequency": 15350.468459120457, - "weight": -47.5066896399347, - "elongation": 0.6988257799379214, - "strain": 10.588269392998809, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 9a79a3ae..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 6078f59a..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-KL66", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-KL66',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/strain-/-weight-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n f0: 15383.72,\n k: 46.4859\n },\n SENSORS: [\n {length: 3,\n values: [{name: 'counter_reading',\n displayName: 'Counter reading',\n convert: function (x) { return x[0]; }},\n {name: 'measurement_interval',\n displayName: 'Measurement interval',\n convert: function (x) { return x[1] / 32768; }},\n {name: 'frequency',\n displayName: 'Frequency',\n convert: function (x) { return x[0] / x[1] * 32768; },\n unit: 'Hz'},\n {name: 'weight',\n displayName: 'Weight',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000; },\n unit: 'g'},\n {name: 'elongation',\n displayName: 'Elongation',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067; },\n unit: 'µm'},\n {name: 'strain',\n displayName: 'Strain',\n convert: function (x) { return (Math.pow(x[0] / x[1] * 32768, 2) - Math.pow(this.PARAMETERS.f0, 2)) * this.PARAMETERS.k / 1000000 * (-1.5) / 1000 * 9.8067 / 0.066; },\n unit: 'µm⋅m⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 5802c70d..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgPUAAM79n//O/YMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 20d7c572..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgPUAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 680e28e7..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "counter_reading": 15350, - "measurement_interval": 0.999969482421875, - "frequency": 15350.468459120457, - "weight": -47.5066896399347, - "elongation": 0.6988257799379214, - "strain": 10.588269392998809, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 9a79a3ae..00000000 --- a/VENDORS/Decentlab/DL-KL66/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "980", - "deviceType": "DL-KL66", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/info.json b/VENDORS/Decentlab/DL-KL66/info.json deleted file mode 100644 index 76854024..00000000 --- a/VENDORS/Decentlab/DL-KL66/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/strain-/-weight-sensor-for-lorawan", - "description": "The Decentlab DL-KL66 is equipped with a vibrating wire that works as a strain/ weight sensor for measuring strain and weight. Suitable for monitoring silo fill level, structural health, weighing, component deformation and strain, and cracks." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-KL66/photo.png b/VENDORS/Decentlab/DL-KL66/photo.png deleted file mode 100644 index 17ede7fd..00000000 Binary files a/VENDORS/Decentlab/DL-KL66/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/converter.json deleted file mode 100644 index 4a94bacb..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-LID", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LID',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/laser-distance-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 11,\n values: [{name: 'distance_average',\n displayName: 'Distance: average',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'distance_minimum',\n displayName: 'Distance: minimum',\n convert: function (x) { return x[1]; },\n unit: 'mm'},\n {name: 'distance_maximum',\n displayName: 'Distance: maximum',\n convert: function (x) { return x[2]; },\n unit: 'mm'},\n {name: 'distance_median',\n displayName: 'Distance: median',\n convert: function (x) { return x[3]; },\n unit: 'mm'},\n {name: 'distance_10th_percentile',\n displayName: 'Distance: 10th percentile',\n convert: function (x) { return x[4]; },\n unit: 'mm'},\n {name: 'distance_25th_percentile',\n displayName: 'Distance: 25th percentile',\n convert: function (x) { return x[5]; },\n unit: 'mm'},\n {name: 'distance_75th_percentile',\n displayName: 'Distance: 75th percentile',\n convert: function (x) { return x[6]; },\n unit: 'mm'},\n {name: 'distance_90th_percentile',\n displayName: 'Distance: 90th percentile',\n convert: function (x) { return x[7]; },\n unit: 'mm'},\n {name: 'distance_most_frequent_value',\n displayName: 'Distance: most frequent value',\n convert: function (x) { return x[8]; },\n unit: 'mm'},\n {name: 'number_of_samples',\n displayName: 'Number of samples',\n convert: function (x) { return x[9]; }},\n {name: 'total_acquisition_time',\n displayName: 'Total acquisition time',\n convert: function (x) { return x[10] / 1.024; },\n unit: 'ms'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload.json deleted file mode 100644 index 4c273d0d..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhHJAAMRmxF2EbwRnhGKEZQRqBGoEZQAZAGZCr0=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_01.json deleted file mode 100644 index a35fb7b0..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhHJAAIKvQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 27d684d6..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhHJAAMRmxF2EbwRnhGKEZQRqBGoEZQAZAGZCr0=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_03.json deleted file mode 100644 index f071b013..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhHJAAIKvQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result.json deleted file mode 100644 index 2c01c1eb..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "distance_average": 4507, - "distance_minimum": 4470, - "distance_maximum": 4540, - "distance_median": 4510, - "distance_10th_percentile": 4490, - "distance_25th_percentile": 4500, - "distance_75th_percentile": 4520, - "distance_90th_percentile": 4520, - "distance_most_frequent_value": 4500, - "number_of_samples": 100, - "total_acquisition_time": 399.4140625, - "battery_voltage": 2.749, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_01.json deleted file mode 100644 index 6f658cd9..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.749, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_02.json deleted file mode 100644 index 0daa7eea..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "distance_average": 4507, - "distance_minimum": 4470, - "distance_maximum": 4540, - "distance_median": 4510, - "distance_10th_percentile": 4490, - "distance_25th_percentile": 4500, - "distance_75th_percentile": 4520, - "distance_90th_percentile": 4520, - "distance_most_frequent_value": 4500, - "number_of_samples": 100, - "total_acquisition_time": 399.4140625, - "battery_voltage": 2.749, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_03.json deleted file mode 100644 index d6ef3005..00000000 --- a/VENDORS/Decentlab/DL-LID/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.749, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-LID/LORIOT/uplink/converter.json deleted file mode 100644 index 9d255c54..00000000 --- a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-LID", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LID',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/laser-distance-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 11,\n values: [{name: 'distance_average',\n displayName: 'Distance: average',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'distance_minimum',\n displayName: 'Distance: minimum',\n convert: function (x) { return x[1]; },\n unit: 'mm'},\n {name: 'distance_maximum',\n displayName: 'Distance: maximum',\n convert: function (x) { return x[2]; },\n unit: 'mm'},\n {name: 'distance_median',\n displayName: 'Distance: median',\n convert: function (x) { return x[3]; },\n unit: 'mm'},\n {name: 'distance_10th_percentile',\n displayName: 'Distance: 10th percentile',\n convert: function (x) { return x[4]; },\n unit: 'mm'},\n {name: 'distance_25th_percentile',\n displayName: 'Distance: 25th percentile',\n convert: function (x) { return x[5]; },\n unit: 'mm'},\n {name: 'distance_75th_percentile',\n displayName: 'Distance: 75th percentile',\n convert: function (x) { return x[6]; },\n unit: 'mm'},\n {name: 'distance_90th_percentile',\n displayName: 'Distance: 90th percentile',\n convert: function (x) { return x[7]; },\n unit: 'mm'},\n {name: 'distance_most_frequent_value',\n displayName: 'Distance: most frequent value',\n convert: function (x) { return x[8]; },\n unit: 'mm'},\n {name: 'number_of_samples',\n displayName: 'Number of samples',\n convert: function (x) { return x[9]; }},\n {name: 'total_acquisition_time',\n displayName: 'Total acquisition time',\n convert: function (x) { return x[10] / 1.024; },\n unit: 'ms'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-LID/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-LID/LORIOT/uplink/payload.json deleted file mode 100644 index 39bef131..00000000 --- a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0211c90003119b117611bc119e118a119411a811a81194006401990abd" -} diff --git a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-LID/LORIOT/uplink/payload_01.json deleted file mode 100644 index c6a1ec25..00000000 --- a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0211c900020abd" -} diff --git a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-LID/LORIOT/uplink/result.json deleted file mode 100644 index 0b70981d..00000000 --- a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "distance_average": 4507, - "distance_minimum": 4470, - "distance_maximum": 4540, - "distance_median": 4510, - "distance_10th_percentile": 4490, - "distance_25th_percentile": 4500, - "distance_75th_percentile": 4520, - "distance_90th_percentile": 4520, - "distance_most_frequent_value": 4500, - "number_of_samples": 100, - "total_acquisition_time": 399.4140625, - "battery_voltage": 2.749, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-LID/LORIOT/uplink/result_01.json deleted file mode 100644 index a1ca0e3b..00000000 --- a/VENDORS/Decentlab/DL-LID/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.749, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-LID/ThingPark/uplink/converter.json deleted file mode 100644 index bc2b6adc..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-LID", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LID',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/laser-distance-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 11,\n values: [{name: 'distance_average',\n displayName: 'Distance: average',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'distance_minimum',\n displayName: 'Distance: minimum',\n convert: function (x) { return x[1]; },\n unit: 'mm'},\n {name: 'distance_maximum',\n displayName: 'Distance: maximum',\n convert: function (x) { return x[2]; },\n unit: 'mm'},\n {name: 'distance_median',\n displayName: 'Distance: median',\n convert: function (x) { return x[3]; },\n unit: 'mm'},\n {name: 'distance_10th_percentile',\n displayName: 'Distance: 10th percentile',\n convert: function (x) { return x[4]; },\n unit: 'mm'},\n {name: 'distance_25th_percentile',\n displayName: 'Distance: 25th percentile',\n convert: function (x) { return x[5]; },\n unit: 'mm'},\n {name: 'distance_75th_percentile',\n displayName: 'Distance: 75th percentile',\n convert: function (x) { return x[6]; },\n unit: 'mm'},\n {name: 'distance_90th_percentile',\n displayName: 'Distance: 90th percentile',\n convert: function (x) { return x[7]; },\n unit: 'mm'},\n {name: 'distance_most_frequent_value',\n displayName: 'Distance: most frequent value',\n convert: function (x) { return x[8]; },\n unit: 'mm'},\n {name: 'number_of_samples',\n displayName: 'Number of samples',\n convert: function (x) { return x[9]; }},\n {name: 'total_acquisition_time',\n displayName: 'Total acquisition time',\n convert: function (x) { return x[10] / 1.024; },\n unit: 'ms'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-LID/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-LID/ThingPark/uplink/payload.json deleted file mode 100644 index c555b268..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211c90003119b117611bc119e118a119411a811a81194006401990abd", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-LID/ThingPark/uplink/payload_01.json deleted file mode 100644 index d6240ef9..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211c900020abd", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-LID/ThingPark/uplink/result.json deleted file mode 100644 index f8c4c065..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "distance_average": 4507, - "distance_minimum": 4470, - "distance_maximum": 4540, - "distance_median": 4510, - "distance_10th_percentile": 4490, - "distance_25th_percentile": 4500, - "distance_75th_percentile": 4520, - "distance_90th_percentile": 4520, - "distance_most_frequent_value": 4500, - "number_of_samples": 100, - "total_acquisition_time": 399.4140625, - "battery_voltage": 2.749, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-LID/ThingPark/uplink/result_01.json deleted file mode 100644 index 60f4cd7e..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.749, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 881094b1..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-LID", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LID',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/laser-distance-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 11,\n values: [{name: 'distance_average',\n displayName: 'Distance: average',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'distance_minimum',\n displayName: 'Distance: minimum',\n convert: function (x) { return x[1]; },\n unit: 'mm'},\n {name: 'distance_maximum',\n displayName: 'Distance: maximum',\n convert: function (x) { return x[2]; },\n unit: 'mm'},\n {name: 'distance_median',\n displayName: 'Distance: median',\n convert: function (x) { return x[3]; },\n unit: 'mm'},\n {name: 'distance_10th_percentile',\n displayName: 'Distance: 10th percentile',\n convert: function (x) { return x[4]; },\n unit: 'mm'},\n {name: 'distance_25th_percentile',\n displayName: 'Distance: 25th percentile',\n convert: function (x) { return x[5]; },\n unit: 'mm'},\n {name: 'distance_75th_percentile',\n displayName: 'Distance: 75th percentile',\n convert: function (x) { return x[6]; },\n unit: 'mm'},\n {name: 'distance_90th_percentile',\n displayName: 'Distance: 90th percentile',\n convert: function (x) { return x[7]; },\n unit: 'mm'},\n {name: 'distance_most_frequent_value',\n displayName: 'Distance: most frequent value',\n convert: function (x) { return x[8]; },\n unit: 'mm'},\n {name: 'number_of_samples',\n displayName: 'Number of samples',\n convert: function (x) { return x[9]; }},\n {name: 'total_acquisition_time',\n displayName: 'Total acquisition time',\n convert: function (x) { return x[10] / 1.024; },\n unit: 'ms'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index c555b268..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211c90003119b117611bc119e118a119411a811a81194006401990abd", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index d6240ef9..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211c900020abd", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index f8c4c065..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "distance_average": 4507, - "distance_minimum": 4470, - "distance_maximum": 4540, - "distance_median": 4510, - "distance_10th_percentile": 4490, - "distance_25th_percentile": 4500, - "distance_75th_percentile": 4520, - "distance_90th_percentile": 4520, - "distance_most_frequent_value": 4500, - "number_of_samples": 100, - "total_acquisition_time": 399.4140625, - "battery_voltage": 2.749, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 60f4cd7e..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.749, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 63626037..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-LID", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LID',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/laser-distance-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 11,\n values: [{name: 'distance_average',\n displayName: 'Distance: average',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'distance_minimum',\n displayName: 'Distance: minimum',\n convert: function (x) { return x[1]; },\n unit: 'mm'},\n {name: 'distance_maximum',\n displayName: 'Distance: maximum',\n convert: function (x) { return x[2]; },\n unit: 'mm'},\n {name: 'distance_median',\n displayName: 'Distance: median',\n convert: function (x) { return x[3]; },\n unit: 'mm'},\n {name: 'distance_10th_percentile',\n displayName: 'Distance: 10th percentile',\n convert: function (x) { return x[4]; },\n unit: 'mm'},\n {name: 'distance_25th_percentile',\n displayName: 'Distance: 25th percentile',\n convert: function (x) { return x[5]; },\n unit: 'mm'},\n {name: 'distance_75th_percentile',\n displayName: 'Distance: 75th percentile',\n convert: function (x) { return x[6]; },\n unit: 'mm'},\n {name: 'distance_90th_percentile',\n displayName: 'Distance: 90th percentile',\n convert: function (x) { return x[7]; },\n unit: 'mm'},\n {name: 'distance_most_frequent_value',\n displayName: 'Distance: most frequent value',\n convert: function (x) { return x[8]; },\n unit: 'mm'},\n {name: 'number_of_samples',\n displayName: 'Number of samples',\n convert: function (x) { return x[9]; }},\n {name: 'total_acquisition_time',\n displayName: 'Total acquisition time',\n convert: function (x) { return x[10] / 1.024; },\n unit: 'ms'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 346d4bd9..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhHJAAMRmxF2EbwRnhGKEZQRqBGoEZQAZAGZCr0=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index ed661e66..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhHJAAIKvQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 32d4a3e1..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "distance_average": 4507, - "distance_minimum": 4470, - "distance_maximum": 4540, - "distance_median": 4510, - "distance_10th_percentile": 4490, - "distance_25th_percentile": 4500, - "distance_75th_percentile": 4520, - "distance_90th_percentile": 4520, - "distance_most_frequent_value": 4500, - "number_of_samples": 100, - "total_acquisition_time": 399.4140625, - "battery_voltage": 2.749, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 4d5c0b0c..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.749, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 2a38e60e..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-LID", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LID',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/laser-distance-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 11,\n values: [{name: 'distance_average',\n displayName: 'Distance: average',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'distance_minimum',\n displayName: 'Distance: minimum',\n convert: function (x) { return x[1]; },\n unit: 'mm'},\n {name: 'distance_maximum',\n displayName: 'Distance: maximum',\n convert: function (x) { return x[2]; },\n unit: 'mm'},\n {name: 'distance_median',\n displayName: 'Distance: median',\n convert: function (x) { return x[3]; },\n unit: 'mm'},\n {name: 'distance_10th_percentile',\n displayName: 'Distance: 10th percentile',\n convert: function (x) { return x[4]; },\n unit: 'mm'},\n {name: 'distance_25th_percentile',\n displayName: 'Distance: 25th percentile',\n convert: function (x) { return x[5]; },\n unit: 'mm'},\n {name: 'distance_75th_percentile',\n displayName: 'Distance: 75th percentile',\n convert: function (x) { return x[6]; },\n unit: 'mm'},\n {name: 'distance_90th_percentile',\n displayName: 'Distance: 90th percentile',\n convert: function (x) { return x[7]; },\n unit: 'mm'},\n {name: 'distance_most_frequent_value',\n displayName: 'Distance: most frequent value',\n convert: function (x) { return x[8]; },\n unit: 'mm'},\n {name: 'number_of_samples',\n displayName: 'Number of samples',\n convert: function (x) { return x[9]; }},\n {name: 'total_acquisition_time',\n displayName: 'Total acquisition time',\n convert: function (x) { return x[10] / 1.024; },\n unit: 'ms'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 346d4bd9..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhHJAAMRmxF2EbwRnhGKEZQRqBGoEZQAZAGZCr0=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index ed661e66..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhHJAAIKvQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 32d4a3e1..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "distance_average": 4507, - "distance_minimum": 4470, - "distance_maximum": 4540, - "distance_median": 4510, - "distance_10th_percentile": 4490, - "distance_25th_percentile": 4500, - "distance_75th_percentile": 4520, - "distance_90th_percentile": 4520, - "distance_most_frequent_value": 4500, - "number_of_samples": 100, - "total_acquisition_time": 399.4140625, - "battery_voltage": 2.749, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 4d5c0b0c..00000000 --- a/VENDORS/Decentlab/DL-LID/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4553", - "deviceType": "DL-LID", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.749, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/info.json b/VENDORS/Decentlab/DL-LID/info.json deleted file mode 100644 index da116313..00000000 --- a/VENDORS/Decentlab/DL-LID/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/laser-distance-level-sensor-for-lorawan", - "description": "The Decentlab DL-LID is equipped with a distance/level sensor for measuring distance. Suitable for generic ranging and proximity monitoring, snow level monitoring, water level monitoring, and flood monitoring." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LID/photo.png b/VENDORS/Decentlab/DL-LID/photo.png deleted file mode 100644 index d90c7479..00000000 Binary files a/VENDORS/Decentlab/DL-LID/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/converter.json deleted file mode 100644 index 4c796701..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-LP8P", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LP8P',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/co2-temperature-humidity-and-barometric-pressure-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175.72 * x[0] / 65536 - 46.85; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 125 * x[1] / 65536 - 6; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'barometer_temperature',\n displayName: 'Barometer temperature',\n convert: function (x) { return (x[0] - 5000) / 100; },\n unit: '°C'},\n {name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[1] * 2; },\n unit: 'Pa'}]},\n {length: 8,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_concentration_lpf',\n displayName: 'CO2 concentration LPF',\n convert: function (x) { return x[1] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_temperature',\n displayName: 'CO2 sensor temperature',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'capacitor_voltage_1',\n displayName: 'Capacitor voltage 1',\n convert: function (x) { return x[3] / 1000; },\n unit: 'V'},\n {name: 'capacitor_voltage_2',\n displayName: 'Capacitor voltage 2',\n convert: function (x) { return x[4] / 1000; },\n unit: 'V'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[5]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[6]; }},\n {name: 'raw_ir_reading_lpf',\n displayName: 'Raw IR reading LPF',\n convert: function (x) { return x[7]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload.json deleted file mode 100644 index 2b810545..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgV4AA9nvWGNHO29EIHZgfSJWwvYC7UAAJWYlTkMJQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 9db23683..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgV4AAtnvWGNHO29EAwl", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 0599e11a..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgV4AAgMJQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 967508b3..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgV4AA9nvWGNHO29EIHZgfSJWwvYC7UAAJWYlTkMJQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_04.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_04.json deleted file mode 100644 index 0bec816b..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_04.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgV4AAtnvWGNHO29EAwl", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_05.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_05.json deleted file mode 100644 index 8911b753..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/payload_05.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgV4AAgMJQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result.json deleted file mode 100644 index 98af8e79..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "co2_concentration": 473, - "co2_concentration_lpf": 500, - "co2_sensor_temperature": 23.95, - "capacitor_voltage_1": 3.032, - "capacitor_voltage_2": 2.997, - "co2_sensor_status": 0, - "raw_ir_reading": 38296, - "raw_ir_reading_lpf": 38201, - "battery_voltage": 3.109, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_01.json deleted file mode 100644 index d3782ba3..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "battery_voltage": 3.109, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_02.json deleted file mode 100644 index 178df2e8..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_03.json deleted file mode 100644 index 6451e16d..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "co2_concentration": 473, - "co2_concentration_lpf": 500, - "co2_sensor_temperature": 23.95, - "capacitor_voltage_1": 3.032, - "capacitor_voltage_2": 2.997, - "co2_sensor_status": 0, - "raw_ir_reading": 38296, - "raw_ir_reading_lpf": 38201, - "battery_voltage": 3.109, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_04.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_04.json deleted file mode 100644 index b9e8ab32..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_04.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "battery_voltage": 3.109, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_05.json b/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_05.json deleted file mode 100644 index 13532d5e..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ChirpStack/uplink/result_05.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/converter.json deleted file mode 100644 index 1551a094..00000000 --- a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-LP8P", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LP8P',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/co2-temperature-humidity-and-barometric-pressure-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175.72 * x[0] / 65536 - 46.85; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 125 * x[1] / 65536 - 6; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'barometer_temperature',\n displayName: 'Barometer temperature',\n convert: function (x) { return (x[0] - 5000) / 100; },\n unit: '°C'},\n {name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[1] * 2; },\n unit: 'Pa'}]},\n {length: 8,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_concentration_lpf',\n displayName: 'CO2 concentration LPF',\n convert: function (x) { return x[1] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_temperature',\n displayName: 'CO2 sensor temperature',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'capacitor_voltage_1',\n displayName: 'Capacitor voltage 1',\n convert: function (x) { return x[3] / 1000; },\n unit: 'V'},\n {name: 'capacitor_voltage_2',\n displayName: 'Capacitor voltage 2',\n convert: function (x) { return x[4] / 1000; },\n unit: 'V'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[5]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[6]; }},\n {name: 'raw_ir_reading_lpf',\n displayName: 'Raw IR reading LPF',\n convert: function (x) { return x[7]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload.json deleted file mode 100644 index cd7cdda0..00000000 --- a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020578000f67bd618d1cedbd1081d981f4895b0bd80bb50000959895390c25" -} diff --git a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload_01.json deleted file mode 100644 index 043af722..00000000 --- a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020578000b67bd618d1cedbd100c25" -} diff --git a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload_02.json b/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload_02.json deleted file mode 100644 index f825af90..00000000 --- a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/payload_02.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02057800080c25" -} diff --git a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result.json deleted file mode 100644 index d1f9b672..00000000 --- a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "co2_concentration": 473, - "co2_concentration_lpf": 500, - "co2_sensor_temperature": 23.95, - "capacitor_voltage_1": 3.032, - "capacitor_voltage_2": 2.997, - "co2_sensor_status": 0, - "raw_ir_reading": 38296, - "raw_ir_reading_lpf": 38201, - "battery_voltage": 3.109, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result_01.json deleted file mode 100644 index 0f9e4fa6..00000000 --- a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "battery_voltage": 3.109, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result_02.json b/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result_02.json deleted file mode 100644 index 34e8d787..00000000 --- a/VENDORS/Decentlab/DL-LP8P/LORIOT/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/converter.json deleted file mode 100644 index 778e6750..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-LP8P", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LP8P',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/co2-temperature-humidity-and-barometric-pressure-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175.72 * x[0] / 65536 - 46.85; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 125 * x[1] / 65536 - 6; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'barometer_temperature',\n displayName: 'Barometer temperature',\n convert: function (x) { return (x[0] - 5000) / 100; },\n unit: '°C'},\n {name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[1] * 2; },\n unit: 'Pa'}]},\n {length: 8,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_concentration_lpf',\n displayName: 'CO2 concentration LPF',\n convert: function (x) { return x[1] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_temperature',\n displayName: 'CO2 sensor temperature',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'capacitor_voltage_1',\n displayName: 'Capacitor voltage 1',\n convert: function (x) { return x[3] / 1000; },\n unit: 'V'},\n {name: 'capacitor_voltage_2',\n displayName: 'Capacitor voltage 2',\n convert: function (x) { return x[4] / 1000; },\n unit: 'V'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[5]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[6]; }},\n {name: 'raw_ir_reading_lpf',\n displayName: 'Raw IR reading LPF',\n convert: function (x) { return x[7]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload.json deleted file mode 100644 index ec7cea66..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020578000f67bd618d1cedbd1081d981f4895b0bd80bb50000959895390c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload_01.json deleted file mode 100644 index f8f98694..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020578000b67bd618d1cedbd100c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload_02.json b/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload_02.json deleted file mode 100644 index e1e3cba1..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/payload_02.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02057800080c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result.json deleted file mode 100644 index e73c4811..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "co2_concentration": 473, - "co2_concentration_lpf": 500, - "co2_sensor_temperature": 23.95, - "capacitor_voltage_1": 3.032, - "capacitor_voltage_2": 2.997, - "co2_sensor_status": 0, - "raw_ir_reading": 38296, - "raw_ir_reading_lpf": 38201, - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result_01.json deleted file mode 100644 index 0aeb0a2f..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result_02.json b/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result_02.json deleted file mode 100644 index f9e75b76..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingPark/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index cd3381e7..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-LP8P", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LP8P',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/co2-temperature-humidity-and-barometric-pressure-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175.72 * x[0] / 65536 - 46.85; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 125 * x[1] / 65536 - 6; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'barometer_temperature',\n displayName: 'Barometer temperature',\n convert: function (x) { return (x[0] - 5000) / 100; },\n unit: '°C'},\n {name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[1] * 2; },\n unit: 'Pa'}]},\n {length: 8,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_concentration_lpf',\n displayName: 'CO2 concentration LPF',\n convert: function (x) { return x[1] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_temperature',\n displayName: 'CO2 sensor temperature',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'capacitor_voltage_1',\n displayName: 'Capacitor voltage 1',\n convert: function (x) { return x[3] / 1000; },\n unit: 'V'},\n {name: 'capacitor_voltage_2',\n displayName: 'Capacitor voltage 2',\n convert: function (x) { return x[4] / 1000; },\n unit: 'V'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[5]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[6]; }},\n {name: 'raw_ir_reading_lpf',\n displayName: 'Raw IR reading LPF',\n convert: function (x) { return x[7]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index ec7cea66..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020578000f67bd618d1cedbd1081d981f4895b0bd80bb50000959895390c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index f8f98694..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020578000b67bd618d1cedbd100c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload_02.json b/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload_02.json deleted file mode 100644 index e1e3cba1..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/payload_02.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02057800080c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index e73c4811..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "co2_concentration": 473, - "co2_concentration_lpf": 500, - "co2_sensor_temperature": 23.95, - "capacitor_voltage_1": 3.032, - "capacitor_voltage_2": 2.997, - "co2_sensor_status": 0, - "raw_ir_reading": 38296, - "raw_ir_reading_lpf": 38201, - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 0aeb0a2f..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result_02.json b/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result_02.json deleted file mode 100644 index f9e75b76..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingParkEnterprise/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 11130d2f..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-LP8P", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LP8P',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/co2-temperature-humidity-and-barometric-pressure-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175.72 * x[0] / 65536 - 46.85; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 125 * x[1] / 65536 - 6; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'barometer_temperature',\n displayName: 'Barometer temperature',\n convert: function (x) { return (x[0] - 5000) / 100; },\n unit: '°C'},\n {name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[1] * 2; },\n unit: 'Pa'}]},\n {length: 8,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_concentration_lpf',\n displayName: 'CO2 concentration LPF',\n convert: function (x) { return x[1] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_temperature',\n displayName: 'CO2 sensor temperature',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'capacitor_voltage_1',\n displayName: 'Capacitor voltage 1',\n convert: function (x) { return x[3] / 1000; },\n unit: 'V'},\n {name: 'capacitor_voltage_2',\n displayName: 'Capacitor voltage 2',\n convert: function (x) { return x[4] / 1000; },\n unit: 'V'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[5]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[6]; }},\n {name: 'raw_ir_reading_lpf',\n displayName: 'Raw IR reading LPF',\n convert: function (x) { return x[7]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 66ecad7c..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgV4AA9nvWGNHO29EIHZgfSJWwvYC7UAAJWYlTkMJQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index aa3c755a..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgV4AAtnvWGNHO29EAwl", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload_02.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload_02.json deleted file mode 100644 index 8f59f25d..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/payload_02.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgV4AAgMJQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index e25f1617..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "co2_concentration": 473, - "co2_concentration_lpf": 500, - "co2_sensor_temperature": 23.95, - "capacitor_voltage_1": 3.032, - "capacitor_voltage_2": 2.997, - "co2_sensor_status": 0, - "raw_ir_reading": 38296, - "raw_ir_reading_lpf": 38201, - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 5245ebe6..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result_02.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result_02.json deleted file mode 100644 index 2cc25110..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackCommunity/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index ca5259dc..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-LP8P", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LP8P',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/co2-temperature-humidity-and-barometric-pressure-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175.72 * x[0] / 65536 - 46.85; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 125 * x[1] / 65536 - 6; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'barometer_temperature',\n displayName: 'Barometer temperature',\n convert: function (x) { return (x[0] - 5000) / 100; },\n unit: '°C'},\n {name: 'barometric_pressure',\n displayName: 'Barometric pressure',\n convert: function (x) { return x[1] * 2; },\n unit: 'Pa'}]},\n {length: 8,\n values: [{name: 'co2_concentration',\n displayName: 'CO2 concentration',\n convert: function (x) { return x[0] - 32768; },\n unit: 'ppm'},\n {name: 'co2_concentration_lpf',\n displayName: 'CO2 concentration LPF',\n convert: function (x) { return x[1] - 32768; },\n unit: 'ppm'},\n {name: 'co2_sensor_temperature',\n displayName: 'CO2 sensor temperature',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'capacitor_voltage_1',\n displayName: 'Capacitor voltage 1',\n convert: function (x) { return x[3] / 1000; },\n unit: 'V'},\n {name: 'capacitor_voltage_2',\n displayName: 'Capacitor voltage 2',\n convert: function (x) { return x[4] / 1000; },\n unit: 'V'},\n {name: 'co2_sensor_status',\n displayName: 'CO2 sensor status',\n convert: function (x) { return x[5]; }},\n {name: 'raw_ir_reading',\n displayName: 'Raw IR reading',\n convert: function (x) { return x[6]; }},\n {name: 'raw_ir_reading_lpf',\n displayName: 'Raw IR reading LPF',\n convert: function (x) { return x[7]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 66ecad7c..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgV4AA9nvWGNHO29EIHZgfSJWwvYC7UAAJWYlTkMJQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index aa3c755a..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgV4AAtnvWGNHO29EAwl", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload_02.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload_02.json deleted file mode 100644 index 8f59f25d..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/payload_02.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgV4AAgMJQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index e25f1617..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "co2_concentration": 473, - "co2_concentration_lpf": 500, - "co2_sensor_temperature": 23.95, - "capacitor_voltage_1": 3.032, - "capacitor_voltage_2": 2.997, - "co2_sensor_status": 0, - "raw_ir_reading": 38296, - "raw_ir_reading_lpf": 38201, - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 5245ebe6..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature": 24.35660461425781, - "air_humidity": 41.63221740722656, - "barometer_temperature": 24.05, - "barometric_pressure": 96800, - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result_02.json b/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result_02.json deleted file mode 100644 index 2cc25110..00000000 --- a/VENDORS/Decentlab/DL-LP8P/ThingsStackIndustries/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "1400", - "deviceType": "DL-LP8P", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/info.json b/VENDORS/Decentlab/DL-LP8P/info.json deleted file mode 100644 index 691e91bd..00000000 --- a/VENDORS/Decentlab/DL-LP8P/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/co2-temperature-humidity-and-barometric-pressure-sensor-for-lorawan", - "description": "The Decentlab DL-LP8P is a LoRaWAN® end device equipped with CO₂, temperature, humidity, and barometric pressure sensors. Suitable for applications such as goods and storage condition monitoring, indoor and outdoor air quality, building automation, energy-saving, and smart agriculture." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LP8P/photo.png b/VENDORS/Decentlab/DL-LP8P/photo.png deleted file mode 100644 index 97db9a91..00000000 Binary files a/VENDORS/Decentlab/DL-LP8P/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/converter.json deleted file mode 100644 index 7ebbdd24..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-LPW", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LPW',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/linear-position-/-way-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1 * 100; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload.json deleted file mode 100644 index 7cd4f67c..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAANAmgCGDFQ=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 4e388114..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAAIMVA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_02.json deleted file mode 100644 index aa604fc2..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAANAmgCGDFQ=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 797b50bd..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAAIMVA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result.json deleted file mode 100644 index f018e14d..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "potentiometer_position": 4.884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_01.json deleted file mode 100644 index da68e961..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_02.json deleted file mode 100644 index 8dbc54b4..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "potentiometer_position": 4.884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_03.json deleted file mode 100644 index 60a77be1..00000000 --- a/VENDORS/Decentlab/DL-LPW/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/converter.json deleted file mode 100644 index 7c2263aa..00000000 --- a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-LPW", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LPW',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/linear-position-/-way-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1 * 100; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/payload.json deleted file mode 100644 index 6aa307ce..00000000 --- a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0211110003409a00860c54" -} diff --git a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/payload_01.json deleted file mode 100644 index b4b6220e..00000000 --- a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02111100020c54" -} diff --git a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/result.json deleted file mode 100644 index 7e224df7..00000000 --- a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "potentiometer_position": 4.884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/result_01.json deleted file mode 100644 index 297fe425..00000000 --- a/VENDORS/Decentlab/DL-LPW/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/converter.json deleted file mode 100644 index 8dbfdaf7..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-LPW", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LPW',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/linear-position-/-way-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1 * 100; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/payload.json deleted file mode 100644 index eb142f74..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00860c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/payload_01.json deleted file mode 100644 index 14a91a75..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02111100020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/result.json deleted file mode 100644 index 99153fb2..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "potentiometer_position": 4.884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/result_01.json deleted file mode 100644 index ba24c04f..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 0e242acd..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-LPW", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LPW',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/linear-position-/-way-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1 * 100; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index eb142f74..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00860c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 14a91a75..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02111100020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 99153fb2..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "potentiometer_position": 4.884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index ba24c04f..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 63cf0a22..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-LPW", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LPW',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/linear-position-/-way-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1 * 100; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index ab8d1044..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index b0ea35ca..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index eab1ab8a..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "potentiometer_position": 4.884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index dc7a7e3a..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 7bb6153b..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-LPW", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LPW',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/linear-position-/-way-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'potentiometer_position',\n displayName: 'Potentiometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1 * 100; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index ab8d1044..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index b0ea35ca..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index eab1ab8a..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "potentiometer_position": 4.884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index dc7a7e3a..00000000 --- a/VENDORS/Decentlab/DL-LPW/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LPW", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/info.json b/VENDORS/Decentlab/DL-LPW/info.json deleted file mode 100644 index 54f4cd70..00000000 --- a/VENDORS/Decentlab/DL-LPW/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/linear-position-/-way-for-lorawan", - "description": "The Decentlab DL-LPW is a linear position sensor for LoRaWAN®. Suitable for applications such as crack measurements, displacement monitoring, terrain changes, environmental changes, structural health monitoring, and bearings." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LPW/photo.png b/VENDORS/Decentlab/DL-LPW/photo.png deleted file mode 100644 index b01a83ea..00000000 Binary files a/VENDORS/Decentlab/DL-LPW/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/converter.json deleted file mode 100644 index 9d88567b..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-LWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/leaf-wetness-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'leaf_wetness_index',\n displayName: 'Leaf wetness index',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload.json deleted file mode 100644 index 7cd4f67c..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAANAmgCGDFQ=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 4e388114..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAAIMVA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_02.json deleted file mode 100644 index aa604fc2..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAANAmgCGDFQ=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 797b50bd..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAAIMVA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result.json deleted file mode 100644 index 7c28f11a..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "leaf_wetness_index": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_01.json deleted file mode 100644 index 096665b5..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_02.json deleted file mode 100644 index e59b6bf3..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "leaf_wetness_index": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_03.json deleted file mode 100644 index 288ce2cc..00000000 --- a/VENDORS/Decentlab/DL-LWS/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/converter.json deleted file mode 100644 index 2fab74b3..00000000 --- a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-LWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/leaf-wetness-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'leaf_wetness_index',\n displayName: 'Leaf wetness index',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/payload.json deleted file mode 100644 index 6aa307ce..00000000 --- a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0211110003409a00860c54" -} diff --git a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/payload_01.json deleted file mode 100644 index b4b6220e..00000000 --- a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02111100020c54" -} diff --git a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/result.json deleted file mode 100644 index 86648e17..00000000 --- a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "leaf_wetness_index": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/result_01.json deleted file mode 100644 index 40eed7f1..00000000 --- a/VENDORS/Decentlab/DL-LWS/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/converter.json deleted file mode 100644 index a2436028..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-LWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/leaf-wetness-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'leaf_wetness_index',\n displayName: 'Leaf wetness index',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/payload.json deleted file mode 100644 index eb142f74..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00860c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/payload_01.json deleted file mode 100644 index 14a91a75..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02111100020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/result.json deleted file mode 100644 index 2da31055..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "leaf_wetness_index": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/result_01.json deleted file mode 100644 index 5f86b576..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 05cc5c95..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-LWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/leaf-wetness-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'leaf_wetness_index',\n displayName: 'Leaf wetness index',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index eb142f74..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00860c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 14a91a75..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02111100020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 2da31055..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "leaf_wetness_index": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 5f86b576..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 9f2a4848..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-LWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/leaf-wetness-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'leaf_wetness_index',\n displayName: 'Leaf wetness index',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index ab8d1044..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index b0ea35ca..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 720d9c6f..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "leaf_wetness_index": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index ce211ab9..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index b8af5c86..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-LWS", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-LWS',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/leaf-wetness-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'leaf_wetness_index',\n displayName: 'Leaf wetness index',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 1; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index ab8d1044..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index b0ea35ca..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 720d9c6f..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "leaf_wetness_index": 0.04884648323059082, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index ce211ab9..00000000 --- a/VENDORS/Decentlab/DL-LWS/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-LWS", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/info.json b/VENDORS/Decentlab/DL-LWS/info.json deleted file mode 100644 index d1c71a01..00000000 --- a/VENDORS/Decentlab/DL-LWS/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/leaf-wetness-sensor-for-lorawan", - "description": "The Decentlab DL-LWS is a LoRaWAN® end device equipped with leaf wetness sensor. Suitable for applications such as outdoor remote monitoring, plant disease and infection prevention, greenhouse and soil-less plantations, and smart agriculture." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-LWS/photo.png b/VENDORS/Decentlab/DL-LWS/photo.png deleted file mode 100644 index 40ad22d5..00000000 Binary files a/VENDORS/Decentlab/DL-LWS/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/converter.json deleted file mode 100644 index 1d84df7c..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-MBX", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MBX',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ultrasonic-distance-/-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'distance',\n displayName: 'Distance',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'number_of_valid_samples',\n displayName: 'Number of valid samples',\n convert: function (x) { return x[1]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload.json deleted file mode 100644 index 7fbaa0ed..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgEvAAME0gABC7E=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 07231516..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgEvAAILsQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 59f9de7b..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgEvAAME0gABC7E=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_03.json deleted file mode 100644 index cd9d272f..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgEvAAILsQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result.json deleted file mode 100644 index 584fc8bd..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "distance": 1234, - "number_of_valid_samples": 1, - "battery_voltage": 2.993, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_01.json deleted file mode 100644 index 81d6f075..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.993, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_02.json deleted file mode 100644 index e05a6973..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "distance": 1234, - "number_of_valid_samples": 1, - "battery_voltage": 2.993, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_03.json deleted file mode 100644 index edb33616..00000000 --- a/VENDORS/Decentlab/DL-MBX/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.993, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/converter.json deleted file mode 100644 index 1421129c..00000000 --- a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-MBX", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MBX',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ultrasonic-distance-/-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'distance',\n displayName: 'Distance',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'number_of_valid_samples',\n displayName: 'Number of valid samples',\n convert: function (x) { return x[1]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/payload.json deleted file mode 100644 index 3b4daa37..00000000 --- a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02012f000304d200010bb1" -} diff --git a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/payload_01.json deleted file mode 100644 index 54256b5d..00000000 --- a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02012f00020bb1" -} diff --git a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/result.json deleted file mode 100644 index 15504235..00000000 --- a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "distance": 1234, - "number_of_valid_samples": 1, - "battery_voltage": 2.993, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/result_01.json deleted file mode 100644 index 47a2a3d7..00000000 --- a/VENDORS/Decentlab/DL-MBX/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.993, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/converter.json deleted file mode 100644 index b316e413..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-MBX", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MBX',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ultrasonic-distance-/-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'distance',\n displayName: 'Distance',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'number_of_valid_samples',\n displayName: 'Number of valid samples',\n convert: function (x) { return x[1]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/payload.json deleted file mode 100644 index 2946edcb..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02012f000304d200010bb1", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/payload_01.json deleted file mode 100644 index 8c36bf80..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02012f00020bb1", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/result.json deleted file mode 100644 index 3f42f971..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "distance": 1234, - "number_of_valid_samples": 1, - "battery_voltage": 2.993, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/result_01.json deleted file mode 100644 index ba654db3..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.993, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 311473b0..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-MBX", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MBX',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ultrasonic-distance-/-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'distance',\n displayName: 'Distance',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'number_of_valid_samples',\n displayName: 'Number of valid samples',\n convert: function (x) { return x[1]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 2946edcb..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02012f000304d200010bb1", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 8c36bf80..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02012f00020bb1", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 3f42f971..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "distance": 1234, - "number_of_valid_samples": 1, - "battery_voltage": 2.993, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index ba654db3..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.993, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index f200d409..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-MBX", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MBX',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ultrasonic-distance-/-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'distance',\n displayName: 'Distance',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'number_of_valid_samples',\n displayName: 'Number of valid samples',\n convert: function (x) { return x[1]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 89c73224..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgEvAAME0gABC7E=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index cbcb6e0c..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgEvAAILsQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index a7878177..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "distance": 1234, - "number_of_valid_samples": 1, - "battery_voltage": 2.993, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index d10f2635..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.993, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index dcb31c3a..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-MBX", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MBX',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ultrasonic-distance-/-level-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'distance',\n displayName: 'Distance',\n convert: function (x) { return x[0]; },\n unit: 'mm'},\n {name: 'number_of_valid_samples',\n displayName: 'Number of valid samples',\n convert: function (x) { return x[1]; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 89c73224..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgEvAAME0gABC7E=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index cbcb6e0c..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgEvAAILsQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index a7878177..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "distance": 1234, - "number_of_valid_samples": 1, - "battery_voltage": 2.993, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index d10f2635..00000000 --- a/VENDORS/Decentlab/DL-MBX/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "303", - "deviceType": "DL-MBX", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.993, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/info.json b/VENDORS/Decentlab/DL-MBX/info.json deleted file mode 100644 index f9d2ff07..00000000 --- a/VENDORS/Decentlab/DL-MBX/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/ultrasonic-distance-/-level-sensor-for-lorawan", - "description": "The Decentlab DL-MBX is equipped with an ultrasonic distance/level sensor for measuring distance. Suitable for monitoring water level, flood, snow level, silo level, etc." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MBX/photo.png b/VENDORS/Decentlab/DL-MBX/photo.png deleted file mode 100644 index 31b80684..00000000 Binary files a/VENDORS/Decentlab/DL-MBX/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/converter.json deleted file mode 100644 index 288b7586..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-MES5", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MES5',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/large-range-optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'sludge_blanket',\n displayName: 'Sludge blanket',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'suspended_solid',\n displayName: 'Suspended solid',\n convert: function (x) { return x[3] / 100; },\n unit: 'g⋅L⁻¹'},\n {name: 'turbidity',\n displayName: 'Turbidity',\n convert: function (x) { return x[4] / 10; },\n unit: 'FAU'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload.json deleted file mode 100644 index ff4b2102..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Ak4DAAMAAIjmIQgA8iNlCvU=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 5018904f..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Ak4DAAIK9Q==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 29a259c2..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Ak4DAAMAAIjmIQgA8iNlCvU=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_03.json deleted file mode 100644 index b1ec5ede..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Ak4DAAIK9Q==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result.json deleted file mode 100644 index a4e97f63..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "status": 0, - "temperature": 22.78, - "sludge_blanket": 84.56, - "suspended_solid": 2.42, - "turbidity": 906.1, - "battery_voltage": 2.805, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_01.json deleted file mode 100644 index 084033c4..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.805, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_02.json deleted file mode 100644 index f597cad8..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "status": 0, - "temperature": 22.78, - "sludge_blanket": 84.56, - "suspended_solid": 2.42, - "turbidity": 906.1, - "battery_voltage": 2.805, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_03.json deleted file mode 100644 index 5b7bfea3..00000000 --- a/VENDORS/Decentlab/DL-MES5/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.805, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/converter.json deleted file mode 100644 index 371ed5a5..00000000 --- a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-MES5", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MES5',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/large-range-optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'sludge_blanket',\n displayName: 'Sludge blanket',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'suspended_solid',\n displayName: 'Suspended solid',\n convert: function (x) { return x[3] / 100; },\n unit: 'g⋅L⁻¹'},\n {name: 'turbidity',\n displayName: 'Turbidity',\n convert: function (x) { return x[4] / 10; },\n unit: 'FAU'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/payload.json deleted file mode 100644 index 8c8a64cd..00000000 --- a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "024E030003000088e6210800f223650af5" -} diff --git a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/payload_01.json deleted file mode 100644 index 95e562a2..00000000 --- a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "024E0300020af5" -} diff --git a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/result.json deleted file mode 100644 index cf326d5c..00000000 --- a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "status": 0, - "temperature": 22.78, - "sludge_blanket": 84.56, - "suspended_solid": 2.42, - "turbidity": 906.1, - "battery_voltage": 2.805, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/result_01.json deleted file mode 100644 index 78f58a30..00000000 --- a/VENDORS/Decentlab/DL-MES5/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.805, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/converter.json deleted file mode 100644 index c24aad24..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-MES5", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MES5',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/large-range-optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'sludge_blanket',\n displayName: 'Sludge blanket',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'suspended_solid',\n displayName: 'Suspended solid',\n convert: function (x) { return x[3] / 100; },\n unit: 'g⋅L⁻¹'},\n {name: 'turbidity',\n displayName: 'Turbidity',\n convert: function (x) { return x[4] / 10; },\n unit: 'FAU'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/payload.json deleted file mode 100644 index 1390a88e..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "024E030003000088e6210800f223650af5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/payload_01.json deleted file mode 100644 index 77875bf7..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "024E0300020af5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/result.json deleted file mode 100644 index ee28813b..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "status": 0, - "temperature": 22.78, - "sludge_blanket": 84.56, - "suspended_solid": 2.42, - "turbidity": 906.1, - "battery_voltage": 2.805, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/result_01.json deleted file mode 100644 index 7853c96a..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.805, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index d0a9553a..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-MES5", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MES5',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/large-range-optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'sludge_blanket',\n displayName: 'Sludge blanket',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'suspended_solid',\n displayName: 'Suspended solid',\n convert: function (x) { return x[3] / 100; },\n unit: 'g⋅L⁻¹'},\n {name: 'turbidity',\n displayName: 'Turbidity',\n convert: function (x) { return x[4] / 10; },\n unit: 'FAU'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 1390a88e..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "024E030003000088e6210800f223650af5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 77875bf7..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "024E0300020af5", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index ee28813b..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "status": 0, - "temperature": 22.78, - "sludge_blanket": 84.56, - "suspended_solid": 2.42, - "turbidity": 906.1, - "battery_voltage": 2.805, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 7853c96a..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.805, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 9d6877ea..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-MES5", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MES5',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/large-range-optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'sludge_blanket',\n displayName: 'Sludge blanket',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'suspended_solid',\n displayName: 'Suspended solid',\n convert: function (x) { return x[3] / 100; },\n unit: 'g⋅L⁻¹'},\n {name: 'turbidity',\n displayName: 'Turbidity',\n convert: function (x) { return x[4] / 10; },\n unit: 'FAU'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index ff9e5820..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Ak4DAAMAAIjmIQgA8iNlCvU=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 265fd7fb..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Ak4DAAIK9Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 0835aa5b..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "status": 0, - "temperature": 22.78, - "sludge_blanket": 84.56, - "suspended_solid": 2.42, - "turbidity": 906.1, - "battery_voltage": 2.805, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 1759493e..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.805, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 6df5b212..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-MES5", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-MES5',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/large-range-optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'sludge_blanket',\n displayName: 'Sludge blanket',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'suspended_solid',\n displayName: 'Suspended solid',\n convert: function (x) { return x[3] / 100; },\n unit: 'g⋅L⁻¹'},\n {name: 'turbidity',\n displayName: 'Turbidity',\n convert: function (x) { return x[4] / 10; },\n unit: 'FAU'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index ff9e5820..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Ak4DAAMAAIjmIQgA8iNlCvU=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 265fd7fb..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Ak4DAAIK9Q==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 0835aa5b..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "status": 0, - "temperature": 22.78, - "sludge_blanket": 84.56, - "suspended_solid": 2.42, - "turbidity": 906.1, - "battery_voltage": 2.805, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 1759493e..00000000 --- a/VENDORS/Decentlab/DL-MES5/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "19971", - "deviceType": "DL-MES5", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.805, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/info.json b/VENDORS/Decentlab/DL-MES5/info.json deleted file mode 100644 index a9b088d8..00000000 --- a/VENDORS/Decentlab/DL-MES5/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/large-range-optical-turbidity-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-MES5 is an optical turbidity sensor for LoRaWAN®. Suitable for applications such as urban waste water treatment, treatment of industrial effluents, sludge treatment, and dredging site." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-MES5/photo.png b/VENDORS/Decentlab/DL-MES5/photo.png deleted file mode 100644 index 56f653a5..00000000 Binary files a/VENDORS/Decentlab/DL-MES5/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/converter.json deleted file mode 100644 index 14674a76..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-NTU", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-NTU',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'turbidity_in_ntu',\n displayName: 'Turbidity in NTU',\n convert: function (x) { return x[2] / 10; },\n unit: 'NTU'},\n {name: 'turbidity_in_fnu',\n displayName: 'Turbidity in FNU',\n convert: function (x) { return x[3] / 10; },\n unit: 'FNU'},\n {name: 'turbidity_in_mg_l',\n displayName: 'Turbidity in mg/L',\n convert: function (x) { return x[4] / 10; },\n unit: 'mg⋅L⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload.json deleted file mode 100644 index ebd2584c..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AiMyAAMAAIiFAT4BPgIzCxA=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_01.json deleted file mode 100644 index e4b07a5e..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AiMyAAILEA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_02.json deleted file mode 100644 index d5c839ce..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AiMyAAMAAIiFAT4BPgIzCxA=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_03.json deleted file mode 100644 index a40f4435..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AiMyAAILEA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result.json deleted file mode 100644 index bc400534..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "status": 0, - "temperature": 21.81, - "turbidity_in_ntu": 31.8, - "turbidity_in_fnu": 31.8, - "turbidity_in_mg_l": 56.3, - "battery_voltage": 2.832, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_01.json deleted file mode 100644 index 7f6ac88e..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.832, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_02.json deleted file mode 100644 index bd500b6c..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "status": 0, - "temperature": 21.81, - "turbidity_in_ntu": 31.8, - "turbidity_in_fnu": 31.8, - "turbidity_in_mg_l": 56.3, - "battery_voltage": 2.832, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_03.json deleted file mode 100644 index c13ff69a..00000000 --- a/VENDORS/Decentlab/DL-NTU/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.832, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/converter.json deleted file mode 100644 index 46b8b140..00000000 --- a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-NTU", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-NTU',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'turbidity_in_ntu',\n displayName: 'Turbidity in NTU',\n convert: function (x) { return x[2] / 10; },\n unit: 'NTU'},\n {name: 'turbidity_in_fnu',\n displayName: 'Turbidity in FNU',\n convert: function (x) { return x[3] / 10; },\n unit: 'FNU'},\n {name: 'turbidity_in_mg_l',\n displayName: 'Turbidity in mg/L',\n convert: function (x) { return x[4] / 10; },\n unit: 'mg⋅L⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/payload.json deleted file mode 100644 index 14f04469..00000000 --- a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "022332000300008885013e013e02330b10" -} diff --git a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/payload_01.json deleted file mode 100644 index 8e2e5df8..00000000 --- a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02233200020b10" -} diff --git a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/result.json deleted file mode 100644 index 7eecb285..00000000 --- a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "status": 0, - "temperature": 21.81, - "turbidity_in_ntu": 31.8, - "turbidity_in_fnu": 31.8, - "turbidity_in_mg_l": 56.3, - "battery_voltage": 2.832, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/result_01.json deleted file mode 100644 index 2c3205f0..00000000 --- a/VENDORS/Decentlab/DL-NTU/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.832, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/converter.json deleted file mode 100644 index 049533fa..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-NTU", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-NTU',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'turbidity_in_ntu',\n displayName: 'Turbidity in NTU',\n convert: function (x) { return x[2] / 10; },\n unit: 'NTU'},\n {name: 'turbidity_in_fnu',\n displayName: 'Turbidity in FNU',\n convert: function (x) { return x[3] / 10; },\n unit: 'FNU'},\n {name: 'turbidity_in_mg_l',\n displayName: 'Turbidity in mg/L',\n convert: function (x) { return x[4] / 10; },\n unit: 'mg⋅L⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/payload.json deleted file mode 100644 index 46744718..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "022332000300008885013e013e02330b10", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/payload_01.json deleted file mode 100644 index 23b686cb..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02233200020b10", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/result.json deleted file mode 100644 index f0687301..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "status": 0, - "temperature": 21.81, - "turbidity_in_ntu": 31.8, - "turbidity_in_fnu": 31.8, - "turbidity_in_mg_l": 56.3, - "battery_voltage": 2.832, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/result_01.json deleted file mode 100644 index c65c3a86..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.832, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 4b3d46c6..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-NTU", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-NTU',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'turbidity_in_ntu',\n displayName: 'Turbidity in NTU',\n convert: function (x) { return x[2] / 10; },\n unit: 'NTU'},\n {name: 'turbidity_in_fnu',\n displayName: 'Turbidity in FNU',\n convert: function (x) { return x[3] / 10; },\n unit: 'FNU'},\n {name: 'turbidity_in_mg_l',\n displayName: 'Turbidity in mg/L',\n convert: function (x) { return x[4] / 10; },\n unit: 'mg⋅L⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 46744718..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "022332000300008885013e013e02330b10", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 23b686cb..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02233200020b10", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index f0687301..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "status": 0, - "temperature": 21.81, - "turbidity_in_ntu": 31.8, - "turbidity_in_fnu": 31.8, - "turbidity_in_mg_l": 56.3, - "battery_voltage": 2.832, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index c65c3a86..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.832, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index d41f6bab..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-NTU", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-NTU',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'turbidity_in_ntu',\n displayName: 'Turbidity in NTU',\n convert: function (x) { return x[2] / 10; },\n unit: 'NTU'},\n {name: 'turbidity_in_fnu',\n displayName: 'Turbidity in FNU',\n convert: function (x) { return x[3] / 10; },\n unit: 'FNU'},\n {name: 'turbidity_in_mg_l',\n displayName: 'Turbidity in mg/L',\n convert: function (x) { return x[4] / 10; },\n unit: 'mg⋅L⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 53798f87..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AiMyAAMAAIiFAT4BPgIzCxA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 6e0a1cc4..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AiMyAAILEA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 10597870..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "status": 0, - "temperature": 21.81, - "turbidity_in_ntu": 31.8, - "turbidity_in_fnu": 31.8, - "turbidity_in_mg_l": 56.3, - "battery_voltage": 2.832, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 4c285f9c..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.832, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 2ccc116f..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-NTU", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-NTU',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-turbidity-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'turbidity_in_ntu',\n displayName: 'Turbidity in NTU',\n convert: function (x) { return x[2] / 10; },\n unit: 'NTU'},\n {name: 'turbidity_in_fnu',\n displayName: 'Turbidity in FNU',\n convert: function (x) { return x[3] / 10; },\n unit: 'FNU'},\n {name: 'turbidity_in_mg_l',\n displayName: 'Turbidity in mg/L',\n convert: function (x) { return x[4] / 10; },\n unit: 'mg⋅L⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 53798f87..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AiMyAAMAAIiFAT4BPgIzCxA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 6e0a1cc4..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AiMyAAILEA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 10597870..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "status": 0, - "temperature": 21.81, - "turbidity_in_ntu": 31.8, - "turbidity_in_fnu": 31.8, - "turbidity_in_mg_l": 56.3, - "battery_voltage": 2.832, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 4c285f9c..00000000 --- a/VENDORS/Decentlab/DL-NTU/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "9010", - "deviceType": "DL-NTU", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.832, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/info.json b/VENDORS/Decentlab/DL-NTU/info.json deleted file mode 100644 index 17a4b56b..00000000 --- a/VENDORS/Decentlab/DL-NTU/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/optical-turbidity-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-NTU is equipped with optical infrared turbidity and temperature sensors for water quality monitoring." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-NTU/photo.png b/VENDORS/Decentlab/DL-NTU/photo.png deleted file mode 100644 index 73092edc..00000000 Binary files a/VENDORS/Decentlab/DL-NTU/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/converter.json deleted file mode 100644 index 80b7f035..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-OPTOD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-OPTOD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-dissolved-oxygen-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'oxygen_saturation',\n displayName: 'Oxygen saturation',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'oxygen_concentration',\n displayName: 'Oxygen concentration',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: 'mg⋅L⁻¹'},\n {name: 'oxygen_concentration_alt',\n displayName: 'Oxygen concentration (alt)',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'ppm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload.json deleted file mode 100644 index 9e61b9f0..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhhsAAMAAIhiphiDZYNlDGA=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 167915e3..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhhsAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 743d7883..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhhsAAMAAIhiphiDZYNlDGA=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_03.json deleted file mode 100644 index ff94e430..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhhsAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result.json deleted file mode 100644 index c54d53ac..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "status": 0, - "temperature": 21.46, - "oxygen_saturation": 97.52, - "oxygen_concentration": 8.69, - "oxygen_concentration_alt": 8.69, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_01.json deleted file mode 100644 index 688c5cd9..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_02.json deleted file mode 100644 index bb9fe8de..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "status": 0, - "temperature": 21.46, - "oxygen_saturation": 97.52, - "oxygen_concentration": 8.69, - "oxygen_concentration_alt": 8.69, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_03.json deleted file mode 100644 index 0e16bfe4..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/converter.json deleted file mode 100644 index 83c31196..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-OPTOD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-OPTOD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-dissolved-oxygen-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'oxygen_saturation',\n displayName: 'Oxygen saturation',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'oxygen_concentration',\n displayName: 'Oxygen concentration',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: 'mg⋅L⁻¹'},\n {name: 'oxygen_concentration_alt',\n displayName: 'Oxygen concentration (alt)',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'ppm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/payload.json deleted file mode 100644 index cdc74ca8..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02186c000300008862a618836583650c60" -} diff --git a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/payload_01.json deleted file mode 100644 index 867891b5..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02186c00020c60" -} diff --git a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/result.json deleted file mode 100644 index 85aaf9f1..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "status": 0, - "temperature": 21.46, - "oxygen_saturation": 97.52, - "oxygen_concentration": 8.69, - "oxygen_concentration_alt": 8.69, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/result_01.json deleted file mode 100644 index aad30d9e..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/converter.json deleted file mode 100644 index 60fd68af..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-OPTOD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-OPTOD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-dissolved-oxygen-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'oxygen_saturation',\n displayName: 'Oxygen saturation',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'oxygen_concentration',\n displayName: 'Oxygen concentration',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: 'mg⋅L⁻¹'},\n {name: 'oxygen_concentration_alt',\n displayName: 'Oxygen concentration (alt)',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'ppm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/payload.json deleted file mode 100644 index 4c955776..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02186c000300008862a618836583650c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/payload_01.json deleted file mode 100644 index c3a4d5e4..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02186c00020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/result.json deleted file mode 100644 index fbad8caa..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "status": 0, - "temperature": 21.46, - "oxygen_saturation": 97.52, - "oxygen_concentration": 8.69, - "oxygen_concentration_alt": 8.69, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/result_01.json deleted file mode 100644 index 05309165..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index ed7d96dd..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-OPTOD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-OPTOD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-dissolved-oxygen-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'oxygen_saturation',\n displayName: 'Oxygen saturation',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'oxygen_concentration',\n displayName: 'Oxygen concentration',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: 'mg⋅L⁻¹'},\n {name: 'oxygen_concentration_alt',\n displayName: 'Oxygen concentration (alt)',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'ppm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 4c955776..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02186c000300008862a618836583650c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index c3a4d5e4..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02186c00020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index fbad8caa..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "status": 0, - "temperature": 21.46, - "oxygen_saturation": 97.52, - "oxygen_concentration": 8.69, - "oxygen_concentration_alt": 8.69, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 05309165..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index ba8a0396..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-OPTOD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-OPTOD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-dissolved-oxygen-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'oxygen_saturation',\n displayName: 'Oxygen saturation',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'oxygen_concentration',\n displayName: 'Oxygen concentration',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: 'mg⋅L⁻¹'},\n {name: 'oxygen_concentration_alt',\n displayName: 'Oxygen concentration (alt)',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'ppm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index bc861676..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhhsAAMAAIhiphiDZYNlDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index d3d6bbc1..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhhsAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 7237a5b7..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "status": 0, - "temperature": 21.46, - "oxygen_saturation": 97.52, - "oxygen_concentration": 8.69, - "oxygen_concentration_alt": 8.69, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 474064cb..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index bdd99164..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-OPTOD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-OPTOD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/optical-dissolved-oxygen-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'oxygen_saturation',\n displayName: 'Oxygen saturation',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'oxygen_concentration',\n displayName: 'Oxygen concentration',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: 'mg⋅L⁻¹'},\n {name: 'oxygen_concentration_alt',\n displayName: 'Oxygen concentration (alt)',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: 'ppm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index bc861676..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhhsAAMAAIhiphiDZYNlDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index d3d6bbc1..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhhsAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 7237a5b7..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "status": 0, - "temperature": 21.46, - "oxygen_saturation": 97.52, - "oxygen_concentration": 8.69, - "oxygen_concentration_alt": 8.69, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 474064cb..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6252", - "deviceType": "DL-OPTOD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/info.json b/VENDORS/Decentlab/DL-OPTOD/info.json deleted file mode 100644 index 2bbe19ac..00000000 --- a/VENDORS/Decentlab/DL-OPTOD/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/optical-dissolved-oxygen-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-OPTOD consists of dissolved oxygen and temperature sensors. It is suitable for use in wastewater treatment, industrial effluent treatment, open water monitoring, fish farming, aquarium, and drinking water monitoring." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-OPTOD/photo.png b/VENDORS/Decentlab/DL-OPTOD/photo.png deleted file mode 100644 index 1765f20f..00000000 Binary files a/VENDORS/Decentlab/DL-OPTOD/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/converter.json deleted file mode 100644 index c853015f..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-PAR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PAR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/photosynthetically-active-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload.json deleted file mode 100644 index fa8b4bf9..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgKRAAOAaQxg", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 220fb668..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgKRAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 91b52a85..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgKRAAOAaQxg", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_03.json deleted file mode 100644 index ad7bb620..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgKRAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result.json deleted file mode 100644 index beb88ec6..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "photosynthetically_active_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_01.json deleted file mode 100644 index 0c8c9b14..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_02.json deleted file mode 100644 index 2dd52cd3..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "photosynthetically_active_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_03.json deleted file mode 100644 index 93c06bd3..00000000 --- a/VENDORS/Decentlab/DL-PAR/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/converter.json deleted file mode 100644 index 453ae721..00000000 --- a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-PAR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PAR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/photosynthetically-active-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/payload.json deleted file mode 100644 index b7c69294..00000000 --- a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020291000380690c60" -} diff --git a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/payload_01.json deleted file mode 100644 index 432b5883..00000000 --- a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02029100020c60" -} diff --git a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/result.json deleted file mode 100644 index 94422e05..00000000 --- a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "photosynthetically_active_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/result_01.json deleted file mode 100644 index f21751b3..00000000 --- a/VENDORS/Decentlab/DL-PAR/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/converter.json deleted file mode 100644 index fe10aafc..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-PAR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PAR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/photosynthetically-active-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/payload.json deleted file mode 100644 index 142f044e..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020291000380690c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/payload_01.json deleted file mode 100644 index 4ac02ee2..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02029100020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/result.json deleted file mode 100644 index 24ebe3e8..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "photosynthetically_active_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/result_01.json deleted file mode 100644 index 96e70b25..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 546889c9..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-PAR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PAR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/photosynthetically-active-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 142f044e..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020291000380690c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 4ac02ee2..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02029100020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 24ebe3e8..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "photosynthetically_active_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 96e70b25..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index d8102e05..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-PAR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PAR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/photosynthetically-active-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 5563daad..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgKRAAOAaQxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 66e0d100..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgKRAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index a0ca1b14..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "photosynthetically_active_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 0ee6fd08..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index b1d569b1..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-PAR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PAR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/photosynthetically-active-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'photosynthetically_active_radiation',\n displayName: 'Photosynthetically active radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'µmol⋅m⁻²⋅s⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 5563daad..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgKRAAOAaQxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 66e0d100..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgKRAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index a0ca1b14..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "photosynthetically_active_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 0ee6fd08..00000000 --- a/VENDORS/Decentlab/DL-PAR/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PAR", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/info.json b/VENDORS/Decentlab/DL-PAR/info.json deleted file mode 100644 index 645f43e7..00000000 --- a/VENDORS/Decentlab/DL-PAR/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/photosynthetically-active-radiation-sensor-for-lorawan", - "description": "The Decentlab DL-PAR consists of a Photosynthetically Active Radiation (PAR) sensor for measuring the amount of light available for photosynthesis. It is suitable for use in outdoor environments, greenhouses, and growth chambers." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PAR/photo.png b/VENDORS/Decentlab/DL-PAR/photo.png deleted file mode 100644 index 0d213ae1..00000000 Binary files a/VENDORS/Decentlab/DL-PAR/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/converter.json deleted file mode 100644 index 682e0db2..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-PHEHT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PHEHT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ph-orp-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'ph',\n displayName: 'pH',\n convert: function (x) { return (x[2] - 32768) / 100; }},\n {name: 'redox',\n displayName: 'Redox',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: 'mV'},\n {name: 'ph_mv',\n displayName: 'pH-mV',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: 'mV'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload.json deleted file mode 100644 index 1ccaef48..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlK4AAMAAIhCgsd/Y3/2DFw=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_01.json deleted file mode 100644 index a89d047f..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AlK4AAIMXA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 2316815b..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlK4AAMAAIhCgsd/Y3/2DFw=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 85e0c962..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AlK4AAIMXA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result.json deleted file mode 100644 index 02ca9563..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "status": 0, - "temperature": 21.14, - "ph": 7.11, - "redox": -15.7, - "ph_mv": -1, - "battery_voltage": 3.164, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_01.json deleted file mode 100644 index 4bee0985..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.164, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_02.json deleted file mode 100644 index 6234a665..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "status": 0, - "temperature": 21.14, - "ph": 7.11, - "redox": -15.7, - "ph_mv": -1, - "battery_voltage": 3.164, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_03.json deleted file mode 100644 index f7bb6cfa..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.164, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/converter.json deleted file mode 100644 index 9eeda5de..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-PHEHT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PHEHT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ph-orp-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'ph',\n displayName: 'pH',\n convert: function (x) { return (x[2] - 32768) / 100; }},\n {name: 'redox',\n displayName: 'Redox',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: 'mV'},\n {name: 'ph_mv',\n displayName: 'pH-mV',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: 'mV'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/payload.json deleted file mode 100644 index c1161d05..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0252b800030000884282c77f637ff60c5c" -} diff --git a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/payload_01.json deleted file mode 100644 index 6a03bf48..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0252b800020c5c" -} diff --git a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/result.json deleted file mode 100644 index 70f0c537..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "status": 0, - "temperature": 21.14, - "ph": 7.11, - "redox": -15.7, - "ph_mv": -1, - "battery_voltage": 3.164, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/result_01.json deleted file mode 100644 index 1331835b..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.164, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/converter.json deleted file mode 100644 index 1124b74b..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-PHEHT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PHEHT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ph-orp-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'ph',\n displayName: 'pH',\n convert: function (x) { return (x[2] - 32768) / 100; }},\n {name: 'redox',\n displayName: 'Redox',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: 'mV'},\n {name: 'ph_mv',\n displayName: 'pH-mV',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: 'mV'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/payload.json deleted file mode 100644 index b4143ac8..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0252b800030000884282c77f637ff60c5c", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/payload_01.json deleted file mode 100644 index 6c241d09..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0252b800020c5c", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/result.json deleted file mode 100644 index 650b212f..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "status": 0, - "temperature": 21.14, - "ph": 7.11, - "redox": -15.7, - "ph_mv": -1, - "battery_voltage": 3.164, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/result_01.json deleted file mode 100644 index c16c5322..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.164, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 167a39f0..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-PHEHT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PHEHT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ph-orp-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'ph',\n displayName: 'pH',\n convert: function (x) { return (x[2] - 32768) / 100; }},\n {name: 'redox',\n displayName: 'Redox',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: 'mV'},\n {name: 'ph_mv',\n displayName: 'pH-mV',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: 'mV'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index b4143ac8..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0252b800030000884282c77f637ff60c5c", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 6c241d09..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0252b800020c5c", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 650b212f..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "status": 0, - "temperature": 21.14, - "ph": 7.11, - "redox": -15.7, - "ph_mv": -1, - "battery_voltage": 3.164, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index c16c5322..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.164, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index f78f8976..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-PHEHT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PHEHT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ph-orp-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'ph',\n displayName: 'pH',\n convert: function (x) { return (x[2] - 32768) / 100; }},\n {name: 'redox',\n displayName: 'Redox',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: 'mV'},\n {name: 'ph_mv',\n displayName: 'pH-mV',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: 'mV'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index d5b7bdad..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlK4AAMAAIhCgsd/Y3/2DFw=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 676e5c58..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlK4AAIMXA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index aca01a75..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "status": 0, - "temperature": 21.14, - "ph": 7.11, - "redox": -15.7, - "ph_mv": -1, - "battery_voltage": 3.164, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 13afcc4e..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.164, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 2c08fb67..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-PHEHT", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PHEHT',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/ph-orp-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 5,\n values: [{name: 'status',\n displayName: 'Status',\n convert: function (x) { return x[0]; }},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'ph',\n displayName: 'pH',\n convert: function (x) { return (x[2] - 32768) / 100; }},\n {name: 'redox',\n displayName: 'Redox',\n convert: function (x) { return (x[3] - 32768) / 10; },\n unit: 'mV'},\n {name: 'ph_mv',\n displayName: 'pH-mV',\n convert: function (x) { return (x[4] - 32768) / 10; },\n unit: 'mV'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index d5b7bdad..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlK4AAMAAIhCgsd/Y3/2DFw=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 676e5c58..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AlK4AAIMXA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index aca01a75..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "status": 0, - "temperature": 21.14, - "ph": 7.11, - "redox": -15.7, - "ph_mv": -1, - "battery_voltage": 3.164, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 13afcc4e..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "21176", - "deviceType": "DL-PHEHT", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.164, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/info.json b/VENDORS/Decentlab/DL-PHEHT/info.json deleted file mode 100644 index f85b5a50..00000000 --- a/VENDORS/Decentlab/DL-PHEHT/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/ph-orp-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-PHEHT is a water ph sensor for LoRaWAN®. Suitable for applications such as industrial and municipal sewage treatment plants, wastewater management (nitrification and de-nitrification), surface water monitoring, and drinking water monitoring." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PHEHT/photo.png b/VENDORS/Decentlab/DL-PHEHT/photo.png deleted file mode 100644 index 0ae109b9..00000000 Binary files a/VENDORS/Decentlab/DL-PHEHT/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/converter.json deleted file mode 100644 index 63327d21..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-PR21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-with-g1/4-pipe-thread-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: -1.0,\n Pmax: 10.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload.json deleted file mode 100644 index 5de61fa1..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgFnAANOgGAXDH8=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 3bd14e70..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgFnAAIMfw==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_02.json deleted file mode 100644 index bca35ead..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgFnAANOgGAXDH8=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 0b53ec95..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgFnAAIMfw==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result.json deleted file mode 100644 index 1905d431..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "pressure": 0.24609375, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_01.json deleted file mode 100644 index 97857660..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_02.json deleted file mode 100644 index 8c75fd21..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "pressure": 0.24609375, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_03.json deleted file mode 100644 index 62ad4679..00000000 --- a/VENDORS/Decentlab/DL-PR21/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/converter.json deleted file mode 100644 index c84ba6f5..00000000 --- a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-PR21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-with-g1/4-pipe-thread-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: -1.0,\n Pmax: 10.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/payload.json deleted file mode 100644 index d1277715..00000000 --- a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02016700034e8060170c7f" -} diff --git a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/payload_01.json deleted file mode 100644 index 5730978b..00000000 --- a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02016700020c7f" -} diff --git a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/result.json deleted file mode 100644 index 627187cf..00000000 --- a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "pressure": 0.24609375, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/result_01.json deleted file mode 100644 index e79c5f0e..00000000 --- a/VENDORS/Decentlab/DL-PR21/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/converter.json deleted file mode 100644 index 5bb9a6c2..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-PR21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-with-g1/4-pipe-thread-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: -1.0,\n Pmax: 10.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/payload.json deleted file mode 100644 index c3ac4d79..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02016700034e8060170c7f", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/payload_01.json deleted file mode 100644 index 9ee6a8b4..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02016700020c7f", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/result.json deleted file mode 100644 index 343df9c5..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pressure": 0.24609375, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/result_01.json deleted file mode 100644 index a80fbe33..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 9bc39f4d..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-PR21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-with-g1/4-pipe-thread-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: -1.0,\n Pmax: 10.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index c3ac4d79..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02016700034e8060170c7f", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 9ee6a8b4..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02016700020c7f", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 343df9c5..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pressure": 0.24609375, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index a80fbe33..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 19b427a4..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-PR21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-with-g1/4-pipe-thread-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: -1.0,\n Pmax: 10.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index d55daa46..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgFnAANOgGAXDH8=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 0fc275b6..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgFnAAIMfw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 52bf8e48..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pressure": 0.24609375, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 39530690..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 03b72fbd..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-PR21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-with-g1/4-pipe-thread-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: -1.0,\n Pmax: 10.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index d55daa46..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgFnAANOgGAXDH8=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 0fc275b6..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgFnAAIMfw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 52bf8e48..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pressure": 0.24609375, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 39530690..00000000 --- a/VENDORS/Decentlab/DL-PR21/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR21", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/info.json b/VENDORS/Decentlab/DL-PR21/info.json deleted file mode 100644 index 2434d019..00000000 --- a/VENDORS/Decentlab/DL-PR21/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-with-g1/4-pipe-thread-for-lorawan", - "description": "The Decentlab DL-PR21 is equipped with pressure, liquid level, and temperature sensors. It is suitable for use with water distribution systems for measuring and monitoring liquid levels, temperature, and leaks." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR21/photo.png b/VENDORS/Decentlab/DL-PR21/photo.png deleted file mode 100644 index 3fe62cf9..00000000 Binary files a/VENDORS/Decentlab/DL-PR21/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/converter.json deleted file mode 100644 index 2eb953f6..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-PR26", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR26',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: 0.0,\n Pmax: 1.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload.json deleted file mode 100644 index 20648690..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgFnAAM+gGAXDH8=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 3bd14e70..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgFnAAIMfw==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 6eaabf3c..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgFnAAM+gGAXDH8=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 0b53ec95..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgFnAAIMfw==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result.json deleted file mode 100644 index a99d38e2..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "pressure": -0.01171875, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_01.json deleted file mode 100644 index d2d6afae..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_02.json deleted file mode 100644 index db51d038..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "pressure": -0.01171875, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_03.json deleted file mode 100644 index 89488405..00000000 --- a/VENDORS/Decentlab/DL-PR26/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/converter.json deleted file mode 100644 index 512a8002..00000000 --- a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-PR26", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR26',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: 0.0,\n Pmax: 1.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/payload.json deleted file mode 100644 index 679c3068..00000000 --- a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02016700033e8060170c7f" -} diff --git a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/payload_01.json deleted file mode 100644 index 5730978b..00000000 --- a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02016700020c7f" -} diff --git a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/result.json deleted file mode 100644 index edba10d9..00000000 --- a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "pressure": -0.01171875, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/result_01.json deleted file mode 100644 index 70ddec13..00000000 --- a/VENDORS/Decentlab/DL-PR26/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/converter.json deleted file mode 100644 index 8be57d40..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-PR26", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR26',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: 0.0,\n Pmax: 1.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/payload.json deleted file mode 100644 index acd292d0..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02016700033e8060170c7f", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/payload_01.json deleted file mode 100644 index 9ee6a8b4..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02016700020c7f", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/result.json deleted file mode 100644 index 031c245c..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pressure": -0.01171875, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/result_01.json deleted file mode 100644 index ddaf7063..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 1c32110c..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-PR26", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR26',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: 0.0,\n Pmax: 1.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index acd292d0..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02016700033e8060170c7f", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 9ee6a8b4..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02016700020c7f", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 031c245c..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pressure": -0.01171875, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index ddaf7063..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 7a1b5c9e..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-PR26", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR26',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: 0.0,\n Pmax: 1.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 9770595c..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgFnAAM+gGAXDH8=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 0fc275b6..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgFnAAIMfw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index bec25b37..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pressure": -0.01171875, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index c7dc4de0..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index ad96f976..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-PR26", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR26',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n Pmin: 0.0,\n Pmax: 1.0\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 16384) / 32768 * (this.PARAMETERS.Pmax - this.PARAMETERS.Pmin) + this.PARAMETERS.Pmin; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 384) * 0.003125 - 50; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 9770595c..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgFnAAM+gGAXDH8=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 0fc275b6..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgFnAAIMfw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index bec25b37..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pressure": -0.01171875, - "temperature": 25.671875, - "battery_voltage": 3.199, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index c7dc4de0..00000000 --- a/VENDORS/Decentlab/DL-PR26/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "359", - "deviceType": "DL-PR26", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.199, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/info.json b/VENDORS/Decentlab/DL-PR26/info.json deleted file mode 100644 index e1decd69..00000000 --- a/VENDORS/Decentlab/DL-PR26/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/pressure-/-liquid-level-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-PR26 consists of a pressure/liquid level sensor and a temperature sensor. It is made for measuring and monitoring liquid levels and pressure in tanks, wells, groundwater, boreholes, and also leak detection, and pump monitoring." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR26/photo.png b/VENDORS/Decentlab/DL-PR26/photo.png deleted file mode 100644 index 9c4ef89a..00000000 Binary files a/VENDORS/Decentlab/DL-PR26/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/converter.json deleted file mode 100644 index 16ed9adf..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-PR36", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload.json deleted file mode 100644 index 3ff7c534..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgMrAAOAZ5eBDCs=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_01.json deleted file mode 100644 index cdd758ac..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgMrAAIMKw==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_02.json deleted file mode 100644 index dcd9fb92..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgMrAAOAZ5eBDCs=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 58686dec..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgMrAAIMKw==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result.json deleted file mode 100644 index 62d79748..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "pressure": 0.0125732421875, - "temperature": 23.50390625, - "battery_voltage": 3.115, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_01.json deleted file mode 100644 index 120cdd5f..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_02.json deleted file mode 100644 index 6cf367ff..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "pressure": 0.0125732421875, - "temperature": 23.50390625, - "battery_voltage": 3.115, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_03.json deleted file mode 100644 index 356120b2..00000000 --- a/VENDORS/Decentlab/DL-PR36/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/converter.json deleted file mode 100644 index 181d2bdf..00000000 --- a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-PR36", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/payload.json deleted file mode 100644 index de1ab7a6..00000000 --- a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02032b0003806797810c2b" -} diff --git a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/payload_01.json deleted file mode 100644 index 728a87cf..00000000 --- a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02032b00020c2b" -} diff --git a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/result.json deleted file mode 100644 index 25800229..00000000 --- a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "pressure": 0.0125732421875, - "temperature": 23.50390625, - "battery_voltage": 3.115, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/result_01.json deleted file mode 100644 index 3473debc..00000000 --- a/VENDORS/Decentlab/DL-PR36/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/converter.json deleted file mode 100644 index 93c63e6f..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-PR36", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/payload.json deleted file mode 100644 index 97e3cc27..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02032b0003806797810c2b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/payload_01.json deleted file mode 100644 index 56269973..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02032b00020c2b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/result.json deleted file mode 100644 index 473311ca..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pressure": 0.0125732421875, - "temperature": 23.50390625, - "battery_voltage": 3.115, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/result_01.json deleted file mode 100644 index e051d07e..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 764642ef..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-PR36", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 97e3cc27..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02032b0003806797810c2b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 56269973..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02032b00020c2b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 473311ca..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pressure": 0.0125732421875, - "temperature": 23.50390625, - "battery_voltage": 3.115, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index e051d07e..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 821d8936..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-PR36", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 543188eb..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgMrAAOAZ5eBDCs=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 50f68c67..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgMrAAIMKw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 0fab1601..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pressure": 0.0125732421875, - "temperature": 23.50390625, - "battery_voltage": 3.115, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 73a3c09d..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 7407ebec..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-PR36", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192\n },\n SENSORS: [\n {length: 2,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature',\n displayName: 'Temperature',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 543188eb..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgMrAAOAZ5eBDCs=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 50f68c67..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgMrAAIMKw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 0fab1601..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pressure": 0.0125732421875, - "temperature": 23.50390625, - "battery_voltage": 3.115, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 73a3c09d..00000000 --- a/VENDORS/Decentlab/DL-PR36/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "811", - "deviceType": "DL-PR36", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/info.json b/VENDORS/Decentlab/DL-PR36/info.json deleted file mode 100644 index 23e63dfc..00000000 --- a/VENDORS/Decentlab/DL-PR36/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-PR36 is a LoRaWAN® end-device that is equipped with a high precision pressure/liquid level sensor and a temperature sensor. Suitable for measuring water/liquid levels in tanks, wells, boreholes, groundwater, etc." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36/photo.png b/VENDORS/Decentlab/DL-PR36/photo.png deleted file mode 100644 index 9b66a08b..00000000 Binary files a/VENDORS/Decentlab/DL-PR36/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/converter.json deleted file mode 100644 index f44d72d5..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-PR36CTD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36CTD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192,\n kec: 1024\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature_electronics',\n displayName: 'Temperature (electronics)',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'},\n {name: 'temperature_pt1000',\n displayName: 'Temperature (PT1000)',\n convert: function (x) { return (x[2] - 32768) / 256; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return (x[3] - 32768) / this.PARAMETERS.kec; },\n unit: 'mS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload.json deleted file mode 100644 index 3e65f7b9..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgoXAAOAB5eGl4GABgwr", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 4c883e1f..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgoXAAIMKw==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 40322abd..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgoXAAOAB5eGl4GABgwr", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 2da84f2f..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgoXAAIMKw==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result.json deleted file mode 100644 index 381a0615..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "pressure": 0.0008544921875, - "temperature_electronics": 23.5234375, - "temperature_pt1000": 23.50390625, - "electrical_conductivity": 0.005859375, - "battery_voltage": 3.115, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_01.json deleted file mode 100644 index ad0261f6..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_02.json deleted file mode 100644 index 40eccbdd..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "pressure": 0.0008544921875, - "temperature_electronics": 23.5234375, - "temperature_pt1000": 23.50390625, - "electrical_conductivity": 0.005859375, - "battery_voltage": 3.115, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_03.json deleted file mode 100644 index 3f806d0f..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/converter.json deleted file mode 100644 index f07c3804..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-PR36CTD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36CTD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192,\n kec: 1024\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature_electronics',\n displayName: 'Temperature (electronics)',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'},\n {name: 'temperature_pt1000',\n displayName: 'Temperature (PT1000)',\n convert: function (x) { return (x[2] - 32768) / 256; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return (x[3] - 32768) / this.PARAMETERS.kec; },\n unit: 'mS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/payload.json deleted file mode 100644 index 0d16fecb..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020a17000380079786978180060c2b" -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/payload_01.json deleted file mode 100644 index f5128ea1..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020a1700020c2b" -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/result.json deleted file mode 100644 index f3bffa0c..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "pressure": 0.0008544921875, - "temperature_electronics": 23.5234375, - "temperature_pt1000": 23.50390625, - "electrical_conductivity": 0.005859375, - "battery_voltage": 3.115, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/result_01.json deleted file mode 100644 index a94ef026..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/converter.json deleted file mode 100644 index 5ad16381..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-PR36CTD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36CTD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192,\n kec: 1024\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature_electronics',\n displayName: 'Temperature (electronics)',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'},\n {name: 'temperature_pt1000',\n displayName: 'Temperature (PT1000)',\n convert: function (x) { return (x[2] - 32768) / 256; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return (x[3] - 32768) / this.PARAMETERS.kec; },\n unit: 'mS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/payload.json deleted file mode 100644 index 7dcffc8c..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020a17000380079786978180060c2b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/payload_01.json deleted file mode 100644 index 0ad63126..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020a1700020c2b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/result.json deleted file mode 100644 index 012265ab..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pressure": 0.0008544921875, - "temperature_electronics": 23.5234375, - "temperature_pt1000": 23.50390625, - "electrical_conductivity": 0.005859375, - "battery_voltage": 3.115, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/result_01.json deleted file mode 100644 index 21d948d3..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index fd0f9d18..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-PR36CTD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36CTD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192,\n kec: 1024\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature_electronics',\n displayName: 'Temperature (electronics)',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'},\n {name: 'temperature_pt1000',\n displayName: 'Temperature (PT1000)',\n convert: function (x) { return (x[2] - 32768) / 256; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return (x[3] - 32768) / this.PARAMETERS.kec; },\n unit: 'mS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 7dcffc8c..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020a17000380079786978180060c2b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 0ad63126..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020a1700020c2b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 012265ab..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "pressure": 0.0008544921875, - "temperature_electronics": 23.5234375, - "temperature_pt1000": 23.50390625, - "electrical_conductivity": 0.005859375, - "battery_voltage": 3.115, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 21d948d3..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 85d8b542..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-PR36CTD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36CTD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192,\n kec: 1024\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature_electronics',\n displayName: 'Temperature (electronics)',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'},\n {name: 'temperature_pt1000',\n displayName: 'Temperature (PT1000)',\n convert: function (x) { return (x[2] - 32768) / 256; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return (x[3] - 32768) / this.PARAMETERS.kec; },\n unit: 'mS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 68d1012b..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgoXAAOAB5eGl4GABgwr", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 723082d0..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgoXAAIMKw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 5bd74e92..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pressure": 0.0008544921875, - "temperature_electronics": 23.5234375, - "temperature_pt1000": 23.50390625, - "electrical_conductivity": 0.005859375, - "battery_voltage": 3.115, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index bc0c5617..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index e1bd1ea7..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-PR36CTD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PR36CTD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n kp: 8192,\n kec: 1024\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'pressure',\n displayName: 'Pressure',\n convert: function (x) { return (x[0] - 32768) / this.PARAMETERS.kp; },\n unit: 'bar'},\n {name: 'temperature_electronics',\n displayName: 'Temperature (electronics)',\n convert: function (x) { return (x[1] - 32768) / 256; },\n unit: '°C'},\n {name: 'temperature_pt1000',\n displayName: 'Temperature (PT1000)',\n convert: function (x) { return (x[2] - 32768) / 256; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return (x[3] - 32768) / this.PARAMETERS.kec; },\n unit: 'mS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 68d1012b..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgoXAAOAB5eGl4GABgwr", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 723082d0..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgoXAAIMKw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 5bd74e92..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "pressure": 0.0008544921875, - "temperature_electronics": 23.5234375, - "temperature_pt1000": 23.50390625, - "electrical_conductivity": 0.005859375, - "battery_voltage": 3.115, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index bc0c5617..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2583", - "deviceType": "DL-PR36CTD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.115, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/info.json b/VENDORS/Decentlab/DL-PR36CTD/info.json deleted file mode 100644 index 328a7224..00000000 --- a/VENDORS/Decentlab/DL-PR36CTD/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/high-precision-pressure-/-liquid-level-temperature-and-electrical-conductivity-sensor-for-lorawan", - "description": "The Decentlab DL-PR36CTD includes pressure, temperature, and electrical conductivity sensors. It is suitable for measuring water levels and monitoring water quality, salinity, and chloride." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PR36CTD/photo.png b/VENDORS/Decentlab/DL-PR36CTD/photo.png deleted file mode 100644 index 33b47c18..00000000 Binary files a/VENDORS/Decentlab/DL-PR36CTD/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/converter.json deleted file mode 100644 index 759ed2b6..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-PYR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PYR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/total-solar-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'total_solar_radiation',\n displayName: 'Total solar radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'W⋅m⁻²'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload.json deleted file mode 100644 index fa8b4bf9..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgKRAAOAaQxg", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 220fb668..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgKRAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 91b52a85..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgKRAAOAaQxg", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_03.json deleted file mode 100644 index ad7bb620..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgKRAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result.json deleted file mode 100644 index 024a93da..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "total_solar_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_01.json deleted file mode 100644 index 5f39d67a..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_02.json deleted file mode 100644 index 2cf24ebf..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "total_solar_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_03.json deleted file mode 100644 index 17197281..00000000 --- a/VENDORS/Decentlab/DL-PYR/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/converter.json deleted file mode 100644 index 4312fb94..00000000 --- a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-PYR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PYR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/total-solar-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'total_solar_radiation',\n displayName: 'Total solar radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'W⋅m⁻²'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/payload.json deleted file mode 100644 index b7c69294..00000000 --- a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020291000380690c60" -} diff --git a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/payload_01.json deleted file mode 100644 index 432b5883..00000000 --- a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02029100020c60" -} diff --git a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/result.json deleted file mode 100644 index 1d9fae87..00000000 --- a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "total_solar_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/result_01.json deleted file mode 100644 index fb6a8eb0..00000000 --- a/VENDORS/Decentlab/DL-PYR/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/converter.json deleted file mode 100644 index d41b40fb..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-PYR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PYR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/total-solar-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'total_solar_radiation',\n displayName: 'Total solar radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'W⋅m⁻²'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/payload.json deleted file mode 100644 index 142f044e..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020291000380690c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/payload_01.json deleted file mode 100644 index 4ac02ee2..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02029100020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/result.json deleted file mode 100644 index 2c335d19..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "total_solar_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/result_01.json deleted file mode 100644 index 8c826a45..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index e95fb5d1..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-PYR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PYR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/total-solar-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'total_solar_radiation',\n displayName: 'Total solar radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'W⋅m⁻²'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 142f044e..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020291000380690c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 4ac02ee2..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02029100020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 2c335d19..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "total_solar_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 8c826a45..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 6d406686..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-PYR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PYR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/total-solar-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'total_solar_radiation',\n displayName: 'Total solar radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'W⋅m⁻²'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 5563daad..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgKRAAOAaQxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 66e0d100..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgKRAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 35cffb10..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "total_solar_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 0b988f60..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index c74fcbe4..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-PYR", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-PYR',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/total-solar-radiation-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 1,\n values: [{name: 'total_solar_radiation',\n displayName: 'Total solar radiation',\n convert: function (x) { return 3 * (x[0] / 32768 - 1) * 1000 * 5; },\n unit: 'W⋅m⁻²'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 5563daad..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgKRAAOAaQxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 66e0d100..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgKRAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 35cffb10..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "total_solar_radiation": 48.065185546875, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 0b988f60..00000000 --- a/VENDORS/Decentlab/DL-PYR/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "657", - "deviceType": "DL-PYR", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/info.json b/VENDORS/Decentlab/DL-PYR/info.json deleted file mode 100644 index 143420bb..00000000 --- a/VENDORS/Decentlab/DL-PYR/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/total-solar-radiation-sensor-for-lorawan", - "description": "The Decentlab DL-PYR consists of a solar radiation sensor for measuring solar radiation. It is suitable for measuring radiations in solar panel arrays, smart agriculture, and building automation." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-PYR/photo.png b/VENDORS/Decentlab/DL-PYR/photo.png deleted file mode 100644 index 0d213ae1..00000000 Binary files a/VENDORS/Decentlab/DL-PYR/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/converter.json deleted file mode 100644 index 71c3016d..00000000 --- a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-RHC", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-RHC',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'sensor_id',\n displayName: 'Sensor ID',\n convert: function (x) { return x[0] + x[1] * 65536; }},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/payload.json deleted file mode 100644 index 5b793219..00000000 --- a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgLgAAOp/QE0HKKF8wxg", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/payload_01.json deleted file mode 100644 index b4f38141..00000000 --- a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgLgAAOp/QE0HKKF8wxg", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/result.json deleted file mode 100644 index 9aa4998c..00000000 --- a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "736", - "deviceType": "DL-RHC", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "sensor_id": 20228605, - "air_humidity": 73.3, - "air_temperature": 15.23, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/result_01.json deleted file mode 100644 index fb41235b..00000000 --- a/VENDORS/Decentlab/DL-RHC/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "736", - "deviceType": "DL-RHC", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "sensor_id": 20228605, - "air_humidity": 73.3, - "air_temperature": 15.23, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/converter.json deleted file mode 100644 index ca4eb4e0..00000000 --- a/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-RHC", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-RHC',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'sensor_id',\n displayName: 'Sensor ID',\n convert: function (x) { return x[0] + x[1] * 65536; }},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/payload.json deleted file mode 100644 index 2fc27843..00000000 --- a/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0202e00003a9fd01341ca285f30c60" -} diff --git a/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/result.json deleted file mode 100644 index 6b76a06e..00000000 --- a/VENDORS/Decentlab/DL-RHC/LORIOT/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "736", - "deviceType": "DL-RHC", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "sensor_id": 20228605, - "air_humidity": 73.3, - "air_temperature": 15.23, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/converter.json deleted file mode 100644 index 9e91355b..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-RHC", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-RHC',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'sensor_id',\n displayName: 'Sensor ID',\n convert: function (x) { return x[0] + x[1] * 65536; }},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/payload.json deleted file mode 100644 index 569314bd..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202e00003a9fd01341ca285f30c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/result.json deleted file mode 100644 index 2562c3ab..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingPark/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "736", - "deviceType": "DL-RHC", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "sensor_id": 20228605, - "air_humidity": 73.3, - "air_temperature": 15.23, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index a2805915..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-RHC", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-RHC',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'sensor_id',\n displayName: 'Sensor ID',\n convert: function (x) { return x[0] + x[1] * 65536; }},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 569314bd..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202e00003a9fd01341ca285f30c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 2562c3ab..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "736", - "deviceType": "DL-RHC", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "sensor_id": 20228605, - "air_humidity": 73.3, - "air_temperature": 15.23, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 8b1ee146..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-RHC", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-RHC',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'sensor_id',\n displayName: 'Sensor ID',\n convert: function (x) { return x[0] + x[1] * 65536; }},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 9ebad136..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgLgAAOp/QE0HKKF8wxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 99e631d6..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "736", - "deviceType": "DL-RHC", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "sensor_id": 20228605, - "air_humidity": 73.3, - "air_temperature": 15.23, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 5021f6e0..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-RHC", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-RHC',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/high-precision-air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'sensor_id',\n displayName: 'Sensor ID',\n convert: function (x) { return x[0] + x[1] * 65536; }},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return x[2] / 100; },\n unit: '%'},\n {name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 9ebad136..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgLgAAOp/QE0HKKF8wxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 99e631d6..00000000 --- a/VENDORS/Decentlab/DL-RHC/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "736", - "deviceType": "DL-RHC", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "sensor_id": 20228605, - "air_humidity": 73.3, - "air_temperature": 15.23, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/info.json b/VENDORS/Decentlab/DL-RHC/info.json deleted file mode 100644 index 63cfbdfa..00000000 --- a/VENDORS/Decentlab/DL-RHC/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/high-precision-air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan", - "description": "The Decentlab DL-RCH is equipped with high-precision air temperature and humidity sensors for environmental monitoring. Suitable for smart agriculture, urban heat islands, greenhouses, frost alarming, and building automation." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-RHC/photo.png b/VENDORS/Decentlab/DL-RHC/photo.png deleted file mode 100644 index b600f077..00000000 Binary files a/VENDORS/Decentlab/DL-RHC/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/converter.json deleted file mode 100644 index 675a56e1..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-SDD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SDD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-salinity-profile */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 18,\n values: [{name: 'moisture_at_level_0',\n displayName: 'Moisture at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_1',\n displayName: 'Moisture at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_2',\n displayName: 'Moisture at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_3',\n displayName: 'Moisture at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_4',\n displayName: 'Moisture at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_5',\n displayName: 'Moisture at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_0',\n displayName: 'Salinity at level 0',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_1',\n displayName: 'Salinity at level 1',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_2',\n displayName: 'Salinity at level 2',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_3',\n displayName: 'Salinity at level 3',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_4',\n displayName: 'Salinity at level 4',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_5',\n displayName: 'Salinity at level 5',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 18,\n values: [{name: 'moisture_at_level_6',\n displayName: 'Moisture at level 6',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_7',\n displayName: 'Moisture at level 7',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_8',\n displayName: 'Moisture at level 8',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_9',\n displayName: 'Moisture at level 9',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_10',\n displayName: 'Moisture at level 10',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_11',\n displayName: 'Moisture at level 11',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_6',\n displayName: 'Salinity at level 6',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_7',\n displayName: 'Salinity at level 7',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_8',\n displayName: 'Salinity at level 8',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_9',\n displayName: 'Salinity at level 9',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_10',\n displayName: 'Salinity at level 10',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_11',\n displayName: 'Salinity at level 11',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload.json deleted file mode 100644 index feb62b5f..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AkPjAAWAAIAAgACAAIAAgACHQYd7h0mHbIdsh2YAAAAAAAAAAAAAAUoJ4w==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 85b298a4..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AkPjAAQJ4w==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 6ebfd3fb..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AkPjAAWAAIAAgACAAIAAgACHQYd7h0mHbIdsh2YAAAAAAAAAAAAAAUoJ4w==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 207ed606..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AkPjAAQJ4w==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result.json deleted file mode 100644 index d0c10c03..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "moisture_at_level_0": 0, - "moisture_at_level_1": 0, - "moisture_at_level_2": 0, - "moisture_at_level_3": 0, - "moisture_at_level_4": 0, - "moisture_at_level_5": 0, - "temperature_at_level_0": 18.57, - "temperature_at_level_1": 19.15, - "temperature_at_level_2": 18.65, - "temperature_at_level_3": 19, - "temperature_at_level_4": 19, - "temperature_at_level_5": 18.94, - "salinity_at_level_0": -100, - "salinity_at_level_1": -100, - "salinity_at_level_2": -100, - "salinity_at_level_3": -100, - "salinity_at_level_4": -100, - "salinity_at_level_5": 230, - "battery_voltage": 2.531, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_01.json deleted file mode 100644 index 05e8de7e..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.531, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_02.json deleted file mode 100644 index 6fe96d06..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "moisture_at_level_0": 0, - "moisture_at_level_1": 0, - "moisture_at_level_2": 0, - "moisture_at_level_3": 0, - "moisture_at_level_4": 0, - "moisture_at_level_5": 0, - "temperature_at_level_0": 18.57, - "temperature_at_level_1": 19.15, - "temperature_at_level_2": 18.65, - "temperature_at_level_3": 19, - "temperature_at_level_4": 19, - "temperature_at_level_5": 18.94, - "salinity_at_level_0": -100, - "salinity_at_level_1": -100, - "salinity_at_level_2": -100, - "salinity_at_level_3": -100, - "salinity_at_level_4": -100, - "salinity_at_level_5": 230, - "battery_voltage": 2.531, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_03.json deleted file mode 100644 index 11ef0bc1..00000000 --- a/VENDORS/Decentlab/DL-SDD/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.531, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/converter.json deleted file mode 100644 index e83192b6..00000000 --- a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-SDD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SDD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-salinity-profile */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 18,\n values: [{name: 'moisture_at_level_0',\n displayName: 'Moisture at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_1',\n displayName: 'Moisture at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_2',\n displayName: 'Moisture at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_3',\n displayName: 'Moisture at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_4',\n displayName: 'Moisture at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_5',\n displayName: 'Moisture at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_0',\n displayName: 'Salinity at level 0',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_1',\n displayName: 'Salinity at level 1',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_2',\n displayName: 'Salinity at level 2',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_3',\n displayName: 'Salinity at level 3',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_4',\n displayName: 'Salinity at level 4',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_5',\n displayName: 'Salinity at level 5',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 18,\n values: [{name: 'moisture_at_level_6',\n displayName: 'Moisture at level 6',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_7',\n displayName: 'Moisture at level 7',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_8',\n displayName: 'Moisture at level 8',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_9',\n displayName: 'Moisture at level 9',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_10',\n displayName: 'Moisture at level 10',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_11',\n displayName: 'Moisture at level 11',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_6',\n displayName: 'Salinity at level 6',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_7',\n displayName: 'Salinity at level 7',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_8',\n displayName: 'Salinity at level 8',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_9',\n displayName: 'Salinity at level 9',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_10',\n displayName: 'Salinity at level 10',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_11',\n displayName: 'Salinity at level 11',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/payload.json deleted file mode 100644 index 884d5473..00000000 --- a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0243e300058000800080008000800080008741877b8749876c876c876600000000000000000000014a09e3" -} diff --git a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/payload_01.json deleted file mode 100644 index 1ec5797f..00000000 --- a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0243e3000409e3" -} diff --git a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/result.json deleted file mode 100644 index a38e0afa..00000000 --- a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/result.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "moisture_at_level_0": 0, - "moisture_at_level_1": 0, - "moisture_at_level_2": 0, - "moisture_at_level_3": 0, - "moisture_at_level_4": 0, - "moisture_at_level_5": 0, - "temperature_at_level_0": 18.57, - "temperature_at_level_1": 19.15, - "temperature_at_level_2": 18.65, - "temperature_at_level_3": 19, - "temperature_at_level_4": 19, - "temperature_at_level_5": 18.94, - "salinity_at_level_0": -100, - "salinity_at_level_1": -100, - "salinity_at_level_2": -100, - "salinity_at_level_3": -100, - "salinity_at_level_4": -100, - "salinity_at_level_5": 230, - "battery_voltage": 2.531, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/result_01.json deleted file mode 100644 index e3f2ea0e..00000000 --- a/VENDORS/Decentlab/DL-SDD/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.531, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/converter.json deleted file mode 100644 index 59928fc0..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-SDD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SDD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-salinity-profile */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 18,\n values: [{name: 'moisture_at_level_0',\n displayName: 'Moisture at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_1',\n displayName: 'Moisture at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_2',\n displayName: 'Moisture at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_3',\n displayName: 'Moisture at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_4',\n displayName: 'Moisture at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_5',\n displayName: 'Moisture at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_0',\n displayName: 'Salinity at level 0',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_1',\n displayName: 'Salinity at level 1',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_2',\n displayName: 'Salinity at level 2',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_3',\n displayName: 'Salinity at level 3',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_4',\n displayName: 'Salinity at level 4',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_5',\n displayName: 'Salinity at level 5',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 18,\n values: [{name: 'moisture_at_level_6',\n displayName: 'Moisture at level 6',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_7',\n displayName: 'Moisture at level 7',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_8',\n displayName: 'Moisture at level 8',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_9',\n displayName: 'Moisture at level 9',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_10',\n displayName: 'Moisture at level 10',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_11',\n displayName: 'Moisture at level 11',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_6',\n displayName: 'Salinity at level 6',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_7',\n displayName: 'Salinity at level 7',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_8',\n displayName: 'Salinity at level 8',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_9',\n displayName: 'Salinity at level 9',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_10',\n displayName: 'Salinity at level 10',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_11',\n displayName: 'Salinity at level 11',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/payload.json deleted file mode 100644 index 8a069001..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0243e300058000800080008000800080008741877b8749876c876c876600000000000000000000014a09e3", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/payload_01.json deleted file mode 100644 index 3052b9a9..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0243e3000409e3", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/result.json deleted file mode 100644 index 60063804..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/result.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "moisture_at_level_0": 0, - "moisture_at_level_1": 0, - "moisture_at_level_2": 0, - "moisture_at_level_3": 0, - "moisture_at_level_4": 0, - "moisture_at_level_5": 0, - "temperature_at_level_0": 18.57, - "temperature_at_level_1": 19.15, - "temperature_at_level_2": 18.65, - "temperature_at_level_3": 19, - "temperature_at_level_4": 19, - "temperature_at_level_5": 18.94, - "salinity_at_level_0": -100, - "salinity_at_level_1": -100, - "salinity_at_level_2": -100, - "salinity_at_level_3": -100, - "salinity_at_level_4": -100, - "salinity_at_level_5": 230, - "battery_voltage": 2.531, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/result_01.json deleted file mode 100644 index 9f6eaf81..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.531, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 94a41bc6..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-SDD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SDD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-salinity-profile */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 18,\n values: [{name: 'moisture_at_level_0',\n displayName: 'Moisture at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_1',\n displayName: 'Moisture at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_2',\n displayName: 'Moisture at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_3',\n displayName: 'Moisture at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_4',\n displayName: 'Moisture at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_5',\n displayName: 'Moisture at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_0',\n displayName: 'Salinity at level 0',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_1',\n displayName: 'Salinity at level 1',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_2',\n displayName: 'Salinity at level 2',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_3',\n displayName: 'Salinity at level 3',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_4',\n displayName: 'Salinity at level 4',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_5',\n displayName: 'Salinity at level 5',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 18,\n values: [{name: 'moisture_at_level_6',\n displayName: 'Moisture at level 6',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_7',\n displayName: 'Moisture at level 7',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_8',\n displayName: 'Moisture at level 8',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_9',\n displayName: 'Moisture at level 9',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_10',\n displayName: 'Moisture at level 10',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_11',\n displayName: 'Moisture at level 11',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_6',\n displayName: 'Salinity at level 6',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_7',\n displayName: 'Salinity at level 7',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_8',\n displayName: 'Salinity at level 8',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_9',\n displayName: 'Salinity at level 9',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_10',\n displayName: 'Salinity at level 10',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_11',\n displayName: 'Salinity at level 11',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 8a069001..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0243e300058000800080008000800080008741877b8749876c876c876600000000000000000000014a09e3", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 3052b9a9..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0243e3000409e3", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 60063804..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "moisture_at_level_0": 0, - "moisture_at_level_1": 0, - "moisture_at_level_2": 0, - "moisture_at_level_3": 0, - "moisture_at_level_4": 0, - "moisture_at_level_5": 0, - "temperature_at_level_0": 18.57, - "temperature_at_level_1": 19.15, - "temperature_at_level_2": 18.65, - "temperature_at_level_3": 19, - "temperature_at_level_4": 19, - "temperature_at_level_5": 18.94, - "salinity_at_level_0": -100, - "salinity_at_level_1": -100, - "salinity_at_level_2": -100, - "salinity_at_level_3": -100, - "salinity_at_level_4": -100, - "salinity_at_level_5": 230, - "battery_voltage": 2.531, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 9f6eaf81..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.531, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 166ee14c..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-SDD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SDD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-salinity-profile */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 18,\n values: [{name: 'moisture_at_level_0',\n displayName: 'Moisture at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_1',\n displayName: 'Moisture at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_2',\n displayName: 'Moisture at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_3',\n displayName: 'Moisture at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_4',\n displayName: 'Moisture at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_5',\n displayName: 'Moisture at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_0',\n displayName: 'Salinity at level 0',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_1',\n displayName: 'Salinity at level 1',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_2',\n displayName: 'Salinity at level 2',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_3',\n displayName: 'Salinity at level 3',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_4',\n displayName: 'Salinity at level 4',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_5',\n displayName: 'Salinity at level 5',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 18,\n values: [{name: 'moisture_at_level_6',\n displayName: 'Moisture at level 6',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_7',\n displayName: 'Moisture at level 7',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_8',\n displayName: 'Moisture at level 8',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_9',\n displayName: 'Moisture at level 9',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_10',\n displayName: 'Moisture at level 10',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_11',\n displayName: 'Moisture at level 11',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_6',\n displayName: 'Salinity at level 6',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_7',\n displayName: 'Salinity at level 7',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_8',\n displayName: 'Salinity at level 8',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_9',\n displayName: 'Salinity at level 9',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_10',\n displayName: 'Salinity at level 10',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_11',\n displayName: 'Salinity at level 11',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 4283857b..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkPjAAWAAIAAgACAAIAAgACHQYd7h0mHbIdsh2YAAAAAAAAAAAAAAUoJ4w==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 2418cd5c..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkPjAAQJ4w==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 71f3b155..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "moisture_at_level_0": 0, - "moisture_at_level_1": 0, - "moisture_at_level_2": 0, - "moisture_at_level_3": 0, - "moisture_at_level_4": 0, - "moisture_at_level_5": 0, - "temperature_at_level_0": 18.57, - "temperature_at_level_1": 19.15, - "temperature_at_level_2": 18.65, - "temperature_at_level_3": 19, - "temperature_at_level_4": 19, - "temperature_at_level_5": 18.94, - "salinity_at_level_0": -100, - "salinity_at_level_1": -100, - "salinity_at_level_2": -100, - "salinity_at_level_3": -100, - "salinity_at_level_4": -100, - "salinity_at_level_5": 230, - "battery_voltage": 2.531, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 80663488..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.531, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 2d8d8d12..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-SDD", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SDD',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-salinity-profile */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 18,\n values: [{name: 'moisture_at_level_0',\n displayName: 'Moisture at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_1',\n displayName: 'Moisture at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_2',\n displayName: 'Moisture at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_3',\n displayName: 'Moisture at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_4',\n displayName: 'Moisture at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_5',\n displayName: 'Moisture at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_0',\n displayName: 'Salinity at level 0',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_1',\n displayName: 'Salinity at level 1',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_2',\n displayName: 'Salinity at level 2',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_3',\n displayName: 'Salinity at level 3',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_4',\n displayName: 'Salinity at level 4',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_5',\n displayName: 'Salinity at level 5',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 18,\n values: [{name: 'moisture_at_level_6',\n displayName: 'Moisture at level 6',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_7',\n displayName: 'Moisture at level 7',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_8',\n displayName: 'Moisture at level 8',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_9',\n displayName: 'Moisture at level 9',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_10',\n displayName: 'Moisture at level 10',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '%'},\n {name: 'moisture_at_level_11',\n displayName: 'Moisture at level 11',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '%'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'salinity_at_level_6',\n displayName: 'Salinity at level 6',\n convert: function (x) { return x[12] - 100; }},\n {name: 'salinity_at_level_7',\n displayName: 'Salinity at level 7',\n convert: function (x) { return x[13] - 100; }},\n {name: 'salinity_at_level_8',\n displayName: 'Salinity at level 8',\n convert: function (x) { return x[14] - 100; }},\n {name: 'salinity_at_level_9',\n displayName: 'Salinity at level 9',\n convert: function (x) { return x[15] - 100; }},\n {name: 'salinity_at_level_10',\n displayName: 'Salinity at level 10',\n convert: function (x) { return x[16] - 100; }},\n {name: 'salinity_at_level_11',\n displayName: 'Salinity at level 11',\n convert: function (x) { return x[17] - 100; }}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 4283857b..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkPjAAWAAIAAgACAAIAAgACHQYd7h0mHbIdsh2YAAAAAAAAAAAAAAUoJ4w==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 2418cd5c..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AkPjAAQJ4w==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 71f3b155..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "moisture_at_level_0": 0, - "moisture_at_level_1": 0, - "moisture_at_level_2": 0, - "moisture_at_level_3": 0, - "moisture_at_level_4": 0, - "moisture_at_level_5": 0, - "temperature_at_level_0": 18.57, - "temperature_at_level_1": 19.15, - "temperature_at_level_2": 18.65, - "temperature_at_level_3": 19, - "temperature_at_level_4": 19, - "temperature_at_level_5": 18.94, - "salinity_at_level_0": -100, - "salinity_at_level_1": -100, - "salinity_at_level_2": -100, - "salinity_at_level_3": -100, - "salinity_at_level_4": -100, - "salinity_at_level_5": 230, - "battery_voltage": 2.531, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 80663488..00000000 --- a/VENDORS/Decentlab/DL-SDD/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "17379", - "deviceType": "DL-SDD", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.531, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/info.json b/VENDORS/Decentlab/DL-SDD/info.json deleted file mode 100644 index f1a73852..00000000 --- a/VENDORS/Decentlab/DL-SDD/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/soil-moisture-temperature-and-salinity-profile", - "description": "The Decentlab DL-SDD includes 6 soil moisture, temperature and salinity sensors for LoRaWAN®. Suitable for applications such as outdoor remote monitoring, irrigation control, smart agriculture, greenhouse and soil-less plantations, parks, and golf courses." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SDD/photo.png b/VENDORS/Decentlab/DL-SDD/photo.png deleted file mode 100644 index 42cc2835..00000000 Binary files a/VENDORS/Decentlab/DL-SDD/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/converter.json deleted file mode 100644 index dd22a333..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-SHT35-001", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SHT35',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload.json deleted file mode 100644 index e524f89c..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgMOAANkoHmxDGA=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_01.json deleted file mode 100644 index f4b6b8b6..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgMOAAIMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_02.json deleted file mode 100644 index b02a35ee..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgMOAANkoHmxDGA=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 75524c99..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgMOAAIMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result.json deleted file mode 100644 index 4fba4c87..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_01.json deleted file mode 100644 index 3fa3482f..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_02.json deleted file mode 100644 index 32566044..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_03.json deleted file mode 100644 index 1d189d1f..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/converter.json deleted file mode 100644 index 401d473e..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-SHT35-001", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SHT35',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/payload.json deleted file mode 100644 index db896a43..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02030e000364a079b10c60" -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/payload_01.json deleted file mode 100644 index 5a049244..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02030e00020c60" -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/result.json deleted file mode 100644 index 178e03a5..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/result_01.json deleted file mode 100644 index f531f446..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/converter.json deleted file mode 100644 index 5cf20443..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-SHT35-001", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SHT35',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/payload.json deleted file mode 100644 index 5adfd4bc..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02030e000364a079b10c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/payload_01.json deleted file mode 100644 index 7d0a43d9..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02030e00020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/result.json deleted file mode 100644 index 196a5cdf..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/result_01.json deleted file mode 100644 index e83504f1..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index fcf8c440..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-SHT35-001", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SHT35',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 5adfd4bc..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02030e000364a079b10c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 7d0a43d9..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02030e00020c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 196a5cdf..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index e83504f1..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index f697c13f..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-SHT35-001", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SHT35',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 54f8c83f..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgMOAANkoHmxDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 09bf7a63..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgMOAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 2c54fb05..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 17298040..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 2bd6a97b..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-SHT35-001", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SHT35',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 54f8c83f..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgMOAANkoHmxDGA=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 09bf7a63..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgMOAAIMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 2c54fb05..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 17298040..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "782", - "deviceType": "DL-SHT35", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/info.json b/VENDORS/Decentlab/DL-SHT35-001/info.json deleted file mode 100644 index 3ebdd5c8..00000000 --- a/VENDORS/Decentlab/DL-SHT35-001/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/air-temperature-and-humidity-sensor-with-radiation-shield-for-lorawan", - "description": "The Decentlab DL-SHT35-001 is equipped with a temperature and a humidity sensor that can be used for monitoring and measuring air temperature and humidity. Suitable for applications such as smart agriculture, urban heat islands, greenhouses, frost alarming, and building automation." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-001/photo.png b/VENDORS/Decentlab/DL-SHT35-001/photo.png deleted file mode 100644 index b27dc306..00000000 Binary files a/VENDORS/Decentlab/DL-SHT35-001/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-SHT35-002/info.json b/VENDORS/Decentlab/DL-SHT35-002/info.json deleted file mode 100644 index a8d9b94d..00000000 --- a/VENDORS/Decentlab/DL-SHT35-002/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/air-temperature-and-humidity-sensor-for-lorawan", - "description": "The Decentlab DL-SHT35-002 is equipped with a temperature and humidity sensor for environmental monitoring. Suitable for cold chain, storage, building automation, smart agriculture applications." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SHT35-002/photo.png b/VENDORS/Decentlab/DL-SHT35-002/photo.png deleted file mode 100644 index 47e5f1eb..00000000 Binary files a/VENDORS/Decentlab/DL-SHT35-002/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/converter.json deleted file mode 100644 index b6346f77..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-SMTP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SMTP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-and-temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'soil_moisture_at_depth_0',\n displayName: 'Soil moisture at depth 0',\n convert: function (x) { return (x[0] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_0',\n displayName: 'Soil temperature at depth 0',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_1',\n displayName: 'Soil moisture at depth 1',\n convert: function (x) { return (x[2] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_1',\n displayName: 'Soil temperature at depth 1',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_2',\n displayName: 'Soil moisture at depth 2',\n convert: function (x) { return (x[4] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_2',\n displayName: 'Soil temperature at depth 2',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_3',\n displayName: 'Soil moisture at depth 3',\n convert: function (x) { return (x[6] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_3',\n displayName: 'Soil temperature at depth 3',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_4',\n displayName: 'Soil moisture at depth 4',\n convert: function (x) { return (x[8] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_4',\n displayName: 'Soil temperature at depth 4',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_5',\n displayName: 'Soil moisture at depth 5',\n convert: function (x) { return (x[10] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_5',\n displayName: 'Soil temperature at depth 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_6',\n displayName: 'Soil moisture at depth 6',\n convert: function (x) { return (x[12] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_6',\n displayName: 'Soil temperature at depth 6',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_7',\n displayName: 'Soil moisture at depth 7',\n convert: function (x) { return (x[14] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_7',\n displayName: 'Soil temperature at depth 7',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload.json deleted file mode 100644 index 2a52c181..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgtQAAMJAYqMCUOKmAknipILPIqlDJyKjBHgiqUAAAAAAAAAAAs7", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 2d4a35d8..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgtQAAILOw==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 314bfe06..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgtQAAMJAYqMCUOKmAknipILPIqlDJyKjBHgiqUAAAAAAAAAAAs7", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 3c2e7f5b..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgtQAAILOw==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result.json deleted file mode 100644 index 60cb46aa..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "soil_moisture_at_depth_0": -0.39, - "soil_temperature_at_depth_0": 27, - "soil_moisture_at_depth_1": -0.258, - "soil_temperature_at_depth_1": 27.12, - "soil_moisture_at_depth_2": -0.314, - "soil_temperature_at_depth_2": 27.06, - "soil_moisture_at_depth_3": 0.752, - "soil_temperature_at_depth_3": 27.25, - "soil_moisture_at_depth_4": 1.456, - "soil_temperature_at_depth_4": 27, - "soil_moisture_at_depth_5": 4.152, - "soil_temperature_at_depth_5": 27.25, - "soil_moisture_at_depth_6": -5, - "soil_temperature_at_depth_6": -327.68, - "soil_moisture_at_depth_7": -5, - "soil_temperature_at_depth_7": -327.68, - "battery_voltage": 2.875, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_01.json deleted file mode 100644 index 13d98958..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.875, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_02.json deleted file mode 100644 index c8bd5cc5..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "soil_moisture_at_depth_0": -0.39, - "soil_temperature_at_depth_0": 27, - "soil_moisture_at_depth_1": -0.258, - "soil_temperature_at_depth_1": 27.12, - "soil_moisture_at_depth_2": -0.314, - "soil_temperature_at_depth_2": 27.06, - "soil_moisture_at_depth_3": 0.752, - "soil_temperature_at_depth_3": 27.25, - "soil_moisture_at_depth_4": 1.456, - "soil_temperature_at_depth_4": 27, - "soil_moisture_at_depth_5": 4.152, - "soil_temperature_at_depth_5": 27.25, - "soil_moisture_at_depth_6": -5, - "soil_temperature_at_depth_6": -327.68, - "soil_moisture_at_depth_7": -5, - "soil_temperature_at_depth_7": -327.68, - "battery_voltage": 2.875, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_03.json deleted file mode 100644 index 67d0f60c..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.875, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/converter.json deleted file mode 100644 index dde93915..00000000 --- a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-SMTP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SMTP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-and-temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'soil_moisture_at_depth_0',\n displayName: 'Soil moisture at depth 0',\n convert: function (x) { return (x[0] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_0',\n displayName: 'Soil temperature at depth 0',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_1',\n displayName: 'Soil moisture at depth 1',\n convert: function (x) { return (x[2] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_1',\n displayName: 'Soil temperature at depth 1',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_2',\n displayName: 'Soil moisture at depth 2',\n convert: function (x) { return (x[4] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_2',\n displayName: 'Soil temperature at depth 2',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_3',\n displayName: 'Soil moisture at depth 3',\n convert: function (x) { return (x[6] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_3',\n displayName: 'Soil temperature at depth 3',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_4',\n displayName: 'Soil moisture at depth 4',\n convert: function (x) { return (x[8] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_4',\n displayName: 'Soil temperature at depth 4',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_5',\n displayName: 'Soil moisture at depth 5',\n convert: function (x) { return (x[10] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_5',\n displayName: 'Soil temperature at depth 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_6',\n displayName: 'Soil moisture at depth 6',\n convert: function (x) { return (x[12] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_6',\n displayName: 'Soil temperature at depth 6',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_7',\n displayName: 'Soil moisture at depth 7',\n convert: function (x) { return (x[14] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_7',\n displayName: 'Soil temperature at depth 7',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/payload.json deleted file mode 100644 index c81ef10d..00000000 --- a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020b50000309018a8c09438a9809278a920b3c8aa50c9c8a8c11e08aa500000000000000000b3b" -} diff --git a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/payload_01.json deleted file mode 100644 index ff07d73c..00000000 --- a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "020b5000020b3b" -} diff --git a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/result.json deleted file mode 100644 index 5d2b565d..00000000 --- a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "soil_moisture_at_depth_0": -0.39, - "soil_temperature_at_depth_0": 27, - "soil_moisture_at_depth_1": -0.258, - "soil_temperature_at_depth_1": 27.12, - "soil_moisture_at_depth_2": -0.314, - "soil_temperature_at_depth_2": 27.06, - "soil_moisture_at_depth_3": 0.752, - "soil_temperature_at_depth_3": 27.25, - "soil_moisture_at_depth_4": 1.456, - "soil_temperature_at_depth_4": 27, - "soil_moisture_at_depth_5": 4.152, - "soil_temperature_at_depth_5": 27.25, - "soil_moisture_at_depth_6": -5, - "soil_temperature_at_depth_6": -327.68, - "soil_moisture_at_depth_7": -5, - "soil_temperature_at_depth_7": -327.68, - "battery_voltage": 2.875, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/result_01.json deleted file mode 100644 index 8d9a2da3..00000000 --- a/VENDORS/Decentlab/DL-SMTP/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.875, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/converter.json deleted file mode 100644 index 405738e0..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-SMTP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SMTP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-and-temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'soil_moisture_at_depth_0',\n displayName: 'Soil moisture at depth 0',\n convert: function (x) { return (x[0] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_0',\n displayName: 'Soil temperature at depth 0',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_1',\n displayName: 'Soil moisture at depth 1',\n convert: function (x) { return (x[2] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_1',\n displayName: 'Soil temperature at depth 1',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_2',\n displayName: 'Soil moisture at depth 2',\n convert: function (x) { return (x[4] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_2',\n displayName: 'Soil temperature at depth 2',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_3',\n displayName: 'Soil moisture at depth 3',\n convert: function (x) { return (x[6] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_3',\n displayName: 'Soil temperature at depth 3',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_4',\n displayName: 'Soil moisture at depth 4',\n convert: function (x) { return (x[8] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_4',\n displayName: 'Soil temperature at depth 4',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_5',\n displayName: 'Soil moisture at depth 5',\n convert: function (x) { return (x[10] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_5',\n displayName: 'Soil temperature at depth 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_6',\n displayName: 'Soil moisture at depth 6',\n convert: function (x) { return (x[12] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_6',\n displayName: 'Soil temperature at depth 6',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_7',\n displayName: 'Soil moisture at depth 7',\n convert: function (x) { return (x[14] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_7',\n displayName: 'Soil temperature at depth 7',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/payload.json deleted file mode 100644 index 0aaf18e4..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020b50000309018a8c09438a9809278a920b3c8aa50c9c8a8c11e08aa500000000000000000b3b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/payload_01.json deleted file mode 100644 index e058c5d8..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020b5000020b3b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/result.json deleted file mode 100644 index 7229684d..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "soil_moisture_at_depth_0": -0.39, - "soil_temperature_at_depth_0": 27, - "soil_moisture_at_depth_1": -0.258, - "soil_temperature_at_depth_1": 27.12, - "soil_moisture_at_depth_2": -0.314, - "soil_temperature_at_depth_2": 27.06, - "soil_moisture_at_depth_3": 0.752, - "soil_temperature_at_depth_3": 27.25, - "soil_moisture_at_depth_4": 1.456, - "soil_temperature_at_depth_4": 27, - "soil_moisture_at_depth_5": 4.152, - "soil_temperature_at_depth_5": 27.25, - "soil_moisture_at_depth_6": -5, - "soil_temperature_at_depth_6": -327.68, - "soil_moisture_at_depth_7": -5, - "soil_temperature_at_depth_7": -327.68, - "battery_voltage": 2.875, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/result_01.json deleted file mode 100644 index 1a662469..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.875, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index b6d40a24..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-SMTP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SMTP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-and-temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'soil_moisture_at_depth_0',\n displayName: 'Soil moisture at depth 0',\n convert: function (x) { return (x[0] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_0',\n displayName: 'Soil temperature at depth 0',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_1',\n displayName: 'Soil moisture at depth 1',\n convert: function (x) { return (x[2] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_1',\n displayName: 'Soil temperature at depth 1',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_2',\n displayName: 'Soil moisture at depth 2',\n convert: function (x) { return (x[4] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_2',\n displayName: 'Soil temperature at depth 2',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_3',\n displayName: 'Soil moisture at depth 3',\n convert: function (x) { return (x[6] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_3',\n displayName: 'Soil temperature at depth 3',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_4',\n displayName: 'Soil moisture at depth 4',\n convert: function (x) { return (x[8] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_4',\n displayName: 'Soil temperature at depth 4',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_5',\n displayName: 'Soil moisture at depth 5',\n convert: function (x) { return (x[10] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_5',\n displayName: 'Soil temperature at depth 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_6',\n displayName: 'Soil moisture at depth 6',\n convert: function (x) { return (x[12] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_6',\n displayName: 'Soil temperature at depth 6',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_7',\n displayName: 'Soil moisture at depth 7',\n convert: function (x) { return (x[14] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_7',\n displayName: 'Soil temperature at depth 7',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 0aaf18e4..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020b50000309018a8c09438a9809278a920b3c8aa50c9c8a8c11e08aa500000000000000000b3b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index e058c5d8..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "020b5000020b3b", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 7229684d..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "soil_moisture_at_depth_0": -0.39, - "soil_temperature_at_depth_0": 27, - "soil_moisture_at_depth_1": -0.258, - "soil_temperature_at_depth_1": 27.12, - "soil_moisture_at_depth_2": -0.314, - "soil_temperature_at_depth_2": 27.06, - "soil_moisture_at_depth_3": 0.752, - "soil_temperature_at_depth_3": 27.25, - "soil_moisture_at_depth_4": 1.456, - "soil_temperature_at_depth_4": 27, - "soil_moisture_at_depth_5": 4.152, - "soil_temperature_at_depth_5": 27.25, - "soil_moisture_at_depth_6": -5, - "soil_temperature_at_depth_6": -327.68, - "soil_moisture_at_depth_7": -5, - "soil_temperature_at_depth_7": -327.68, - "battery_voltage": 2.875, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 1a662469..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.875, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index a3e874bd..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-SMTP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SMTP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-and-temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'soil_moisture_at_depth_0',\n displayName: 'Soil moisture at depth 0',\n convert: function (x) { return (x[0] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_0',\n displayName: 'Soil temperature at depth 0',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_1',\n displayName: 'Soil moisture at depth 1',\n convert: function (x) { return (x[2] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_1',\n displayName: 'Soil temperature at depth 1',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_2',\n displayName: 'Soil moisture at depth 2',\n convert: function (x) { return (x[4] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_2',\n displayName: 'Soil temperature at depth 2',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_3',\n displayName: 'Soil moisture at depth 3',\n convert: function (x) { return (x[6] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_3',\n displayName: 'Soil temperature at depth 3',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_4',\n displayName: 'Soil moisture at depth 4',\n convert: function (x) { return (x[8] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_4',\n displayName: 'Soil temperature at depth 4',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_5',\n displayName: 'Soil moisture at depth 5',\n convert: function (x) { return (x[10] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_5',\n displayName: 'Soil temperature at depth 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_6',\n displayName: 'Soil moisture at depth 6',\n convert: function (x) { return (x[12] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_6',\n displayName: 'Soil temperature at depth 6',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_7',\n displayName: 'Soil moisture at depth 7',\n convert: function (x) { return (x[14] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_7',\n displayName: 'Soil temperature at depth 7',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 9c4b28ba..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgtQAAMJAYqMCUOKmAknipILPIqlDJyKjBHgiqUAAAAAAAAAAAs7", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 750c9f50..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgtQAAILOw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 9f55c541..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "soil_moisture_at_depth_0": -0.39, - "soil_temperature_at_depth_0": 27, - "soil_moisture_at_depth_1": -0.258, - "soil_temperature_at_depth_1": 27.12, - "soil_moisture_at_depth_2": -0.314, - "soil_temperature_at_depth_2": 27.06, - "soil_moisture_at_depth_3": 0.752, - "soil_temperature_at_depth_3": 27.25, - "soil_moisture_at_depth_4": 1.456, - "soil_temperature_at_depth_4": 27, - "soil_moisture_at_depth_5": 4.152, - "soil_temperature_at_depth_5": 27.25, - "soil_moisture_at_depth_6": -5, - "soil_temperature_at_depth_6": -327.68, - "soil_moisture_at_depth_7": -5, - "soil_temperature_at_depth_7": -327.68, - "battery_voltage": 2.875, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 7b0465af..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.875, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index b2e4ea39..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-SMTP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-SMTP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-and-temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'soil_moisture_at_depth_0',\n displayName: 'Soil moisture at depth 0',\n convert: function (x) { return (x[0] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_0',\n displayName: 'Soil temperature at depth 0',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_1',\n displayName: 'Soil moisture at depth 1',\n convert: function (x) { return (x[2] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_1',\n displayName: 'Soil temperature at depth 1',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_2',\n displayName: 'Soil moisture at depth 2',\n convert: function (x) { return (x[4] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_2',\n displayName: 'Soil temperature at depth 2',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_3',\n displayName: 'Soil moisture at depth 3',\n convert: function (x) { return (x[6] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_3',\n displayName: 'Soil temperature at depth 3',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_4',\n displayName: 'Soil moisture at depth 4',\n convert: function (x) { return (x[8] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_4',\n displayName: 'Soil temperature at depth 4',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_5',\n displayName: 'Soil moisture at depth 5',\n convert: function (x) { return (x[10] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_5',\n displayName: 'Soil temperature at depth 5',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_6',\n displayName: 'Soil moisture at depth 6',\n convert: function (x) { return (x[12] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_6',\n displayName: 'Soil temperature at depth 6',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'soil_moisture_at_depth_7',\n displayName: 'Soil moisture at depth 7',\n convert: function (x) { return (x[14] - 2500) / 500; }},\n {name: 'soil_temperature_at_depth_7',\n displayName: 'Soil temperature at depth 7',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 9c4b28ba..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgtQAAMJAYqMCUOKmAknipILPIqlDJyKjBHgiqUAAAAAAAAAAAs7", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 750c9f50..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgtQAAILOw==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 9f55c541..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "soil_moisture_at_depth_0": -0.39, - "soil_temperature_at_depth_0": 27, - "soil_moisture_at_depth_1": -0.258, - "soil_temperature_at_depth_1": 27.12, - "soil_moisture_at_depth_2": -0.314, - "soil_temperature_at_depth_2": 27.06, - "soil_moisture_at_depth_3": 0.752, - "soil_temperature_at_depth_3": 27.25, - "soil_moisture_at_depth_4": 1.456, - "soil_temperature_at_depth_4": 27, - "soil_moisture_at_depth_5": 4.152, - "soil_temperature_at_depth_5": 27.25, - "soil_moisture_at_depth_6": -5, - "soil_temperature_at_depth_6": -327.68, - "soil_moisture_at_depth_7": -5, - "soil_temperature_at_depth_7": -327.68, - "battery_voltage": 2.875, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 7b0465af..00000000 --- a/VENDORS/Decentlab/DL-SMTP/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "2896", - "deviceType": "DL-SMTP", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.875, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/info.json b/VENDORS/Decentlab/DL-SMTP/info.json deleted file mode 100644 index b5f7e031..00000000 --- a/VENDORS/Decentlab/DL-SMTP/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/soil-moisture-and-temperature-profile-for-lorawan", - "description": "The Decentlab DL-SMTP consists of soil moisture and temperature sensors. It is suitable for irrigation control, smart agriculture, greenhouse and soilless plantations, parks, and golf courses." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-SMTP/photo.png b/VENDORS/Decentlab/DL-SMTP/photo.png deleted file mode 100644 index 2c35a458..00000000 Binary files a/VENDORS/Decentlab/DL-SMTP/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/converter.json deleted file mode 100644 index 01dac6e4..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-TBRG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TBRG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/tipping-bucket-rain-gauge-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n resolution: 0.1\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return x[0] * this.PARAMETERS.resolution; },\n unit: 'mm'},\n {name: 'precipitation_interval',\n displayName: 'Precipitation interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_precipitation',\n displayName: 'Cumulative precipitation',\n convert: function (x) { return (x[2] + x[3] * 65536) * this.PARAMETERS.resolution; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload.json deleted file mode 100644 index ce91672a..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgL4AAMABAJYQJoAAAxU", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 41240ca1..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgL4AAIMVA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_02.json deleted file mode 100644 index f1e97494..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgL4AAMABAJYQJoAAAxU", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 45214c1c..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgL4AAIMVA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result.json deleted file mode 100644 index 4ad38dda..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "precipitation": 0.4, - "precipitation_interval": 600, - "cumulative_precipitation": 1653.8000000000002, - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_01.json deleted file mode 100644 index 047e6175..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_02.json deleted file mode 100644 index 3771b5eb..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "precipitation": 0.4, - "precipitation_interval": 600, - "cumulative_precipitation": 1653.8000000000002, - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_03.json deleted file mode 100644 index 3864554b..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/converter.json deleted file mode 100644 index 301f89a2..00000000 --- a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-TBRG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TBRG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/tipping-bucket-rain-gauge-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n resolution: 0.1\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return x[0] * this.PARAMETERS.resolution; },\n unit: 'mm'},\n {name: 'precipitation_interval',\n displayName: 'Precipitation interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_precipitation',\n displayName: 'Cumulative precipitation',\n convert: function (x) { return (x[2] + x[3] * 65536) * this.PARAMETERS.resolution; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/payload.json deleted file mode 100644 index fd91f040..00000000 --- a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0202f8000300040258409a00000c54" -} diff --git a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/payload_01.json deleted file mode 100644 index f65dd11f..00000000 --- a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0202f800020c54" -} diff --git a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/result.json deleted file mode 100644 index 65feff73..00000000 --- a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "precipitation": 0.4, - "precipitation_interval": 600, - "cumulative_precipitation": 1653.8000000000002, - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/result_01.json deleted file mode 100644 index 1fb48b39..00000000 --- a/VENDORS/Decentlab/DL-TBRG/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/converter.json deleted file mode 100644 index bd76247f..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-TBRG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TBRG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/tipping-bucket-rain-gauge-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n resolution: 0.1\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return x[0] * this.PARAMETERS.resolution; },\n unit: 'mm'},\n {name: 'precipitation_interval',\n displayName: 'Precipitation interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_precipitation',\n displayName: 'Cumulative precipitation',\n convert: function (x) { return (x[2] + x[3] * 65536) * this.PARAMETERS.resolution; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/payload.json deleted file mode 100644 index f13ef28b..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202f8000300040258409a00000c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/payload_01.json deleted file mode 100644 index c1fe32e4..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202f800020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/result.json deleted file mode 100644 index 35b076c6..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "precipitation": 0.4, - "precipitation_interval": 600, - "cumulative_precipitation": 1653.8000000000002, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/result_01.json deleted file mode 100644 index 6002a4b5..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 632d286a..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-TBRG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TBRG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/tipping-bucket-rain-gauge-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n resolution: 0.1\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return x[0] * this.PARAMETERS.resolution; },\n unit: 'mm'},\n {name: 'precipitation_interval',\n displayName: 'Precipitation interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_precipitation',\n displayName: 'Cumulative precipitation',\n convert: function (x) { return (x[2] + x[3] * 65536) * this.PARAMETERS.resolution; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index f13ef28b..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202f8000300040258409a00000c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index c1fe32e4..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0202f800020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 35b076c6..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "precipitation": 0.4, - "precipitation_interval": 600, - "cumulative_precipitation": 1653.8000000000002, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 6002a4b5..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index b5685fce..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-TBRG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TBRG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/tipping-bucket-rain-gauge-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n resolution: 0.1\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return x[0] * this.PARAMETERS.resolution; },\n unit: 'mm'},\n {name: 'precipitation_interval',\n displayName: 'Precipitation interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_precipitation',\n displayName: 'Cumulative precipitation',\n convert: function (x) { return (x[2] + x[3] * 65536) * this.PARAMETERS.resolution; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 76684b46..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgL4AAMABAJYQJoAAAxU", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 922b3eeb..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgL4AAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 2da0437c..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "precipitation": 0.4, - "precipitation_interval": 600, - "cumulative_precipitation": 1653.8000000000002, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 84cf0ef2..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index bde352c3..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-TBRG", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TBRG',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/tipping-bucket-rain-gauge-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n /* device-specific parameters */\n PARAMETERS: {\n resolution: 0.1\n },\n SENSORS: [\n {length: 4,\n values: [{name: 'precipitation',\n displayName: 'Precipitation',\n convert: function (x) { return x[0] * this.PARAMETERS.resolution; },\n unit: 'mm'},\n {name: 'precipitation_interval',\n displayName: 'Precipitation interval',\n convert: function (x) { return x[1]; },\n unit: 's'},\n {name: 'cumulative_precipitation',\n displayName: 'Cumulative precipitation',\n convert: function (x) { return (x[2] + x[3] * 65536) * this.PARAMETERS.resolution; },\n unit: 'mm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 76684b46..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgL4AAMABAJYQJoAAAxU", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 922b3eeb..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgL4AAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 2da0437c..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "precipitation": 0.4, - "precipitation_interval": 600, - "cumulative_precipitation": 1653.8000000000002, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 84cf0ef2..00000000 --- a/VENDORS/Decentlab/DL-TBRG/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "760", - "deviceType": "DL-TBRG", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/info.json b/VENDORS/Decentlab/DL-TBRG/info.json deleted file mode 100644 index 893b9ee1..00000000 --- a/VENDORS/Decentlab/DL-TBRG/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/tipping-bucket-rain-gauge-for-lorawan", - "description": "The Decentlab DL-TBRG consists of a precipitation sensor for measuring rainfall. It is suitable for precipitation and weather monitoring, flood monitoring, and smart agriculture." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TBRG/photo.png b/VENDORS/Decentlab/DL-TBRG/photo.png deleted file mode 100644 index eb64a53e..00000000 Binary files a/VENDORS/Decentlab/DL-TBRG/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/converter.json deleted file mode 100644 index 04e865c7..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-TP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_12',\n displayName: 'Temperature at level 12',\n convert: function (x) { return (x[12] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_13',\n displayName: 'Temperature at level 13',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_14',\n displayName: 'Temperature at level 14',\n convert: function (x) { return (x[14] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_15',\n displayName: 'Temperature at level 15',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload.json deleted file mode 100644 index 619ebb24..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Aj4+AAOKvIqSiqCKhIqziomKw4qtireKkoqhAAAAAAAAAAAAAAr8", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 3604a83d..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "Aj4+AAIK/A==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_02.json deleted file mode 100644 index b9c44f08..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Aj4+AAOKvIqSiqCKhIqziomKw4qtireKkoqhAAAAAAAAAAAAAAr8", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 9ff11892..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "Aj4+AAIK/A==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result.json deleted file mode 100644 index a5990271..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "temperature_at_level_0": 27.48, - "temperature_at_level_1": 27.06, - "temperature_at_level_2": 27.2, - "temperature_at_level_3": 26.92, - "temperature_at_level_4": 27.39, - "temperature_at_level_5": 26.97, - "temperature_at_level_6": 27.55, - "temperature_at_level_7": 27.33, - "temperature_at_level_8": 27.43, - "temperature_at_level_9": 27.06, - "temperature_at_level_10": 27.21, - "temperature_at_level_11": -327.68, - "temperature_at_level_12": -327.68, - "temperature_at_level_13": -327.68, - "temperature_at_level_14": -327.68, - "temperature_at_level_15": -327.68, - "battery_voltage": 2.812, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_01.json deleted file mode 100644 index a85937fb..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 2.812, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_02.json deleted file mode 100644 index ecf76869..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "temperature_at_level_0": 27.48, - "temperature_at_level_1": 27.06, - "temperature_at_level_2": 27.2, - "temperature_at_level_3": 26.92, - "temperature_at_level_4": 27.39, - "temperature_at_level_5": 26.97, - "temperature_at_level_6": 27.55, - "temperature_at_level_7": 27.33, - "temperature_at_level_8": 27.43, - "temperature_at_level_9": 27.06, - "temperature_at_level_10": 27.21, - "temperature_at_level_11": -327.68, - "temperature_at_level_12": -327.68, - "temperature_at_level_13": -327.68, - "temperature_at_level_14": -327.68, - "temperature_at_level_15": -327.68, - "battery_voltage": 2.812, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_03.json deleted file mode 100644 index f9475772..00000000 --- a/VENDORS/Decentlab/DL-TP/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 2.812, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-TP/LORIOT/uplink/converter.json deleted file mode 100644 index f6f51bbc..00000000 --- a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-TP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_12',\n displayName: 'Temperature at level 12',\n convert: function (x) { return (x[12] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_13',\n displayName: 'Temperature at level 13',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_14',\n displayName: 'Temperature at level 14',\n convert: function (x) { return (x[14] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_15',\n displayName: 'Temperature at level 15',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-TP/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-TP/LORIOT/uplink/payload.json deleted file mode 100644 index bed13d96..00000000 --- a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "023e3e00038abc8a928aa08a848ab38a898ac38aad8ab78a928aa1000000000000000000000afc" -} diff --git a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-TP/LORIOT/uplink/payload_01.json deleted file mode 100644 index 009faabc..00000000 --- a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "023e3e00020afc" -} diff --git a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-TP/LORIOT/uplink/result.json deleted file mode 100644 index 1ebf2ca4..00000000 --- a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "temperature_at_level_0": 27.48, - "temperature_at_level_1": 27.06, - "temperature_at_level_2": 27.2, - "temperature_at_level_3": 26.92, - "temperature_at_level_4": 27.39, - "temperature_at_level_5": 26.97, - "temperature_at_level_6": 27.55, - "temperature_at_level_7": 27.33, - "temperature_at_level_8": 27.43, - "temperature_at_level_9": 27.06, - "temperature_at_level_10": 27.21, - "temperature_at_level_11": -327.68, - "temperature_at_level_12": -327.68, - "temperature_at_level_13": -327.68, - "temperature_at_level_14": -327.68, - "temperature_at_level_15": -327.68, - "battery_voltage": 2.812, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-TP/LORIOT/uplink/result_01.json deleted file mode 100644 index 7b284ed3..00000000 --- a/VENDORS/Decentlab/DL-TP/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 2.812, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-TP/ThingPark/uplink/converter.json deleted file mode 100644 index 36d1fa5e..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-TP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_12',\n displayName: 'Temperature at level 12',\n convert: function (x) { return (x[12] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_13',\n displayName: 'Temperature at level 13',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_14',\n displayName: 'Temperature at level 14',\n convert: function (x) { return (x[14] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_15',\n displayName: 'Temperature at level 15',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-TP/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-TP/ThingPark/uplink/payload.json deleted file mode 100644 index ab67f846..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "023e3e00038abc8a928aa08a848ab38a898ac38aad8ab78a928aa1000000000000000000000afc", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-TP/ThingPark/uplink/payload_01.json deleted file mode 100644 index af95e928..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "023e3e00020afc", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-TP/ThingPark/uplink/result.json deleted file mode 100644 index 8e482c1a..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "temperature_at_level_0": 27.48, - "temperature_at_level_1": 27.06, - "temperature_at_level_2": 27.2, - "temperature_at_level_3": 26.92, - "temperature_at_level_4": 27.39, - "temperature_at_level_5": 26.97, - "temperature_at_level_6": 27.55, - "temperature_at_level_7": 27.33, - "temperature_at_level_8": 27.43, - "temperature_at_level_9": 27.06, - "temperature_at_level_10": 27.21, - "temperature_at_level_11": -327.68, - "temperature_at_level_12": -327.68, - "temperature_at_level_13": -327.68, - "temperature_at_level_14": -327.68, - "temperature_at_level_15": -327.68, - "battery_voltage": 2.812, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-TP/ThingPark/uplink/result_01.json deleted file mode 100644 index ee508988..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.812, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 5cffd522..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-TP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_12',\n displayName: 'Temperature at level 12',\n convert: function (x) { return (x[12] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_13',\n displayName: 'Temperature at level 13',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_14',\n displayName: 'Temperature at level 14',\n convert: function (x) { return (x[14] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_15',\n displayName: 'Temperature at level 15',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index ab67f846..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "023e3e00038abc8a928aa08a848ab38a898ac38aad8ab78a928aa1000000000000000000000afc", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index af95e928..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "023e3e00020afc", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 8e482c1a..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "temperature_at_level_0": 27.48, - "temperature_at_level_1": 27.06, - "temperature_at_level_2": 27.2, - "temperature_at_level_3": 26.92, - "temperature_at_level_4": 27.39, - "temperature_at_level_5": 26.97, - "temperature_at_level_6": 27.55, - "temperature_at_level_7": 27.33, - "temperature_at_level_8": 27.43, - "temperature_at_level_9": 27.06, - "temperature_at_level_10": 27.21, - "temperature_at_level_11": -327.68, - "temperature_at_level_12": -327.68, - "temperature_at_level_13": -327.68, - "temperature_at_level_14": -327.68, - "temperature_at_level_15": -327.68, - "battery_voltage": 2.812, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index ee508988..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 2.812, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 07b5d8ed..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-TP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_12',\n displayName: 'Temperature at level 12',\n convert: function (x) { return (x[12] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_13',\n displayName: 'Temperature at level 13',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_14',\n displayName: 'Temperature at level 14',\n convert: function (x) { return (x[14] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_15',\n displayName: 'Temperature at level 15',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 7d9e0c39..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Aj4+AAOKvIqSiqCKhIqziomKw4qtireKkoqhAAAAAAAAAAAAAAr8", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index ad24529d..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Aj4+AAIK/A==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 9257699d..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "temperature_at_level_0": 27.48, - "temperature_at_level_1": 27.06, - "temperature_at_level_2": 27.2, - "temperature_at_level_3": 26.92, - "temperature_at_level_4": 27.39, - "temperature_at_level_5": 26.97, - "temperature_at_level_6": 27.55, - "temperature_at_level_7": 27.33, - "temperature_at_level_8": 27.43, - "temperature_at_level_9": 27.06, - "temperature_at_level_10": 27.21, - "temperature_at_level_11": -327.68, - "temperature_at_level_12": -327.68, - "temperature_at_level_13": -327.68, - "temperature_at_level_14": -327.68, - "temperature_at_level_15": -327.68, - "battery_voltage": 2.812, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 60f96739..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.812, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index cfb8edb8..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-TP", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TP',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/temperature-profile-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 16,\n values: [{name: 'temperature_at_level_0',\n displayName: 'Temperature at level 0',\n convert: function (x) { return (x[0] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_1',\n displayName: 'Temperature at level 1',\n convert: function (x) { return (x[1] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_2',\n displayName: 'Temperature at level 2',\n convert: function (x) { return (x[2] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_3',\n displayName: 'Temperature at level 3',\n convert: function (x) { return (x[3] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_4',\n displayName: 'Temperature at level 4',\n convert: function (x) { return (x[4] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_5',\n displayName: 'Temperature at level 5',\n convert: function (x) { return (x[5] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_6',\n displayName: 'Temperature at level 6',\n convert: function (x) { return (x[6] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_7',\n displayName: 'Temperature at level 7',\n convert: function (x) { return (x[7] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_8',\n displayName: 'Temperature at level 8',\n convert: function (x) { return (x[8] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_9',\n displayName: 'Temperature at level 9',\n convert: function (x) { return (x[9] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_10',\n displayName: 'Temperature at level 10',\n convert: function (x) { return (x[10] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_11',\n displayName: 'Temperature at level 11',\n convert: function (x) { return (x[11] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_12',\n displayName: 'Temperature at level 12',\n convert: function (x) { return (x[12] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_13',\n displayName: 'Temperature at level 13',\n convert: function (x) { return (x[13] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_14',\n displayName: 'Temperature at level 14',\n convert: function (x) { return (x[14] - 32768) / 100; },\n unit: '°C'},\n {name: 'temperature_at_level_15',\n displayName: 'Temperature at level 15',\n convert: function (x) { return (x[15] - 32768) / 100; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 7d9e0c39..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Aj4+AAOKvIqSiqCKhIqziomKw4qtireKkoqhAAAAAAAAAAAAAAr8", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index ad24529d..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "Aj4+AAIK/A==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 9257699d..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "temperature_at_level_0": 27.48, - "temperature_at_level_1": 27.06, - "temperature_at_level_2": 27.2, - "temperature_at_level_3": 26.92, - "temperature_at_level_4": 27.39, - "temperature_at_level_5": 26.97, - "temperature_at_level_6": 27.55, - "temperature_at_level_7": 27.33, - "temperature_at_level_8": 27.43, - "temperature_at_level_9": 27.06, - "temperature_at_level_10": 27.21, - "temperature_at_level_11": -327.68, - "temperature_at_level_12": -327.68, - "temperature_at_level_13": -327.68, - "temperature_at_level_14": -327.68, - "temperature_at_level_15": -327.68, - "battery_voltage": 2.812, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 60f96739..00000000 --- a/VENDORS/Decentlab/DL-TP/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "15934", - "deviceType": "DL-TP", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 2.812, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/info.json b/VENDORS/Decentlab/DL-TP/info.json deleted file mode 100644 index e57d1c5b..00000000 --- a/VENDORS/Decentlab/DL-TP/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/temperature-profile-for-lorawan", - "description": "The Decentlab DL-TP comes with temperature profiling sensors that can be used in monitoring of glaciers, lakes, ocean, permafrost, dike, dam and soils." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TP/photo.png b/VENDORS/Decentlab/DL-TP/photo.png deleted file mode 100644 index 96097229..00000000 Binary files a/VENDORS/Decentlab/DL-TP/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/converter.json deleted file mode 100644 index 97b7ddf0..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-TRS11", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS11',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/payload.json deleted file mode 100644 index 7cd8fbeb..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhDVAANGP4ELDHk=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 2ce5242e..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhDVAANGP4ELDHk=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/result.json deleted file mode 100644 index 90778cde..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "4309", - "deviceType": "DL-TRS11", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "dielectric_permittivity": 1.0259018697121183, - "volumetric_water_content": 0.0019605699999999393, - "soil_temperature": 26.7, - "battery_voltage": 3.193, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/result_01.json deleted file mode 100644 index 8e66514b..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "4309", - "deviceType": "DL-TRS11", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "dielectric_permittivity": 1.0259018697121183, - "volumetric_water_content": 0.0019605699999999393, - "soil_temperature": 26.7, - "battery_voltage": 3.193, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/converter.json deleted file mode 100644 index c99bd9b4..00000000 --- a/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-TRS11", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS11',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/payload.json deleted file mode 100644 index 779416b2..00000000 --- a/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0210d50003463f810b0c79" -} diff --git a/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/result.json deleted file mode 100644 index d96ba420..00000000 --- a/VENDORS/Decentlab/DL-TRS11/LORIOT/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "4309", - "deviceType": "DL-TRS11", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "dielectric_permittivity": 1.0259018697121183, - "volumetric_water_content": 0.0019605699999999393, - "soil_temperature": 26.7, - "battery_voltage": 3.193, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/converter.json deleted file mode 100644 index d6181926..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-TRS11", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS11',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/payload.json deleted file mode 100644 index 8e31657a..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0210d50003463f810b0c79", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/result.json deleted file mode 100644 index 3d04d787..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingPark/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "4309", - "deviceType": "DL-TRS11", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dielectric_permittivity": 1.0259018697121183, - "volumetric_water_content": 0.0019605699999999393, - "soil_temperature": 26.7, - "battery_voltage": 3.193, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index c7712837..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-TRS11", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS11',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 8e31657a..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0210d50003463f810b0c79", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 3d04d787..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "4309", - "deviceType": "DL-TRS11", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dielectric_permittivity": 1.0259018697121183, - "volumetric_water_content": 0.0019605699999999393, - "soil_temperature": 26.7, - "battery_voltage": 3.193, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index d701fee9..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-TRS11", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS11',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 2c2cb614..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhDVAANGP4ELDHk=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index a7a239ac..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "4309", - "deviceType": "DL-TRS11", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dielectric_permittivity": 1.0259018697121183, - "volumetric_water_content": 0.0019605699999999393, - "soil_temperature": 26.7, - "battery_voltage": 3.193, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 5097bcc5..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-TRS11", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS11',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 2c2cb614..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhDVAANGP4ELDHk=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index a7a239ac..00000000 --- a/VENDORS/Decentlab/DL-TRS11/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "4309", - "deviceType": "DL-TRS11", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dielectric_permittivity": 1.0259018697121183, - "volumetric_water_content": 0.0019605699999999393, - "soil_temperature": 26.7, - "battery_voltage": 3.193, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/info.json b/VENDORS/Decentlab/DL-TRS11/info.json deleted file mode 100644 index 806e89a2..00000000 --- a/VENDORS/Decentlab/DL-TRS11/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan", - "description": "The Decentlab DL-TRS11 includes a volumetric water content (VWC), temperature, and dielectric permittivity sensor. It is suitable for irrigation control, smart agriculture, greenhouse and soilless plantations, parks, and golf courses." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS11/photo.png b/VENDORS/Decentlab/DL-TRS11/photo.png deleted file mode 100644 index a3e1bbb3..00000000 Binary files a/VENDORS/Decentlab/DL-TRS11/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/converter.json deleted file mode 100644 index 75da0415..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-TRS12", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS12',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 3,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload.json deleted file mode 100644 index 954723c0..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhDTAANGvoE9AAAMgA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 875b3bbf..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhDTAAIMgA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 30dbc7cc..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhDTAANGvoE9AAAMgA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_03.json deleted file mode 100644 index aeac16f4..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhDTAAIMgA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result.json deleted file mode 100644 index 2ec8a066..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "dielectric_permittivity": 1.1831248966814998, - "volumetric_water_content": 0.006886900000000029, - "soil_temperature": 31.7, - "electrical_conductivity": 0, - "battery_voltage": 3.2, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_01.json deleted file mode 100644 index f2829b1a..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.2, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_02.json deleted file mode 100644 index 4639542b..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "dielectric_permittivity": 1.1831248966814998, - "volumetric_water_content": 0.006886900000000029, - "soil_temperature": 31.7, - "electrical_conductivity": 0, - "battery_voltage": 3.2, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_03.json deleted file mode 100644 index 0b9e3454..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.2, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/converter.json deleted file mode 100644 index 7d7a5d12..00000000 --- a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-TRS12", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS12',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 3,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/payload.json deleted file mode 100644 index 685a7aac..00000000 --- a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0210d3000346be813d00000c80" -} diff --git a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/payload_01.json deleted file mode 100644 index c6b9d599..00000000 --- a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0210d300020c80" -} diff --git a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/result.json deleted file mode 100644 index 4dd7cf26..00000000 --- a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "dielectric_permittivity": 1.1831248966814998, - "volumetric_water_content": 0.006886900000000029, - "soil_temperature": 31.7, - "electrical_conductivity": 0, - "battery_voltage": 3.2, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/result_01.json deleted file mode 100644 index ad0386c9..00000000 --- a/VENDORS/Decentlab/DL-TRS12/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.2, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/converter.json deleted file mode 100644 index 42688da0..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-TRS12", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS12',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 3,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/payload.json deleted file mode 100644 index 6ec1b001..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0210d3000346be813d00000c80", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/payload_01.json deleted file mode 100644 index ee1ee61b..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0210d300020c80", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/result.json deleted file mode 100644 index f74ac3e0..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dielectric_permittivity": 1.1831248966814998, - "volumetric_water_content": 0.006886900000000029, - "soil_temperature": 31.7, - "electrical_conductivity": 0, - "battery_voltage": 3.2, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/result_01.json deleted file mode 100644 index ca34b4c5..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.2, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 466b07f6..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-TRS12", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS12',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 3,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 6ec1b001..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0210d3000346be813d00000c80", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index ee1ee61b..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0210d300020c80", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index f74ac3e0..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dielectric_permittivity": 1.1831248966814998, - "volumetric_water_content": 0.006886900000000029, - "soil_temperature": 31.7, - "electrical_conductivity": 0, - "battery_voltage": 3.2, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index ca34b4c5..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.2, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 43e24ee3..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-TRS12", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS12',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 3,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 136e17dc..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhDTAANGvoE9AAAMgA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 43aa0375..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhDTAAIMgA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index de3c08e0..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dielectric_permittivity": 1.1831248966814998, - "volumetric_water_content": 0.006886900000000029, - "soil_temperature": 31.7, - "electrical_conductivity": 0, - "battery_voltage": 3.2, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 31b23aef..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.2, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 39262146..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-TRS12", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS12',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 3,\n values: [{name: 'dielectric_permittivity',\n displayName: 'Dielectric permittivity',\n convert: function (x) { return Math.pow(0.000000002887 * Math.pow(x[0]/10, 3) - 0.0000208 * Math.pow(x[0]/10, 2) + 0.05276 * (x[0]/10) - 43.39, 2); }},\n {name: 'volumetric_water_content',\n displayName: 'Volumetric water content',\n convert: function (x) { return x[0]/10 * 0.0003879 - 0.6956; },\n unit: 'm³⋅m⁻³'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'},\n {name: 'electrical_conductivity',\n displayName: 'Electrical conductivity',\n convert: function (x) { return x[2]; },\n unit: 'µS⋅cm⁻¹'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 136e17dc..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhDTAANGvoE9AAAMgA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 43aa0375..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhDTAAIMgA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index de3c08e0..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dielectric_permittivity": 1.1831248966814998, - "volumetric_water_content": 0.006886900000000029, - "soil_temperature": 31.7, - "electrical_conductivity": 0, - "battery_voltage": 3.2, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 31b23aef..00000000 --- a/VENDORS/Decentlab/DL-TRS12/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4307", - "deviceType": "DL-TRS12", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.2, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/info.json b/VENDORS/Decentlab/DL-TRS12/info.json deleted file mode 100644 index 579dc843..00000000 --- a/VENDORS/Decentlab/DL-TRS12/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/soil-moisture-temperature-and-electrical-conductivity-sensor-for-lorawan", - "description": "The Decentlab DL-TRS12 includes a volumetric water content (VWC), temperature, and dielectric permittivity sensor. It is suitable for irrigation control, smart agriculture, greenhouse and soilless plantations, parks, and golf courses." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS12/photo.png b/VENDORS/Decentlab/DL-TRS12/photo.png deleted file mode 100644 index a3e1bbb3..00000000 Binary files a/VENDORS/Decentlab/DL-TRS12/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/converter.json deleted file mode 100644 index b19412df..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-TRS21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-water-potential-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'water_potential',\n displayName: 'Water potential',\n convert: function (x) { return -(x[0] / 10); },\n unit: 'kPa'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload.json deleted file mode 100644 index 5f432a8e..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgGSAAMAdYChDCU=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_01.json deleted file mode 100644 index c6b77092..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AgGSAAIMJQ==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_02.json deleted file mode 100644 index cedf432f..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgGSAAMAdYChDCU=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 4746e14a..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AgGSAAIMJQ==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result.json deleted file mode 100644 index 07e6480c..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "water_potential": -11.7, - "soil_temperature": 16.1, - "battery_voltage": 3.109, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_01.json deleted file mode 100644 index 89f51048..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_02.json deleted file mode 100644 index 45ff0952..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "water_potential": -11.7, - "soil_temperature": 16.1, - "battery_voltage": 3.109, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_03.json deleted file mode 100644 index 3460c82a..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/converter.json deleted file mode 100644 index 4f58087c..00000000 --- a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-TRS21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-water-potential-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'water_potential',\n displayName: 'Water potential',\n convert: function (x) { return -(x[0] / 10); },\n unit: 'kPa'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/payload.json deleted file mode 100644 index cd9a304d..00000000 --- a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0201920003007580a10c25" -} diff --git a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/payload_01.json deleted file mode 100644 index b830136f..00000000 --- a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02019200020c25" -} diff --git a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/result.json deleted file mode 100644 index 542b8b12..00000000 --- a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "water_potential": -11.7, - "soil_temperature": 16.1, - "battery_voltage": 3.109, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/result_01.json deleted file mode 100644 index 3af3c52f..00000000 --- a/VENDORS/Decentlab/DL-TRS21/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/converter.json deleted file mode 100644 index 04064359..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-TRS21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-water-potential-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'water_potential',\n displayName: 'Water potential',\n convert: function (x) { return -(x[0] / 10); },\n unit: 'kPa'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/payload.json deleted file mode 100644 index 1a4dcafb..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0201920003007580a10c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/payload_01.json deleted file mode 100644 index fe612183..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02019200020c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/result.json deleted file mode 100644 index 3daa3682..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "water_potential": -11.7, - "soil_temperature": 16.1, - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/result_01.json deleted file mode 100644 index af6d4112..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index cd0cf4b6..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-TRS21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-water-potential-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'water_potential',\n displayName: 'Water potential',\n convert: function (x) { return -(x[0] / 10); },\n unit: 'kPa'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 1a4dcafb..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0201920003007580a10c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index fe612183..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02019200020c25", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 3daa3682..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "water_potential": -11.7, - "soil_temperature": 16.1, - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index af6d4112..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 733a6340..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-TRS21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-water-potential-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'water_potential',\n displayName: 'Water potential',\n convert: function (x) { return -(x[0] / 10); },\n unit: 'kPa'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 8c9e89da..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgGSAAMAdYChDCU=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 788ae912..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgGSAAIMJQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index d5ad9bd3..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "water_potential": -11.7, - "soil_temperature": 16.1, - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index c2b85d44..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 3d0dee2f..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-TRS21", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-TRS21',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/soil-water-potential-and-temperature-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'water_potential',\n displayName: 'Water potential',\n convert: function (x) { return -(x[0] / 10); },\n unit: 'kPa'},\n {name: 'soil_temperature',\n displayName: 'Soil temperature',\n convert: function (x) { return (x[1] - 32768) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 8c9e89da..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgGSAAMAdYChDCU=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 788ae912..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AgGSAAIMJQ==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index d5ad9bd3..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "water_potential": -11.7, - "soil_temperature": 16.1, - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index c2b85d44..00000000 --- a/VENDORS/Decentlab/DL-TRS21/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "402", - "deviceType": "DL-TRS21", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.109, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/info.json b/VENDORS/Decentlab/DL-TRS21/info.json deleted file mode 100644 index f80d54af..00000000 --- a/VENDORS/Decentlab/DL-TRS21/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/soil-water-potential-and-temperature-sensor-for-lorawan", - "description": "The Decentlab DL-TRS21 is a soil water potential and temperature sensor for LoRaWAN®. Suitable for applications such as irrigation control, smart agriculture, parks, and golf courses." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-TRS21/photo.png b/VENDORS/Decentlab/DL-TRS21/photo.png deleted file mode 100644 index 2a219148..00000000 Binary files a/VENDORS/Decentlab/DL-TRS21/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/converter.json deleted file mode 100644 index caa0bead..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-WRM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-WRM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'head_temperature',\n displayName: 'Head temperature',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload.json deleted file mode 100644 index 93d64bc5..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhoQAAdkoHmxBPkExAxg", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 31e1ddc3..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhoQAAQMYA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_02.json deleted file mode 100644 index 90e86bef..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhoQAAdkoHmxBPkExAxg", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 4506715a..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhoQAAQMYA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result.json deleted file mode 100644 index 64a93e69..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "surface_temperature": 27.3, - "head_temperature": 22, - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_01.json deleted file mode 100644 index f7bc3fbb..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_02.json deleted file mode 100644 index 3ececbe6..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "surface_temperature": 27.3, - "head_temperature": 22, - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_03.json deleted file mode 100644 index ac1be7a3..00000000 --- a/VENDORS/Decentlab/DL-WRM/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/converter.json deleted file mode 100644 index a14a960b..00000000 --- a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-WRM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-WRM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'head_temperature',\n displayName: 'Head temperature',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/payload.json deleted file mode 100644 index 006d941e..00000000 --- a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "021a10000764a079b104f904c40c60" -} diff --git a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/payload_01.json deleted file mode 100644 index 1b8af428..00000000 --- a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "021a1000040c60" -} diff --git a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/result.json deleted file mode 100644 index f22f947c..00000000 --- a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "surface_temperature": 27.3, - "head_temperature": 22, - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/result_01.json deleted file mode 100644 index 3bc2271e..00000000 --- a/VENDORS/Decentlab/DL-WRM/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/converter.json deleted file mode 100644 index 01e8eaab..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-WRM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-WRM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'head_temperature',\n displayName: 'Head temperature',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/payload.json deleted file mode 100644 index ae806a4b..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "021a10000764a079b104f904c40c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/payload_01.json deleted file mode 100644 index e7d8f4eb..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "021a1000040c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/result.json deleted file mode 100644 index 7d2fe956..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "surface_temperature": 27.3, - "head_temperature": 22, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/result_01.json deleted file mode 100644 index b0097a0c..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 680bfaef..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-WRM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-WRM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'head_temperature',\n displayName: 'Head temperature',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index ae806a4b..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "021a10000764a079b104f904c40c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index e7d8f4eb..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "021a1000040c60", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 7d2fe956..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "surface_temperature": 27.3, - "head_temperature": 22, - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index b0097a0c..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index a3f69549..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-WRM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-WRM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'head_temperature',\n displayName: 'Head temperature',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index 60e04f36..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhoQAAdkoHmxBPkExAxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index 6b1ee431..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhoQAAQMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index ddf981d8..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "surface_temperature": 27.3, - "head_temperature": 22, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 2cfcfc24..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 35f4e5cb..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-WRM", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-WRM',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/winter-road-maintenance-sensor-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'air_temperature',\n displayName: 'Air temperature',\n convert: function (x) { return 175 * x[0] / 65535 - 45; },\n unit: '°C'},\n {name: 'air_humidity',\n displayName: 'Air humidity',\n convert: function (x) { return 100 * x[1] / 65535; },\n unit: '%'}]},\n {length: 2,\n values: [{name: 'surface_temperature',\n displayName: 'Surface temperature',\n convert: function (x) { return (x[0] - 1000) / 10; },\n unit: '°C'},\n {name: 'head_temperature',\n displayName: 'Head temperature',\n convert: function (x) { return (x[1] - 1000) / 10; },\n unit: '°C'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index 60e04f36..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhoQAAdkoHmxBPkExAxg", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index 6b1ee431..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhoQAAQMYA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index ddf981d8..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "air_temperature": 23.787670710307466, - "air_humidity": 47.536430914778364, - "surface_temperature": 27.3, - "head_temperature": 22, - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 2cfcfc24..00000000 --- a/VENDORS/Decentlab/DL-WRM/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "6672", - "deviceType": "DL-WRM", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.168, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/info.json b/VENDORS/Decentlab/DL-WRM/info.json deleted file mode 100644 index 2ea435d2..00000000 --- a/VENDORS/Decentlab/DL-WRM/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/winter-road-maintenance-sensor-for-lorawan", - "description": "The Decentlab DL-WRM includes an infrared pyrometer, temperature, and humidity sensors. It is suitable for use in winter road maintenance, frost alarming, ice alerting, and smart agriculture." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-WRM/photo.png b/VENDORS/Decentlab/DL-WRM/photo.png deleted file mode 100644 index 0abd94f9..00000000 Binary files a/VENDORS/Decentlab/DL-WRM/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/converter.json deleted file mode 100644 index 4282ac6f..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ZN1", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN1',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dendrometer_position',\n displayName: 'Dendrometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload.json deleted file mode 100644 index 7cd4f67c..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAANAmgCGDFQ=", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 4e388114..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAAIMVA==", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_02.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_02.json deleted file mode 100644 index aa604fc2..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_02.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAANAmgCGDFQ=", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_03.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_03.json deleted file mode 100644 index 797b50bd..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/payload_03.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAAIMVA==", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result.json deleted file mode 100644 index 05cf0455..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "dendrometer_position": 976.9296646118164, - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_01.json deleted file mode 100644 index 74ae9413..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_02.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_02.json deleted file mode 100644 index 999fe2d7..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_02.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "dendrometer_position": 976.9296646118164, - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_03.json b/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_03.json deleted file mode 100644 index 2eb0397b..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ChirpStack/uplink/result_03.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/converter.json deleted file mode 100644 index 49e0a408..00000000 --- a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ZN1", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN1',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dendrometer_position',\n displayName: 'Dendrometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/payload.json deleted file mode 100644 index 6aa307ce..00000000 --- a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0211110003409a00860c54" -} diff --git a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/payload_01.json b/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/payload_01.json deleted file mode 100644 index b4b6220e..00000000 --- a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/payload_01.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "02111100020c54" -} diff --git a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/result.json deleted file mode 100644 index 00d8d37f..00000000 --- a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "dendrometer_position": 976.9296646118164, - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/result_01.json b/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/result_01.json deleted file mode 100644 index 1c96e982..00000000 --- a/VENDORS/Decentlab/DL-ZN1/LORIOT/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/converter.json deleted file mode 100644 index 760a4d26..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ZN1", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN1',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dendrometer_position',\n displayName: 'Dendrometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/payload.json deleted file mode 100644 index eb142f74..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00860c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/payload_01.json b/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/payload_01.json deleted file mode 100644 index 14a91a75..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02111100020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/result.json deleted file mode 100644 index 1ae2211b..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dendrometer_position": 976.9296646118164, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/result_01.json b/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/result_01.json deleted file mode 100644 index 1041e5c0..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingPark/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 17a2899f..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ZN1", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN1',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dendrometer_position',\n displayName: 'Dendrometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index eb142f74..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00860c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/payload_01.json b/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/payload_01.json deleted file mode 100644 index 14a91a75..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/payload_01.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "02111100020c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 1ae2211b..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dendrometer_position": 976.9296646118164, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/result_01.json b/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/result_01.json deleted file mode 100644 index 1041e5c0..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingParkEnterprise/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 6572bd4b..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ZN1", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN1',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dendrometer_position',\n displayName: 'Dendrometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index ab8d1044..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/payload_01.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/payload_01.json deleted file mode 100644 index b0ea35ca..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index 0e4588dc..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dendrometer_position": 976.9296646118164, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/result_01.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/result_01.json deleted file mode 100644 index 64e44a4c..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackCommunity/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index a72dab12..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ZN1", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN1',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 2,\n values: [{name: 'dendrometer_position',\n displayName: 'Dendrometer position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index ab8d1044..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGDFQ=", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/payload_01.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/payload_01.json deleted file mode 100644 index b0ea35ca..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/payload_01.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAAIMVA==", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index 0e4588dc..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dendrometer_position": 976.9296646118164, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/result_01.json b/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/result_01.json deleted file mode 100644 index 64e44a4c..00000000 --- a/VENDORS/Decentlab/DL-ZN1/ThingsStackIndustries/uplink/result_01.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN1", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/info.json b/VENDORS/Decentlab/DL-ZN1/info.json deleted file mode 100644 index 394b6dfc..00000000 --- a/VENDORS/Decentlab/DL-ZN1/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/dendrometer-for-lorawan", - "description": "The Decentlab DL-ZN1 comes with a linear position dendrometer that can measure the growth of plants and trees. It is suitable for use in irrigation control, smart agriculture, forestry, plantation, and ecophysiology applications." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN1/photo.png b/VENDORS/Decentlab/DL-ZN1/photo.png deleted file mode 100644 index 65eba9c4..00000000 Binary files a/VENDORS/Decentlab/DL-ZN1/photo.png and /dev/null differ diff --git a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/converter.json b/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/converter.json deleted file mode 100644 index a5a7e0c1..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ChirpStack Uplink Decoder for Decentlab DL-ZN2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.data)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.time,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'dendrometer_a_position',\n displayName: 'Dendrometer A Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'},\n {name: 'dendrometer_b_position',\n displayName: 'Dendrometer B Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - (x[2] + x[3]*65536) / 8388608) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fCnt,\n lora_frame_port: message.fPort,\n lora_frequency: message.txInfo.frequency,\n lora_spreading_factor:\n message?.txInfo?.modulation?.lora?.spreadingFactor ||\n message.txInfo.loRaModulationInfo.spreadingFactor,\n lora_dev_eui: (\n message?.deviceInfo?.devEui ||\n base64ToBytes(message.devEUI).reduce(\n (a, x) => a + (\"0\" + x.toString(16)).slice(-2),\n \"\",\n )\n ).toUpperCase(),\n };\n const gwi = message.rxInfo\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr || x.loRaSNR }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/metadata.json deleted file mode 100644 index 1f9359b9..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ChirpStack integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/payload.json b/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/payload.json deleted file mode 100644 index fd07a0d7..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/payload.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "adr": true, - "confirmed": false, - "data": "AhERAANAmgCGMDkAPgxU", - "deduplicationId": "ede7dfc1-a1f5-418c-b009-dc57ebcf0895", - "devAddr": "017d1f70", - "deviceInfo": { - "applicationId": "32dafeb5-0865-4edd-bf1c-3f8d9b07af52", - "applicationName": "MoDus-Sain", - "devEui": "70b3d57ba0003bb8", - "deviceClassEnabled": "CLASS_A", - "deviceName": "PM-15288", - "deviceProfileId": "7ec3de3f-7b87-49ae-8f32-330249122a50", - "deviceProfileName": "dev-prof-Decentlab", - "tags": { - "lts": "true" - }, - "tenantId": "663cc43f-0bf2-48d4-afc6-ff27ba969f10", - "tenantName": "Friloranet" - }, - "dr": 5, - "fCnt": 20, - "fPort": 1, - "rxInfo": [ - { - "context": "AAAAAAAAAAAA/gADaoXb7A==", - "crcStatus": "CRC_OK", - "gatewayId": "fcc23dfffe2e72ed", - "gwTime": "2024-11-12T12:51:50+00:00", - "location": { - "latitude": 46.80179269386121, - "longitude": 7.1381521224975595 - }, - "metadata": { - "region_common_name": "EU868", - "region_config_id": "eu868" - }, - "nsTime": "2024-11-12T12:51:50.819853185+00:00", - "rssi": -106, - "snr": 3.0, - "uplinkId": 3257702911 - } - ], - "time": "2024-11-10T12:51:50+00:00", - "txInfo": { - "frequency": 868300000, - "modulation": { - "lora": { - "bandwidth": 125000, - "codeRate": "CR_4_5", - "spreadingFactor": 7 - } - } - } -} diff --git a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/payload_01.json b/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/payload_01.json deleted file mode 100644 index 0e4b10b2..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/payload_01.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "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": "AhERAANAmgCGMDkAPgxU", - "objectJSON": "{\"temperatureSensor\":25,\"humiditySensor\":32}", - "tags": { - "key": "value" - } -} diff --git a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/result.json b/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/result.json deleted file mode 100644 index 69a88bc9..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN2", - "attributes": { - "lora_dev_eui": "70B3D57BA0003BB8", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": "2024-11-10T12:51:50+00:00", - "values": { - "dendrometer_a_position": 976.9296646118164, - "dendrometer_b_position": 11259.996891021729, - "battery_voltage": 3.156, - "lora_frame_counter": 20, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_spreading_factor": 7, - "lora_rssi": -106, - "lora_snr": 3 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/result_01.json b/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/result_01.json deleted file mode 100644 index 42bd6c53..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ChirpStack/uplink/result_01.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN2", - "attributes": { - "lora_dev_eui": "0202020202020202", - "protocol_version": 2 - }, - "telemetry": [ - { - "values": { - "dendrometer_a_position": 976.9296646118164, - "dendrometer_b_position": 11259.996891021729, - "battery_voltage": 3.156, - "lora_frame_counter": 10, - "lora_frame_port": 5, - "lora_frequency": 868100000, - "lora_spreading_factor": 11, - "lora_rssi": -48, - "lora_snr": 9 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/converter.json b/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/converter.json deleted file mode 100644 index 4340e097..00000000 --- a/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "LORIOT Uplink Decoder for Decentlab DL-ZN2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.data),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: message.ts,\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'dendrometer_a_position',\n displayName: 'Dendrometer A Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'},\n {name: 'dendrometer_b_position',\n displayName: 'Dendrometer B Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - (x[2] + x[3]*65536) / 8388608) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.fcnt,\n lora_frame_port: message.port,\n lora_frequency: message.freq,\n lora_snr: message.snr,\n lora_rssi: message.rssi,\n lora_dev_eui: message.EUI,\n lora_spreading_factor: parseInt(message.dr.replace(/.*SF(\\d+).*/, '$1')),\n };\n if (message.cmd === 'gw') {\n const gwi = message.gws\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n result.rssi = gwi.rssi;\n result.snr = gwi.snr;\n }\n return result;\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/metadata.json deleted file mode 100644 index 5c24f9c2..00000000 --- a/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "LORIOT integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/payload.json b/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/payload.json deleted file mode 100644 index 23a822e7..00000000 --- a/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/payload.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "cmd": "rx", - "EUI": "0004A30B001ADCB5", - "ts": 1501064048945, - "fcnt": 121, - "port": 1, - "freq": 868300000, - "rssi": -119, - "snr": -15.8, - "dr": "SF11 BW125 4/5", - "ack": false, - "data": "0211110003409a00863039003e0c54" -} diff --git a/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/result.json b/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/result.json deleted file mode 100644 index 9a97e112..00000000 --- a/VENDORS/Decentlab/DL-ZN2/LORIOT/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN2", - "attributes": { - "lora_dev_eui": "0004A30B001ADCB5", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1501064048945, - "values": { - "dendrometer_a_position": 976.9296646118164, - "dendrometer_b_position": 11259.996891021729, - "battery_voltage": 3.156, - "lora_frame_counter": 121, - "lora_frame_port": 1, - "lora_frequency": 868300000, - "lora_snr": -15.8, - "lora_rssi": -119, - "lora_spreading_factor": 11 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/converter.json b/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/converter.json deleted file mode 100644 index 75fb55c9..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingPark Uplink Decoder for Decentlab DL-ZN2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'dendrometer_a_position',\n displayName: 'Dendrometer A Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'},\n {name: 'dendrometer_b_position',\n displayName: 'Dendrometer B Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - (x[2] + x[3]*65536) / 8388608) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/metadata.json deleted file mode 100644 index d024aecf..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingPark integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/payload.json b/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/payload.json deleted file mode 100644 index 624bfd44..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00863039003e0c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/result.json b/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/result.json deleted file mode 100644 index 9037aa0a..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingPark/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN2", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dendrometer_a_position": 976.9296646118164, - "dendrometer_b_position": 11259.996891021729, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/converter.json b/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/converter.json deleted file mode 100644 index 79eed79f..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingParkEnterprise Uplink Decoder for Decentlab DL-ZN2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(message.DevEUI_uplink.payload_hex),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.DevEUI_uplink.Time),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'dendrometer_a_position',\n displayName: 'Dendrometer A Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'},\n {name: 'dendrometer_b_position',\n displayName: 'Dendrometer B Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - (x[2] + x[3]*65536) / 8388608) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n return {\n lora_frame_counter: message.DevEUI_uplink.FCntUp,\n lora_frame_port: message.DevEUI_uplink.FPort,\n lora_frequency: message.DevEUI_uplink?.Frequency * 1000000,\n lora_spreading_factor: message.DevEUI_uplink.SpFact,\n lora_dev_eui: message.DevEUI_uplink.DevEUI,\n lora_rssi: message.DevEUI_uplink.LrrRSSI,\n lora_snr: message.DevEUI_uplink.LrrSNR,\n };\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/metadata.json deleted file mode 100644 index 47c01690..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingParkEnterprise integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/payload.json b/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/payload.json deleted file mode 100644 index 624bfd44..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/payload.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "DevEUI_uplink": { - "Time": "2024-11-28T21:08:22.138+00:00", - "DevEUI": "70B3D57BA000156B", - "FPort": 1, - "FCntUp": 26, - "LostUplinksAS": 0, - "ADRbit": 1, - "MType": 2, - "FCntDn": 2, - "payload_hex": "0211110003409a00863039003e0c54", - "mic_hex": "e7214986", - "Lrcid": "00000211", - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547, - "SpFact": 9, - "SubBand": "G0", - "Channel": "LC1", - "Lrrid": "100019D4", - "Late": 0, - "LrrLAT": 32.516357, - "LrrLON": -106.824348, - "Lrrs": { - "Lrr": [ - { - "Lrrid": "100019D4", - "Chain": 0, - "LrrRSSI": -114.0, - "LrrSNR": 4.75, - "LrrESP": -115.2547 - } - ] - }, - "DevLrrCnt": 1, - "CustomerID": "100045194", - "CustomerData": { - "loc": { - "lat": "32.592782", - "lon": "-106.927742" - }, - "alr": { - "pro": "DL/TBRG", - "ver": "1" - }, - "tags": ["EnvironSens", "RainGauge", "CDRRC"], - "doms": [], - "name": "RainGauge 5483_Test" - }, - "BaseStationData": { - "doms": [], - "name": "iStation US #6_CDRRC_Summerford" - }, - "ModelCfg": "0", - "DriverCfg": { - "mod": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - }, - "app": { - "pId": "dl", - "mId": "dl-tbrg", - "ver": "1" - } - }, - "InstantPER": 0.0, - "MeanPER": 0.037037, - "DevAddr": "00FDA112", - "TxPower": 18.0, - "NbTrans": 2, - "Frequency": 902.5, - "DynamicClass": "A" - } -} diff --git a/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/result.json b/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/result.json deleted file mode 100644 index 9037aa0a..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingParkEnterprise/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN2", - "attributes": { - "lora_dev_eui": "70B3D57BA000156B", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1732828102138, - "values": { - "dendrometer_a_position": 976.9296646118164, - "dendrometer_b_position": 11259.996891021729, - "battery_voltage": 3.156, - "lora_frame_counter": 26, - "lora_frame_port": 1, - "lora_frequency": 902500000, - "lora_spreading_factor": 9, - "lora_rssi": -114, - "lora_snr": 4.75 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/converter.json b/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/converter.json deleted file mode 100644 index 395da264..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackCommunity Uplink Decoder for Decentlab DL-ZN2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'dendrometer_a_position',\n displayName: 'Dendrometer A Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'},\n {name: 'dendrometer_b_position',\n displayName: 'Dendrometer B Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - (x[2] + x[3]*65536) / 8388608) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/metadata.json deleted file mode 100644 index 11a4de83..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackCommunity integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/payload.json b/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/payload.json deleted file mode 100644 index a1a4e231..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGMDkAPgxU", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/result.json b/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/result.json deleted file mode 100644 index deca9754..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingsStackCommunity/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN2", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dendrometer_a_position": 976.9296646118164, - "dendrometer_b_position": 11259.996891021729, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/converter.json b/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/converter.json deleted file mode 100644 index 4184306b..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/converter.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "ThingsStackIndustries Uplink Decoder for Decentlab DL-ZN2", - "type": "UPLINK", - "debugMode": true, - "edgeTemplate": false, - "configuration": { - "scriptLang": "JS", - "updateOnlyKeys": [ - "lora_frame_counter", - "lora_frame_port", - "lora_frequency", - "lora_spreading_factor", - "lora_rssi", - "lora_dev_eui", - "lora_snr" - ], - "decoder": "const message = decodeToJson(payload);\nconst values = Object.assign(\n decodeDevicePayload(base64ToBytes(message.uplink_message.frm_payload)),\n extractNetworkTelemetry(message)\n);\n\nreturn {\n deviceName: String(values.device_id),\n deviceType: 'DL-ZN2',\n attributes: {\n lora_dev_eui: values.lora_dev_eui,\n protocol_version: values.protocol_version,\n },\n telemetry: [{\n ts: parseDateToTimestamp(message.received_at),\n values: keepTelemetry(values)\n }]\n};\n\nfunction decodeDevicePayload(payload) {\n /* https://www.decentlab.com/products/dendrometer-for-lorawan */\n const decentlab_decoder = {\n PROTOCOL_VERSION: 2,\n SENSORS: [\n {length: 4,\n values: [{name: 'dendrometer_a_position',\n displayName: 'Dendrometer A Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - 1) * 20000; },\n unit: 'µm'},\n {name: 'dendrometer_b_position',\n displayName: 'Dendrometer B Position',\n convert: function (x) { return ((x[0] + x[1]*65536) / 8388608 - (x[2] + x[3]*65536) / 8388608) * 20000; },\n unit: 'µm'}]},\n {length: 1,\n values: [{name: 'battery_voltage',\n displayName: 'Battery voltage',\n convert: function (x) { return x[0] / 1000; },\n unit: 'V'}]}\n ],\n read_int: function (bytes, pos) {\n return (bytes[pos] << 8) + bytes[pos + 1];\n },\n decode: function (msg) {\n var bytes = msg;\n var i, j;\n if (typeof msg === 'string') {\n bytes = [];\n for (i = 0; i < msg.length; i += 2) {\n bytes.push(parseInt(msg.substring(i, i + 2), 16));\n }\n }\n var version = bytes[0];\n if (version != this.PROTOCOL_VERSION) {\n return {error: \"protocol version \" + version + \" doesn't match v2\"};\n }\n var deviceId = this.read_int(bytes, 1);\n var flags = this.read_int(bytes, 3);\n var result = {'protocol_version': version, 'device_id': deviceId};\n // decode payload\n var pos = 5;\n for (i = 0; i < this.SENSORS.length; i++, flags >>= 1) {\n if ((flags & 1) !== 1)\n continue;\n var sensor = this.SENSORS[i];\n var x = [];\n // convert data to 16-bit integer array\n for (j = 0; j < sensor.length; j++) {\n x.push(this.read_int(bytes, pos));\n pos += 2;\n }\n // decode sensor values\n for (j = 0; j < sensor.values.length; j++) {\n var value = sensor.values[j];\n if ('convert' in value) {\n result[value.name] = {displayName: value.displayName,\n value: value.convert.bind(this)(x)};\n if ('unit' in value)\n result[value.name]['unit'] = value.unit;\n }\n }\n }\n return result;\n }\n };\n\n const decoded = decentlab_decoder.decode(payload);\n const result = {};\n for (var k in decoded) {\n if (typeof decoded[k] === \"object\") {\n result[k] = decoded[k].value;\n } else if (typeof decoded[k] === \"number\") {\n result[k] = decoded[k];\n }\n }\n return result;\n}\n\nfunction extractNetworkTelemetry(payload) {\n const result = {\n lora_frame_counter: message.uplink_message.f_cnt,\n lora_frame_port: message.uplink_message.f_port,\n lora_frequency: parseInt(message.uplink_message.settings.frequency),\n lora_dev_eui: message.end_device_ids.dev_eui,\n lora_spreading_factor:\n message.uplink_message.settings.data_rate.lora.spreading_factor,\n };\n const gwi = message.uplink_message.rx_metadata\n .map((x) => ({ lora_rssi: x.rssi, lora_snr: x.snr }))\n .reduce((a, x) => (x.lora_rssi > a.lora_rssi ? x : a), {\n lora_rssi: -Number.MAX_VALUE,\n });\n return Object.assign(result, gwi);\n}\n\n// Helper functions\n\nfunction decodeToJson(payload) {\n const s = String.fromCharCode.apply(String, payload);\n return JSON.parse(s);\n}\n\nfunction parseDateToTimestamp(dateString) {\n var timestamp = -1;\n if (dateString != null) {\n timestamp = new Date(dateString).getTime();\n if (timestamp == -1) {\n var secondsSeparatorIndex = dateString.lastIndexOf('.') + 1;\n var millisecondsEndIndex = dateString.lastIndexOf('+');\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('Z');\n }\n if (millisecondsEndIndex == -1) {\n millisecondsEndIndex = dateString.lastIndexOf('-');\n }\n if (millisecondsEndIndex == -1) {\n if (dateString.length >= secondsSeparatorIndex + 3) {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3);\n }\n } else {\n dateString = dateString.substring(0, secondsSeparatorIndex + 3) +\n dateString.substring(millisecondsEndIndex, dateString.length);\n }\n timestamp = new Date(dateString).getTime();\n }\n }\n // If we cannot parse timestamp - we will use the current timestamp\n if (timestamp == -1) {\n timestamp = Date.now();\n }\n\n return timestamp;\n}\n\nfunction base64ToBytes(base64String) {\n if (typeof base64String === 'string') {\n return Uint8Array.from(atob(base64String), c => c.charCodeAt(0));\n }\n return [];\n}\n\nfunction keepTelemetry(telemetry) {\n const unwanted = ['protocol_version', 'device_id', 'lora_dev_eui'];\n return Object.fromEntries(\n Object.entries(telemetry).filter(\n (x) => !unwanted.includes(x[0])\n )\n );\n}" - } -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/metadata.json b/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/metadata.json deleted file mode 100644 index e304ca99..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/metadata.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "integrationName": "ThingsStackIndustries integration", - "includeGatewayInfo": false -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/payload.json b/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/payload.json deleted file mode 100644 index a1a4e231..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/payload.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "end_device_ids": { - "device_id": "03022", - "application_ids": { - "application_id": "test-decentlab" - }, - "dev_eui": "70B3D57BA0000BCE", - "join_eui": "70B3D57ED00006B2", - "dev_addr": "27000020" - }, - "correlation_ids": [ - "as:up:01E0CY8V864TP36Q130RSQQJBY", - "gs:conn:01E0B4GJHDRFKNEQ9GG3ZDG1JX", - "gs:uplink:01E0CY8V1FFJ0WCKXTKT0CRPDY", - "ns:uplink:01E0CY8V1JGN0R5YZTBH48YXH3", - "rpc:/ttn.lorawan.v3.GsNs/HandleUplink:01E0CY8V1JHJA8PE0P98VSDE6K" - ], - "received_at": "2020-02-06T09:46:05.447941836Z", - "uplink_message": { - "session_key_id": "AXAWYbtxgUllLtJWdZrW0Q==", - "f_port": 1, - "f_cnt": 101, - "frm_payload": "AhERAANAmgCGMDkAPgxU", - "rx_metadata": [ - { - "gateway_ids": { - "gateway_id": "eui-b827ebfffe9f2da9", - "eui": "B827EBFFFE9F2DA9" - }, - "time": "2020-02-06T09:46:05Z", - "timestamp": 436812492, - "rssi": -16, - "channel_rssi": -16, - "snr": 8.5, - "uplink_token": "CiIKIAoUZXVpLWI4MjdlYmZmZmU5ZjJkYTkSCLgn6//+ny2pEMz1pNAB", - "location": { - "latitude": 52.71863806169478, - "longitude": -4.052632749080659, - "altitude": 5, - "source": "SOURCE_REGISTRY" - }, - "channel_index": 6 - } - ], - "settings": { - "data_rate": { - "lora": { - "bandwidth": 125000, - "spreading_factor": 11 - } - }, - "data_rate_index": 1, - "coding_rate": "4/5", - "frequency": "867700000", - "timestamp": 436812492, - "time": "2020-02-06T09:46:05Z" - }, - "received_at": "2020-02-06T09:46:05.234172599Z" - } -} diff --git a/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/result.json b/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/result.json deleted file mode 100644 index deca9754..00000000 --- a/VENDORS/Decentlab/DL-ZN2/ThingsStackIndustries/uplink/result.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "deviceName": "4369", - "deviceType": "DL-ZN2", - "attributes": { - "lora_dev_eui": "70B3D57BA0000BCE", - "protocol_version": 2 - }, - "telemetry": [ - { - "ts": 1580982365447, - "values": { - "dendrometer_a_position": 976.9296646118164, - "dendrometer_b_position": 11259.996891021729, - "battery_voltage": 3.156, - "lora_frame_counter": 101, - "lora_frame_port": 1, - "lora_frequency": 867700000, - "lora_spreading_factor": 11, - "lora_rssi": -16, - "lora_snr": 8.5 - } - } - ] -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/info.json b/VENDORS/Decentlab/DL-ZN2/info.json deleted file mode 100644 index 6f2d7ec8..00000000 --- a/VENDORS/Decentlab/DL-ZN2/info.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "url": "https://www.decentlab.com/products/dendrometer-for-lorawan", - "description": "The Decentlab DL-ZN2 comes with a linear position dendrometer that can measure the growth of plants and trees. It is suitable for use in irrigation control, smart agriculture, forestry, plantation, and ecophysiology." -} \ No newline at end of file diff --git a/VENDORS/Decentlab/DL-ZN2/photo.png b/VENDORS/Decentlab/DL-ZN2/photo.png deleted file mode 100644 index 65eba9c4..00000000 Binary files a/VENDORS/Decentlab/DL-ZN2/photo.png and /dev/null differ