Commit cfa20eaa authored by Spencer Williams's avatar Spencer Williams
Browse files

dashboard notes, Getting Started comment, change ratelimit to 1...

dashboard notes, Getting Started comment, change ratelimit to 1 msg/device/sec, fix dashboard device list
parent aa912c64
[
{
"id": "f1d953a9.52377",
"id": "155b7069.fcdeb",
"type": "tab",
"label": "Rigado Dev Kit"
"label": "Rigado DevKit"
},
{
"id": "270e7872.13bc98",
"id": "c5e571fc.a05b9",
"type": "ui_tab",
"z": "",
"name": "Home",
"icon": "dashboard"
},
{
"id": "fae3b769.37ce28",
"id": "3adf3b1b.929a34",
"type": "ui_base",
"theme": {
"name": "theme-dark",
......@@ -101,38 +101,38 @@
}
},
{
"id": "12c9781e.aa9368",
"id": "ca5f4c53.d8f4d",
"type": "ui_group",
"z": "",
"name": "Gateway Status",
"tab": "270e7872.13bc98",
"tab": "c5e571fc.a05b9",
"order": 1,
"disp": true,
"width": "6"
},
{
"id": "3c0d9fd8.080e6",
"id": "6acbef45.d211d",
"type": "ui_group",
"z": "",
"name": "Sensor Data",
"tab": "270e7872.13bc98",
"tab": "c5e571fc.a05b9",
"order": 2,
"disp": true,
"width": "6"
},
{
"id": "91cff1a4.7433c",
"id": "f7f8948e.7057f8",
"type": "ui_group",
"z": "",
"name": "Send Data",
"tab": "270e7872.13bc98",
"tab": "c5e571fc.a05b9",
"disp": true,
"width": "6"
},
{
"id": "283c2c99.fd3464",
"id": "15652f0c.77aa71",
"type": "inject",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "Start Scanning",
"topic": "",
"payload": "{\"command\":\"scan\", \"value\":true}",
......@@ -144,14 +144,14 @@
"y": 520,
"wires": [
[
"2ae1004.b2bd3"
"ef0d20a6.fe7aa"
]
]
},
{
"id": "822a054.fa366f8",
"id": "a9187f16.52543",
"type": "inject",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "Stop Scanning",
"topic": "",
"payload": "{\"command\":\"scan\", \"value\":false}",
......@@ -163,43 +163,32 @@
"y": 560,
"wires": [
[
"2ae1004.b2bd3"
"ef0d20a6.fe7aa"
]
]
},
{
"id": "2ae1004.b2bd3",
"id": "ef0d20a6.fe7aa",
"type": "noble-connect",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"uuids": "",
"name": "",
"x": 340,
"y": 540,
"wires": [
[
"c65fc47.870b738",
"f0ca820c.9f71c"
],
[
"a3a1a2b.0ff7d6"
"c78ef0c0.1413c"
],
[],
[
"fdda9133.b655b"
"4268da4d.798974"
]
],
"inputLabels": [
"control command"
],
"outputLabels": [
"sensor-data",
"peripherals",
"status"
]
},
{
"id": "801caa9a.2db608",
"id": "15459cab.c4ab73",
"type": "function",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "format for graphs",
"func": "if (typeof msg.payload === \"undefined\") {\n return [null, null, null];\n}\n\nuuid = msg.payload.peripheralUuid;\naccmsgs = [{\n \"topic\": uuid+\"-x\",\n \"payload\": msg.payload.data.accel[0]\n},{\n \"topic\": uuid+\"-y\",\n \"payload\": msg.payload.data.accel[1]\n},{\n \"topic\": uuid+\"-z\",\n \"payload\": msg.payload.data.accel[2]\n}];\ngyrmsgs = [{\n \"topic\": uuid+\"-x\",\n \"payload\": msg.payload.data.gyro[0]\n},{\n \"topic\": uuid+\"-y\",\n \"payload\": msg.payload.data.gyro[1]\n},{\n \"topic\": uuid+\"-z\",\n \"payload\": msg.payload.data.gyro[2]\n}];\nmagmsgs = [{\n \"topic\": uuid+\"-x\",\n \"payload\": msg.payload.data.mag[0]\n},{\n \"topic\": uuid+\"-y\",\n \"payload\": msg.payload.data.mag[1]\n},{\n \"topic\": uuid+\"-z\",\n \"payload\": msg.payload.data.mag[2]\n}];\nreturn [accmsgs, gyrmsgs, magmsgs];",
"outputs": "3",
......@@ -208,27 +197,22 @@
"y": 800,
"wires": [
[
"31841c22.6bd9c4"
"aadbf527.6c3dd8"
],
[
"f995f0e0.b64e6"
"a031a60c.d4e5c8"
],
[
"50321922.928158"
"cd89b8ca.2ba998"
]
],
"outputLabels": [
"accelerometer",
"gyroscope",
"magnetometer"
]
},
{
"id": "31841c22.6bd9c4",
"id": "aadbf527.6c3dd8",
"type": "ui_chart",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "Accelerometer",
"group": "3c0d9fd8.080e6",
"group": "6acbef45.d211d",
"order": 2,
"width": 0,
"height": 0,
......@@ -266,11 +250,11 @@
]
},
{
"id": "f995f0e0.b64e6",
"id": "a031a60c.d4e5c8",
"type": "ui_chart",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "Gyroscope",
"group": "3c0d9fd8.080e6",
"group": "6acbef45.d211d",
"order": 5,
"width": 0,
"height": 0,
......@@ -308,11 +292,11 @@
]
},
{
"id": "50321922.928158",
"id": "cd89b8ca.2ba998",
"type": "ui_chart",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "Magnetometer",
"group": "3c0d9fd8.080e6",
"group": "6acbef45.d211d",
"order": 7,
"width": 0,
"height": 0,
......@@ -350,31 +334,29 @@
]
},
{
"id": "a3a1a2b.0ff7d6",
"id": "b90fef18.3dfe5",
"type": "ui_template",
"z": "f1d953a9.52377",
"group": "12c9781e.aa9368",
"z": "155b7069.fcdeb",
"group": "ca5f4c53.d8f4d",
"name": "Device List",
"order": 2,
"width": 0,
"height": 0,
"format": "<h2>Device List</h2>\n<md-button ng-click=\"send({payload:{command:'peripherals'}})\">\n Refresh\n</md-button>\n<table width=\"100%\" style=\"margin: 0px;\">\n <thead>\n <tr>\n <th>Device UUID</th>\n <th>Last Updated</th>\n <th>Connected</th>\n <th>RSSI</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat=\"(key, value) in msg.payload\">\n <td>{{key}}</td>\n <td>{{value.lastUpdated}}</td>\n <td>{{value.connected}}</td>\n <td>{{value.rssi}}</td>\n </tr>\n </tbody>\n</table>\n<p>Note: This list will not show results if you Deploy the flow. Devices will still connect, but will not show up here. To see the list again, Deploy (to save flow changes to file) and then stop and restart the app.</p>",
"format": "<h2>Device List</h2>\n<table width=\"100%\" style=\"margin: 0px;\">\n <thead>\n <tr>\n <th>Device UUID</th>\n <th>Last Seen</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat=\"(key, value) in msg.payload\">\n <td>{{key}}</td>\n <td>{{value}}</td>\n </tr>\n </tbody>\n</table>\n",
"storeOutMessages": false,
"fwdInMessages": false,
"templateScope": "local",
"x": 370,
"y": 720,
"y": 640,
"wires": [
[
"2ae1004.b2bd3"
]
[]
]
},
{
"id": "fdda9133.b655b",
"id": "4268da4d.798974",
"type": "ui_template",
"z": "f1d953a9.52377",
"group": "12c9781e.aa9368",
"z": "155b7069.fcdeb",
"group": "ca5f4c53.d8f4d",
"name": "NoBLE Status",
"order": 1,
"width": 0,
......@@ -383,17 +365,17 @@
"storeOutMessages": true,
"fwdInMessages": true,
"templateScope": "local",
"x": 380,
"y": 680,
"x": 540,
"y": 560,
"wires": [
[]
]
},
{
"id": "f93c2da3.8282",
"id": "c0089866.6b4b08",
"type": "ui_template",
"z": "f1d953a9.52377",
"group": "3c0d9fd8.080e6",
"z": "155b7069.fcdeb",
"group": "6acbef45.d211d",
"name": "Clear Acc",
"order": 4,
"width": 0,
......@@ -406,15 +388,15 @@
"y": 760,
"wires": [
[
"31841c22.6bd9c4"
"aadbf527.6c3dd8"
]
]
},
{
"id": "48e11e78.d01b5",
"id": "3fbfeb63.c5f724",
"type": "ui_template",
"z": "f1d953a9.52377",
"group": "3c0d9fd8.080e6",
"z": "155b7069.fcdeb",
"group": "6acbef45.d211d",
"name": "Clear Gyr",
"order": 6,
"width": 0,
......@@ -427,15 +409,15 @@
"y": 800,
"wires": [
[
"f995f0e0.b64e6"
"a031a60c.d4e5c8"
]
]
},
{
"id": "be414a26.144398",
"id": "6ce6ac16.8895b4",
"type": "ui_template",
"z": "f1d953a9.52377",
"group": "3c0d9fd8.080e6",
"z": "155b7069.fcdeb",
"group": "6acbef45.d211d",
"name": "Clear Mag",
"order": 8,
"width": 0,
......@@ -448,128 +430,80 @@
"y": 840,
"wires": [
[
"50321922.928158"
]
]
},
{
"id": "c65fc47.870b738",
"type": "delay",
"z": "f1d953a9.52377",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 610,
"y": 800,
"wires": [
[
"801caa9a.2db608"
]
]
},
{
"id": "f0ca820c.9f71c",
"type": "delay",
"z": "f1d953a9.52377",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 550,
"y": 340,
"wires": [
[
"3ecd3007.43533",
"df3605ea.3708c8"
"cd89b8ca.2ba998"
]
]
},
{
"id": "3ecd3007.43533",
"id": "240447c9.909a48",
"type": "function",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "format for AWS",
"func": "if (!flow.get(\"unitSerialNumber\")) {\n return null;\n}\nmsg.payload.unitSerialNumber = flow.get(\"unitSerialNumber\");\nreturn {\n \"sendPayload\": msg.payload\n};",
"outputs": "1",
"noerr": 0,
"x": 840,
"x": 880,
"y": 380,
"wires": [
[
"3b36987e.9bacd8",
"545cf821.785bb8"
"6fc0d0a8.5ed6d",
"26745f68.9288f"
]
]
},
{
"id": "d5b8a1f0.daa9d",
"id": "63ff7486.e7ce4c",
"type": "debug",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 1170,
"x": 1210,
"y": 540,
"wires": []
},
{
"id": "43770f10.fa2dc",
"id": "d018552a.dfb148",
"type": "exec",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"command": "unit_serial_number",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 1050,
"x": 1090,
"y": 240,
"wires": [
[
"fa2a9b78.81f038"
"e8e6ab02.1d3398"
],
[],
[]
]
},
{
"id": "fa2a9b78.81f038",
"id": "e8e6ab02.1d3398",
"type": "function",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "save serial number",
"func": "flow.set(\"unitSerialNumber\", msg.payload);",
"outputs": 1,
"noerr": 0,
"x": 1250,
"x": 1290,
"y": 240,
"wires": [
[]
]
},
{
"id": "3b36987e.9bacd8",
"id": "6fc0d0a8.5ed6d",
"type": "ui_switch",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "dashboard switch",
"label": "Send data to Amazon Lambda",
"group": "91cff1a4.7433c",
"group": "f7f8948e.7057f8",
"order": 0,
"width": 0,
"height": 0,
......@@ -585,131 +519,207 @@
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"x": 1050,
"x": 1090,
"y": 380,
"wires": [
[
"c91cf4c.0b90908"
"714fe226.7f3efc"
]
]
},
{
"id": "c91cf4c.0b90908",
"id": "714fe226.7f3efc",
"type": "function",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "check send switch",
"func": "if (msg.payload) {\n msg.payload = msg.sendPayload;\n delete msg.sendPayload;\n return msg;\n} else {\n return null;\n}",
"outputs": 1,
"noerr": 0,
"x": 1270,
"x": 1310,
"y": 380,
"wires": [
[
"7512d1ca.67979"
"6f0d5570.dfed3c"
]
]
},
{
"id": "66c89a02.365b74",
"type": "ui_template",
"z": "f1d953a9.52377",
"group": "3c0d9fd8.080e6",
"name": "Note",
"order": 1,
"width": 0,
"height": 0,
"format": "<p>If you connect more than one device, these graphs may show intermittent data. Only 1 record per second is output to the graphs, and that is chosen somewhat at random.</p>",
"storeOutMessages": false,
"fwdInMessages": false,
"templateScope": "local",
"x": 1010,
"y": 720,
"wires": [
[]
]
},
{
"id": "6d8f9ed9.d3106",
"id": "69e2433b.25dcec",
"type": "comment",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "1. Concatenate sensor data and gateway information",
"info": "When sensor data comes in, it does not include gateway information. The delay\nnode acts as a trigger for an exec node running the command\n`unit_serial_number`.\n\nNote: This command is a binary that exists on Rigado Gateways, and may not exist\non other systems.\n\nThe unit serial number is saved to the flow context.",
"x": 1060,
"x": 1100,
"y": 180,
"wires": []
},
{
"id": "7073d16.71d633",
"id": "88b23f6c.7cd45",
"type": "comment",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "2. A dashboard switch controls sending",
"info": "The first formatter here moves the payload into a safer location: `sendPayload`\n(you'll see why shortly). It also pulls the unit serial number out of the flow\ncontext and adds it to the payload. The message is forwarded through a dashboard\nswitch.\n\nThe dashboard switch will put `true` or `false` in its payload, and forward the\nrest of the input message. It pipes all this to another formatter.\n\nThe final formatter examines the value of the payload (the state of the switch),\nand reacts accordingly. It will move the `sendPayload` back into `payload` and\nforward the message *only* if the dashboard switch is on.",
"x": 1050,
"x": 1090,
"y": 320,
"wires": []
},
{
"id": "d6c52fd3.0c31",
"id": "2fed45e2.ce1d2a",
"type": "comment",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "3. Send data to Amazon",
"info": "This node will send input messages to the Amazon lambda function that will\nprocess the data and forward it to storage or other dashboard applications.",
"x": 1050,
"x": 1090,
"y": 480,
"wires": []
},
{
"id": "9214d384.f972",
"id": "72c47f77.b2786",
"type": "comment",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "4. Graph the data on the dashboard",
"info": "This flow also graphs the incoming data on the dashboard. The delay node limits\nthe number of records to 1 per second. This is done to reduce the load on the\nGateway's CPU and memory.\n\nIf you connect multiple Thingys, or decrease the throttling of the delay node,\nyou may experience a drastic change in performance.",
"x": 1040,
"y": 660,
"x": 1080,
"y": 680,
"wires": []
},
{
"id": "df3605ea.3708c8",
"id": "6f5b2160.1b6f7",
"type": "function",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "check serial number",
"func": "if (flow.get(\"unitSerialNumber\")) return null;\nreturn {};",
"outputs": 1,
"noerr": 0,
"x": 840,
"x": 880,
"y": 240,
"wires": [
[
"43770f10.fa2dc"
"d018552a.dfb148"
]
]
},
{
"id": "545cf821.785bb8",
"id": "26745f68.9288f",
"type": "debug",
"z": "f1d953a9.52377",
"z": "155b7069.fcdeb",
"name": "",
"active": false,
"console": "false",
"complete": "true",
"x": 1010,
"x": 1050,
"y": 420,
"wires": []
},
{
"id": "7512d1ca.67979",
"id": "6f0d5570.dfed3c",
"type": "http request",
"z": "f1d953a9.52377",
"name": "Rigado Dev Kit Lambda",
"z": "155b7069.fcdeb",
"name": "Rigado Demo Kit Lambda",
"method": "POST",
"ret": "obj",
"url": "https://staug8zev0.execute-api.us-west-2.amazonaws.com/prod/datapoint/",
"tls": "",
"x": 970,
"x": 1010,
"y": 540,
"wires": [
[
"d5b8a1f0.daa9d"
"63ff7486.e7ce4c"
]
]
},