Sunny You
Published

How to connect iFrog LoRa Gateway to QNAP QIoT Suite Lite

In this tutorial, you will learn how to send data from the iFrogLab LoRa Gateway to QNAP QIoT Suite Lite.

IntermediateProtip619
How to connect iFrog LoRa Gateway to QNAP QIoT Suite Lite

Story

Read more

Code

Code snippet #1

Plain text
[
 {
 "id": "e2bd8ea5.5c613",
 "type": "debug",
 "z": "8cc3c0a1.b6949",
 "name": "Click debug tab to watch data stream",
 "active": true,
 "console": "false",
 "complete": "false",
 "x": 557.5,
 "y": 92,
 "wires": []
 },
 {
 "id": "8ff255de.850808",
 "type": "qiotbroker in",
 "z": "8cc3c0a1.b6949",
 "name": "MQTT Message In",
 "flow": "8cc3c0a1.b6949",
 "opt_customtopic": false,
 "customtopic": "custom_topic_c13af1572d9611e8adc49f3a1551c296",
 "thing": "ec626e0b-0524-4f06-9f8d-6c590730f7a9",
 "qtopic": "qiot/things/admin/loradevice/data",
 "username": "admin",
 "rules": [
 {
 "v": "5ab347b29c31dc00322c43d0",
 "meta": {
 "unit": "°C",
 "datatype": "String"
 },
 "resid": "data"
 }
 ],
 "outputs": 1,
 "key": "r:5197487d0ab31b464c745aa7b8fa2616",
 "x": 108.5,
 "y": 43,
 "wires": [
 [
 "d0d1710e.b9a8d"
 ]
 ]
 },
 {
 "id": "d0d1710e.b9a8d",
 "type": "change",
 "z": "8cc3c0a1.b6949",
 "name": "",
 "rules": [
 {
 "t": "move",
 "p": "payload.value",
 "pt": "msg",
 "to": "payload",
 "tot": "msg"
 }
 ],
 "action": "",
 "property": "",
 "from": "",
 "to": "",
 "reg": false,
 "x": 332,
 "y": 43,
 "wires": [
 [
 "1a8b6d9a.197722"
 ]
 ]
 },
 {
 "id": "1a8b6d9a.197722",
 "type": "function",
 "z": "8cc3c0a1.b6949",
 "name": "Decoded",
 "func": "function convertFromHex(hex) {\n hex = hex.toString();//force conversion\n var str = '';\n for (var i = 1; i < hex.length + 1; i += 2)\n str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));\n return str;\n}\n\nmsg.payload = convertFromHex(msg.payload.substring(0, msg.payload.length - 4));\n\nreturn msg;",
 "outputs": 1,
 "noerr": 0,
 "x": 284,
 "y": 92,
 "wires": [
 [
 "e2bd8ea5.5c613"
 ]
 ]
 }
]

Credits

Sunny You
6 projects • 0 followers

Comments