Skip to content

Instantly share code, notes, and snippets.

@rappch1 rappch1/5 - 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": "ab7c5cb7.02fec",
"type": "tab",
"label": "5 - RFU650",
"disabled": false,
"info": ""
},
{
"id": "58f425f.bac93dc",
"type": "ui_template",
"z": "ab7c5cb7.02fec",
"group": "8fa066ea.6d0f68",
"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": 551,
"y": 176,
"wires": [
[]
]
},
{
"id": "5cebfa58.ea9d54",
"type": "mqtt in",
"z": "ab7c5cb7.02fec",
"name": "lesung",
"topic": "io/cybus/energie-campus/sick/5/rfid/eg/flur/lesung",
"qos": "0",
"broker": "10e889ef.451a0e",
"x": 94,
"y": 176,
"wires": [
[
"e61110eb.8f795"
]
]
},
{
"id": "65636ea1.0c594",
"type": "ui_chart",
"z": "ab7c5cb7.02fec",
"name": "rfu_rssi_chart",
"group": "645d3f81.b5529",
"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": 223,
"wires": [
[],
[]
]
},
{
"id": "ede2386a.7835e",
"type": "inject",
"z": "ab7c5cb7.02fec",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 163,
"y": 269,
"wires": [
[
"1934fb69.6a7315"
]
]
},
{
"id": "1934fb69.6a7315",
"type": "function",
"z": "ab7c5cb7.02fec",
"name": "clear_chart",
"func": "msg.topic = \"Clear\";\nmsg.payload = []\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 353,
"y": 269,
"wires": [
[
"65636ea1.0c594"
]
]
},
{
"id": "e61110eb.8f795",
"type": "subflow:4109d1f2.c68428",
"z": "ab7c5cb7.02fec",
"name": "parse RFID data",
"x": 334,
"y": 176,
"wires": [
[
"58f425f.bac93dc"
],
[
"65636ea1.0c594"
]
]
},
{
"id": "13a6bffc.638cd",
"type": "mqtt in",
"z": "ab7c5cb7.02fec",
"name": "einfallswinkel",
"topic": "io/cybus/energie-campus/sick/5/rfid/eg/flur/einfallswinkel",
"qos": "0",
"broker": "10e889ef.451a0e",
"x": 149,
"y": 510,
"wires": [
[
"2d430f1f.0818",
"1eb1d129.3d21bf"
]
]
},
{
"id": "2d430f1f.0818",
"type": "debug",
"z": "ab7c5cb7.02fec",
"name": "",
"active": false,
"console": "false",
"complete": "false",
"x": 352.0000305175781,
"y": 595,
"wires": []
},
{
"id": "1eb1d129.3d21bf",
"type": "delay",
"z": "ab7c5cb7.02fec",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 355,
"y": 510,
"wires": [
[
"61c4e272.6f6ccc"
]
]
},
{
"id": "61c4e272.6f6ccc",
"type": "subflow:9d33d65f.b1886",
"z": "ab7c5cb7.02fec",
"name": "parse RFID angle",
"x": 565,
"y": 509,
"wires": [
[
"9666a93c.e8b4d",
"9f364b88.ae0e98"
],
[
"c0da26df.3e5c38"
]
]
},
{
"id": "ad6c5fcb.627fc",
"type": "comment",
"z": "ab7c5cb7.02fec",
"name": "RFID localization",
"info": "",
"x": 158,
"y": 461,
"wires": []
},
{
"id": "9366ae6e.cc99b",
"type": "comment",
"z": "ab7c5cb7.02fec",
"name": "RFID identification",
"info": "",
"x": 136,
"y": 122,
"wires": []
},
{
"id": "9666a93c.e8b4d",
"type": "ui_gauge",
"z": "ab7c5cb7.02fec",
"name": "",
"group": "8c86dc9.abd902",
"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": 809,
"y": 449,
"wires": []
},
{
"id": "c0da26df.3e5c38",
"type": "ui_text",
"z": "ab7c5cb7.02fec",
"group": "8c86dc9.abd902",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "UII",
"format": "{{msg.payload}}",
"layout": "row-left",
"x": 808,
"y": 559,
"wires": []
},
{
"id": "9f364b88.ae0e98",
"type": "ui_chart",
"z": "ab7c5cb7.02fec",
"name": "",
"group": "8c86dc9.abd902",
"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": 805.6833801269531,
"y": 502.6166687011719,
"wires": [
[],
[]
]
},
{
"id": "8fa066ea.6d0f68",
"type": "ui_group",
"z": "",
"name": "Inventory",
"tab": "838299ea.b501",
"disp": true,
"width": "6"
},
{
"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": "645d3f81.b5529",
"type": "ui_group",
"z": "",
"name": "RSSI",
"tab": "838299ea.b501",
"disp": true,
"width": "10"
},
{
"id": "8c86dc9.abd902",
"type": "ui_group",
"z": "",
"name": "Angle of Arrival",
"tab": "838299ea.b501",
"disp": true,
"width": "6"
},
{
"id": "838299ea.b501",
"type": "ui_tab",
"z": "",
"name": "5 - RFU650",
"icon": "dashboard",
"order": 5
}
]
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.