Skip to content

Instantly share code, notes, and snippets.

@rappch1 rappch1/2 - RFU650
Last active Sep 15, 2017

Embed
What would you like to do?
WhatTheData 2017: Real SICK Data
[
{
"id": "9d33d65f.b1886",
"type": "subflow",
"name": "parseRFIDangle",
"info": "",
"in": [
{
"x": 43,
"y": 86,
"wires": [
{
"id": "838e63fd.2b55a"
}
]
}
],
"out": [
{
"x": 614,
"y": 225,
"wires": [
{
"id": "c22fa8db.466be8",
"port": 0
}
]
},
{
"x": 519,
"y": 379,
"wires": [
{
"id": "395bea18.39d2ce",
"port": 0
}
]
}
]
},
{
"id": "6ef7c849.eecd8",
"type": "function",
"z": "9d33d65f.b1886",
"name": "Parse InvResp5 Result",
"func": "//'use strict()';\n\n//let input = msg.payload.split(' ')\nvar input = msg.payload;\n\n// define payload\nmsg.payload = {}\nmsg.payload.uii = input[0].uii;\nmsg.payload.angleOfArrival = Number(input[0].winkel);\n//msg.payload.timestamp = input[9]\n \nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 360,
"y": 86,
"wires": [
[
"c22fa8db.466be8",
"395bea18.39d2ce"
]
]
},
{
"id": "c22fa8db.466be8",
"type": "change",
"z": "9d33d65f.b1886",
"name": "payload = AoA",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.angleOfArrival",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 359,
"y": 226,
"wires": [
[]
]
},
{
"id": "395bea18.39d2ce",
"type": "change",
"z": "9d33d65f.b1886",
"name": "payload = UII",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.uii",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 359,
"y": 379,
"wires": [
[]
]
},
{
"id": "838e63fd.2b55a",
"type": "json",
"z": "9d33d65f.b1886",
"name": "",
"pretty": false,
"x": 157.5,
"y": 86,
"wires": [
[
"6ef7c849.eecd8"
]
]
},
{
"id": "4109d1f2.c68428",
"type": "subflow",
"name": "parseRFIDdata",
"info": "",
"in": [
{
"x": 81,
"y": 129,
"wires": [
{
"id": "2288411e.d406e6"
}
]
}
],
"out": [
{
"x": 611,
"y": 127,
"wires": [
{
"id": "c4f0cebb.267eb8",
"port": 0
}
]
},
{
"x": 612,
"y": 201,
"wires": [
{
"id": "304d0652.4eddba",
"port": 0
}
]
}
]
},
{
"id": "c4f0cebb.267eb8",
"type": "function",
"z": "4109d1f2.c68428",
"name": "sort",
"func": "msg.payload.tags.sort(function (a, b) {\n return (a.uii < b.uii) ? -1 : 1 \n})\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 363,
"y": 127,
"wires": [
[
"304d0652.4eddba"
]
]
},
{
"id": "304d0652.4eddba",
"type": "function",
"z": "4109d1f2.c68428",
"name": "prepare output for chart",
"func": "var input = msg.payload;\n\nfor (i = 0; i < input.tags.length; i++) {\n //node.send({payload: input.tags[i].rssi + 100, topic: input.tags[i].uii});\n \n var uii = input.tags[i].uii;\n node.send({payload: input.tags[i].rssi + 100, topic: uii.substr(uii.length - 3, 3)});\n}\n\nreturn",
"outputs": 1,
"noerr": 0,
"x": 423,
"y": 201,
"wires": [
[]
]
},
{
"id": "2288411e.d406e6",
"type": "json",
"z": "4109d1f2.c68428",
"name": "",
"pretty": false,
"x": 199,
"y": 129,
"wires": [
[
"c4f0cebb.267eb8"
]
]
},
{
"id": "2237ee62.a306ba",
"type": "tab",
"label": "2 - RFU650",
"disabled": false,
"info": ""
},
{
"id": "28a0fd90.527012",
"type": "ui_gauge",
"z": "2237ee62.a306ba",
"name": "",
"group": "362e1f9b.e0fed",
"order": 2,
"width": "0",
"height": "0",
"gtype": "gage",
"title": "Gauge",
"label": "degree",
"format": "{{value}}",
"min": "-90",
"max": "90",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 867,
"y": 493,
"wires": []
},
{
"id": "e0989c47.955778",
"type": "ui_text",
"z": "2237ee62.a306ba",
"group": "362e1f9b.e0fed",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "UII",
"format": "{{msg.payload}}",
"layout": "row-left",
"x": 867,
"y": 601,
"wires": []
},
{
"id": "eba77c6f.6288f",
"type": "ui_template",
"z": "2237ee62.a306ba",
"group": "dc6cc0.e7a5eb4",
"name": "",
"order": 3,
"width": "6",
"height": "10",
"format": "<div>\n <ul style=\"list-style: none; padding-left: 0px;\" ng-repeat=\"tag in msg.payload.tags\">\n <li>\n Uii: {{tag.uii}}\n <!-- <div style=\"background: rgb(0, 148, 206); padding: 2px; color: white; width: {{tag.rssi / 100 * 20}}%\">{{tag.rssi}}</div> -->\n </li>\n </ul>\n</div>",
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 548,
"y": 147,
"wires": [
[]
]
},
{
"id": "dc1ab70d.adb57",
"type": "ui_chart",
"z": "2237ee62.a306ba",
"name": "rfu_rssi_chart",
"group": "caf92a2f.ea52e",
"order": 0,
"width": "10",
"height": "10",
"label": "[relative]",
"chartType": "horizontalBar",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "0",
"ymax": "60",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 571,
"y": 201,
"wires": [
[],
[]
]
},
{
"id": "bdcb2531.d7e768",
"type": "inject",
"z": "2237ee62.a306ba",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 163,
"y": 247,
"wires": [
[
"5b3d685f.7b46a8"
]
]
},
{
"id": "5b3d685f.7b46a8",
"type": "function",
"z": "2237ee62.a306ba",
"name": "clear_chart",
"func": "msg.topic = \"Clear\";\nmsg.payload = []\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 353,
"y": 247,
"wires": [
[
"dc1ab70d.adb57"
]
]
},
{
"id": "32404215.00982e",
"type": "subflow:4109d1f2.c68428",
"z": "2237ee62.a306ba",
"name": "parse RFID data",
"x": 334,
"y": 154,
"wires": [
[
"eba77c6f.6288f"
],
[
"dc1ab70d.adb57"
]
]
},
{
"id": "f145ea24.2d7f48",
"type": "debug",
"z": "2237ee62.a306ba",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 335.5,
"y": 97,
"wires": []
},
{
"id": "8051e7e1.e1c0c8",
"type": "mqtt in",
"z": "2237ee62.a306ba",
"name": "einfallswinkel",
"topic": "io/cybus/energie-campus/sick/2/rfid/og/flur/einfallswinkel",
"qos": "0",
"broker": "10e889ef.451a0e",
"x": 146,
"y": 498.23333740234375,
"wires": [
[
"3cd8fb87.50573c",
"4d084d9c.73b46c"
]
]
},
{
"id": "3cd8fb87.50573c",
"type": "debug",
"z": "2237ee62.a306ba",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 388,
"y": 562.2333374023438,
"wires": []
},
{
"id": "4d084d9c.73b46c",
"type": "delay",
"z": "2237ee62.a306ba",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 379,
"y": 498.23333740234375,
"wires": [
[
"4309eb14.f89224"
]
]
},
{
"id": "4309eb14.f89224",
"type": "subflow:9d33d65f.b1886",
"z": "2237ee62.a306ba",
"name": "parse RFID angle",
"x": 606,
"y": 498.23333740234375,
"wires": [
[
"28a0fd90.527012",
"22273669.dcb5d2"
],
[
"e0989c47.955778"
]
]
},
{
"id": "c72e084b.698868",
"type": "comment",
"z": "2237ee62.a306ba",
"name": "RFID localization",
"info": "",
"x": 157,
"y": 442.23333740234375,
"wires": []
},
{
"id": "8915e5aa.fb1158",
"type": "comment",
"z": "2237ee62.a306ba",
"name": "RFID identification",
"info": "",
"x": 132.68333435058594,
"y": 98,
"wires": []
},
{
"id": "74aac5.73c8953c",
"type": "mqtt in",
"z": "2237ee62.a306ba",
"name": "lesung",
"topic": "io/cybus/energie-campus/sick/2/rfid/og/flur/lesung",
"qos": "0",
"broker": "10e889ef.451a0e",
"x": 115,
"y": 154,
"wires": [
[
"32404215.00982e",
"f145ea24.2d7f48"
]
]
},
{
"id": "22273669.dcb5d2",
"type": "ui_chart",
"z": "2237ee62.a306ba",
"name": "",
"group": "362e1f9b.e0fed",
"order": 0,
"width": 0,
"height": 0,
"label": "chart",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm:ss",
"interpolate": "linear",
"nodata": "",
"dot": false,
"ymin": "",
"ymax": "",
"removeOlder": 1,
"removeOlderPoints": "",
"removeOlderUnit": "60",
"cutout": 0,
"useOneColor": false,
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 867.6833190917969,
"y": 547.6166687011719,
"wires": [
[],
[]
]
},
{
"id": "362e1f9b.e0fed",
"type": "ui_group",
"z": "",
"name": "Angle of Arrival",
"tab": "32e073d9.db76fc",
"order": 3,
"disp": true,
"width": "6"
},
{
"id": "dc6cc0.e7a5eb4",
"type": "ui_group",
"z": "",
"name": "Inventory",
"tab": "32e073d9.db76fc",
"order": 1,
"disp": true,
"width": "6"
},
{
"id": "caf92a2f.ea52e",
"type": "ui_group",
"z": "",
"name": "RSSI",
"tab": "32e073d9.db76fc",
"order": 2,
"disp": true,
"width": "10"
},
{
"id": "10e889ef.451a0e",
"type": "mqtt-broker",
"z": "",
"broker": "energie-campus.cybus.io",
"port": "1883",
"clientid": "",
"usetls": false,
"verifyservercert": true,
"compatmode": true,
"keepalive": "15",
"cleansession": true,
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": ""
},
{
"id": "32e073d9.db76fc",
"type": "ui_tab",
"z": "",
"name": "2 - RFU650",
"icon": "dashboard",
"order": 2
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.