Posts: 179
Threads: 39
Joined: Mar 2016
Reputation:
6
Oh, a node red (dashboard) flow on my wish list is a template that displays a pared down version of the Sailgauge from SignalK (Teppo Kurki), or something like it.
Posts: 6
Threads: 1
Joined: Nov 2016
Reputation:
1
2017-04-16, 11:05 PM
(This post was last modified: 2017-04-16, 11:06 PM by jram.)
[attachment=86 Wrote:Saqqara pid='1238' dateline='1487719829']Oh, a node red (dashboard) flow on my wish list is a template that displays a pared down version of the Sailgauge from SignalK (Teppo Kurki), or something like it.
Do you mean something like this?
Posts: 287
Threads: 44
Joined: Mar 2016
Reputation:
5
@jram: beautiful !!! - any chance to share the code here?
BTW have just changed to op010 and cant load additional node-controls anymore - any hints?
Posts: 6
Threads: 1
Joined: Nov 2016
Reputation:
1
2017-04-18, 11:47 AM
(This post was last modified: 2017-04-18, 11:50 AM by jram.)
https://github.com/9H5G/SteelSeries-Canvas
and my instrumentation node:
[{"id":"7d86b62a.703bf8","type":"serial in","z":"332c51b4.221c3e","name":"","serial":"dccf3159.48fe5","x":109,"y":177,"wires":[["e6a5e4f3.c92b08","c0beae78.24ccb","406dd6fa.495758","df9b82d1.7be03","c1d439a6.ead4f8","241518fc.6fa128","171223ff.8e825c","608e8a58.58cdc4","8ac6f874.721638","8a969ff6.950da"]]},{"id":"e6a5e4f3.c92b08","type":"function","z":"332c51b4.221c3e","name":"","func":"var index = msg.payload.indexOf(\"MWV\");\n\nif (index >0){\n\nvar split = msg.payload.split(\",\");\nmsg.ave = Number(split[3]);\nmsg.value = Number(split[1]);\nreturn msg;\n \n}\n","outputs":1,"noerr":0,"x":275,"y":171,"wires":[["711c93e8.76c74c"]]},{"id":"711c93e8.76c74c","type":"ui_template","z":"332c51b4.221c3e","group":"ccd5bb6e.50fd28","name":"Wind","order":2,"width":"6","height":"6","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-2-min.js\"></script>\n<script>\nvar windDir1;\n (function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.value) != \"undefined\") windDir1.setValueAnimatedLatest(msg.value);\n if (typeof(msg.ave) != \"undefined\") windDir1.setValueAnimatedAverage(msg.ave);\n });\n })(scope);\n\n var sections = [steelseries.Section(10, 45, 'rgba(220, 0, 0, 0.3)'),\n steelseries.Section(45, 150, 'rgba(0, 220, 0, 0.3)'),\n steelseries.Section(315, 350, 'rgba(220, 0, 0, 0.3)'),\n steelseries.Section(210, 315, 'rgba(0, 220, 0, 0.3)')]\n\n // Define one area\n //areas = [steelseries.Section(0, 45, 'rgba(220, 0, 0, 0.3)')],\n\n windDir1 = new steelseries.WindDirection('canvasWindDir2', {\n size: 292,\n section: sections,\n lcdVisible: true,\n titleString: \"Wind Direction\",\n degreeScaleHalf: true,\n pointSymbolsVisible: false,\n lcdTitleStrings: ['Latest', 'Speed'],\n windspeed: true\n });\n \n windDir1.setFrameDesign(steelseries.FrameDesign.BLACK_METAL);\n windDir1.setBackgroundColor(steelseries.BackgroundColor.LIGHT_GRAY);\n windDir1.setPointerTypeAverage(steelseries.PointerType.TYPE17);\n windDir1.setPointerType(steelseries.PointerType.TYPE1);\n \n //windDir1.setLcdColor(steelseries.LcdColor.BLUE);\n \n</script>\n\n <canvas id=\"canvasWindDir2\" width=\"292\" height=\"292\"></canvas>\n","storeOutMessages":false,"fwdInMessages":true,"x":518,"y":159,"wires":[["bebd6202.6a8db"]]},{"id":"17e0e59.2a7dd1a","type":"ui_template","z":"332c51b4.221c3e","group":"ccd5bb6e.50fd28","name":"DepthMulti","order":3,"width":"6","height":"2","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar multi2;\n (function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.value) != \"undefined\") multi2.setValue(msg.value);\n });\n })(scope);\n\n // Define one area\n areas = [steelseries.Section(0, 45, 'rgba(220, 0, 0, 0.3)')],\n\n multi2 = new steelseries.DisplayMulti('canvasMulti2', {\n width: 200,\n height: 75,\n unitString: \"M\",\n unitStringVisible: true,\n headerString: \"Depth\",\n headerStringVisible: true,\n detailString: \"detail: \",\n detailStringVisible: false,\n linkOldValue: false,\n oldValue: 99.9\n\n });\n \n multi2.setFrameDesign(steelseries.FrameDesign.BLACK_METAL);\n multi2.setBackgroundColor(steelseries.BackgroundColor.LIGHT_GRAY);\n\n</script>\n\n <canvas id=\"canvasMulti2\" width=\"200\" height=\"80\"></canvas>\n\n","storeOutMessages":true,"fwdInMessages":false,"x":535,"y":115,"wires":[[]]},{"id":"c0beae78.24ccb","type":"function","z":"332c51b4.221c3e","name":"","func":"var index = msg.payload.indexOf(\"DBT\");\n\nif (index >0){\n\nvar split = msg.payload.split(\",\");\nif (split[0].indexOf(\"DBT\")){\n var metres = split[3];\n\n msg.payload = Number(metres);\n msg.value = msg.payload;\n }\nreturn msg;\n \n}\n","outputs":1,"noerr":0,"x":277,"y":120,"wires":[["8dd12b53.8cf798"]]},{"id":"85f4863.1ce8078","type":"ui_template","z":"332c51b4.221c3e","group":"ccd5bb6e.50fd28","name":"Position","order":4,"width":"6","height":"1","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar multi3;\n (function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.value) != \"undefined\") multi3.setValue(msg.value);\n });\n })(scope);\n\n // Define one area\n areas = [steelseries.Section(0, 45, 'rgba(220, 0, 0, 0.3)')],\n\n multi3 = new steelseries.DisplaySingle('canvasMulti3', {\n width: 400,\n height: 32,\n //value: \"<Auto-scrolling: true>\",\n autoScroll: true,\n valuesNumeric: false\n\n\n });\n \n //multi3.setFrameDesign(steelseries.FrameDesign.BLACK_METAL);\n //multi3.setBackgroundColor(steelseries.BackgroundColor.LIGHT_GRAY);\n\n</script>\n\n <canvas id=\"canvasMulti3\" width=\"400\" height=\"34\"></canvas>\n\n","storeOutMessages":true,"fwdInMessages":false,"x":526,"y":218,"wires":[[]]},{"id":"406dd6fa.495758","type":"function","z":"332c51b4.221c3e","name":"Position","func":"var index = msg.payload.indexOf(\"IIRMC\");\n\nif (index >0){\n\n var split = msg.payload.split(\",\");\n msg.value = split[4]+\" \"+split[3]+\" \"+split[6]+\" \"+split[5]+\" \";\n return msg; \n \n}\n","outputs":1,"noerr":0,"x":283,"y":220,"wires":[["85f4863.1ce8078"]]},{"id":"602bf408.97b5ac","type":"ui_template","z":"332c51b4.221c3e","group":"ccd5bb6e.50fd28","name":"DTWaypoint","order":5,"width":"6","height":"1","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar multi4;\n (function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.value) != \"undefined\") multi4.setValue(msg.value);\n });\n })(scope);\n\n // Define one area\n areas = [steelseries.Section(0, 45, 'rgba(220, 0, 0, 0.3)')],\n\n multi4 = new steelseries.DisplaySingle('canvasMulti4', {\n width: 400,\n height: 32,\n //value: \"<Auto-scrolling: true>\",\n autoScroll: true,\n valuesNumeric: false\n\n\n });\n \n //multi3.setFrameDesign(steelseries.FrameDesign.BLACK_METAL);\n //multi3.setBackgroundColor(steelseries.BackgroundColor.LIGHT_GRAY);\n\n</script>\n\n <canvas id=\"canvasMulti4\" width=\"400\" height=\"34\"></canvas>\n\n","storeOutMessages":true,"fwdInMessages":true,"x":536,"y":275,"wires":[[]]},{"id":"df9b82d1.7be03","type":"function","z":"332c51b4.221c3e","name":"","func":"var index = msg.payload.indexOf(\"ECRMB\");\n\nif (index ==3){\n\n var split = msg.payload.split(\",\");\n msg.value = split[5]+\" : \"+split[11]+\" T \"+split[10]+\" NM \";\n return msg; \n \n}\n","outputs":1,"noerr":0,"x":281,"y":284,"wires":[["602bf408.97b5ac"]]},{"id":"c1d439a6.ead4f8","type":"function","z":"332c51b4.221c3e","name":"","func":"var index = msg.payload.indexOf(\"IIRMC\");\n\nif (index >0){\n\n var split = msg.payload.split(\",\");\n msg.value = \"COG: \"+split[8]+\"T SOG: \"+split[7]+\" KT\";\n return msg; \n \n}\n","outputs":1,"noerr":0,"x":274,"y":338,"wires":[["35334659.9b009a"]]},{"id":"35334659.9b009a","type":"ui_template","z":"332c51b4.221c3e","group":"ccd5bb6e.50fd28","name":"COGSOG","order":6,"width":"6","height":"1","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar multi5;\n (function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.value) != \"undefined\") multi5.setValue(msg.value);\n });\n })(scope);\n\n // Define one area\n areas = [steelseries.Section(0, 45, 'rgba(220, 0, 0, 0.3)')],\n\n multi5 = new steelseries.DisplaySingle('canvasMulti5', {\n width: 400,\n height: 32,\n //value: \"<Auto-scrolling: true>\",\n autoScroll: true,\n valuesNumeric: false\n\n\n });\n \n //multi3.setFrameDesign(steelseries.FrameDesign.BLACK_METAL);\n //multi3.setBackgroundColor(steelseries.BackgroundColor.LIGHT_GRAY);\n\n</script>\n\n <canvas id=\"canvasMulti5\" width=\"400\" height=\"34\"></canvas>\n\n","storeOutMessages":true,"fwdInMessages":false,"x":527,"y":334,"wires":[[]]},{"id":"241518fc.6fa128","type":"function","z":"332c51b4.221c3e","name":"","func":"var index = msg.payload.indexOf(\"IIMTW\");\nif (index>0){\n var split = msg.payload.split(\",\");\n var index2 = msg.payload.indexOf(\"C*\");\n if (index2 > 0){\n msg.payload = Number(split[1]).toFixed(2);\n count = 0;\n return msg; \n }\n \n}\n","outputs":1,"noerr":0,"x":276,"y":384,"wires":[["38a0363d.32078a"]]},{"id":"171223ff.8e825c","type":"function","z":"332c51b4.221c3e","name":"","func":"var index = msg.payload.indexOf(\"IIVHW\");\n\nif (index >0){\n\n var split = msg.payload.split(\",\");\n msg.value = split[3]+\" \"+split[4];\n return msg; \n \n}\n","outputs":1,"noerr":0,"x":277,"y":429,"wires":[["87b6ade0.f64b8"]]},{"id":"87b6ade0.f64b8","type":"ui_template","z":"332c51b4.221c3e","group":"ccd5bb6e.50fd28","name":"Heading","order":7,"width":"6","height":"1","format":"<script src=\"/myjs/tween-min.js\"></script>\n<script src=\"/myjs/steelseries-min.js\"></script>\n<script>\nvar multi6;\n (function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.value) != \"undefined\") multi6.setValue(msg.value);\n });\n })(scope);\n\n // Define one area\n //areas = [steelseries.Section(0, 45, 'rgba(220, 0, 0, 0.3)')],\n\n multi6 = new steelseries.DisplaySingle('canvasMulti6', {\n width: 400,\n height: 32,\n //value: \"<Auto-scrolling: true>\",\n autoScroll: true,\n valuesNumeric: false\n\n\n });\n \n //multi3.setFrameDesign(steelseries.FrameDesign.BLACK_METAL);\n //multi3.setBackgroundColor(steelseries.BackgroundColor.LIGHT_GRAY);\n\n</script>\n\n <canvas id=\"canvasMulti6\" width=\"400\" height=\"34\"></canvas>\n\n","storeOutMessages":true,"fwdInMessages":false,"x":443,"y":433,"wires":[[]]},{"id":"93313255.6cdbc","type":"ui_chart","z":"332c51b4.221c3e","name":"Depth","group":"ccd5bb6e.50fd28","order":10,"width":"6","height":"4","label":"Depth","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"bezier","nodata":"","ymin":"","ymax":"","removeOlder":"6","removeOlderPoints":"","removeOlderUnit":"3600","cutout":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":740,"y":47,"wires":[[],[]]},{"id":"e15175f0.e37c68","type":"ui_chart","z":"332c51b4.221c3e","name":"Wind Speed","group":"ccd5bb6e.50fd28","order":9,"width":"6","height":"4","label":"Wind Speed","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"6","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":728,"y":198,"wires":[[],[]]},{"id":"83867953.abdef8","type":"function","z":"332c51b4.221c3e","name":"","func":"msg.payload = msg.ave;\nreturn msg;","outputs":1,"noerr":0,"x":704,"y":268,"wires":[["e15175f0.e37c68"]]},{"id":"bebd6202.6a8db","type":"delay","z":"332c51b4.221c3e","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":723,"y":337,"wires":[["83867953.abdef8"]]},{"id":"d7cf4a81.02e7e8","type":"delay","z":"332c51b4.221c3e","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"5","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":557,"y":48,"wires":[["93313255.6cdbc"]]},{"id":"a2d2eda2.37408","type":"delay","z":"332c51b4.221c3e","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"10","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":564,"y":386,"wires":[["3d1330d5.50817"]]},{"id":"8dd12b53.8cf798","type":"smooth","z":"332c51b4.221c3e","name":"","action":"mean","count":"60","round":"2","x":365,"y":64,"wires":[["17e0e59.2a7dd1a","d7cf4a81.02e7e8"]]},{"id":"38a0363d.32078a","type":"smooth","z":"332c51b4.221c3e","name":"","action":"mean","count":"600","round":"1","x":409,"y":386,"wires":[["a2d2eda2.37408"]]},{"id":"608e8a58.58cdc4","type":"udp out","z":"332c51b4.221c3e","name":"","addr":"192.168.43.255","iface":"","port":"2394","ipv":"udp4","outport":"2394","base64":false,"multicast":"broad","x":166.71434020996094,"y":54.31744384765625,"wires":[]},{"id":"3d1330d5.50817","type":"mqtt out","z":"332c51b4.221c3e","name":"","topic":"nav/watertemp","qos":"","retain":"","broker":"fb7a84b7.6b8518","x":745,"y":404,"wires":[]},{"id":"da41542c.f974e8","type":"function","z":"332c51b4.221c3e","name":"Save to DB","func":"var sql = \"\";\nvar d = new Date();\nvar epoch = d.getTime();\nvar outputs = [];\n\nif (msg.payload !== \"\"){\n\n sql = \"INSERT INTO NMEA (nmea) \" +\n \"VALUES ('\"+msg.payload+\"')\";\n outputs.push({topic ![Confused Confused](https://forum.openmarine.net/images/smilies/confused.png) ql}); \n \n \n// Update the status with current timestamp\nvar now = new Date();\nvar yyyy = now.getFullYear();\nvar mm = now.getMonth() < 9 ? \"0\" + (now.getMonth() + 1) : (now.getMonth() + 1); // getMonth() is zero-based\nvar dd = now.getDate() < 10 ? \"0\" + now.getDate() : now.getDate();\nvar hh = now.getHours() < 10 ? \"0\" + now.getHours() : now.getHours();\nvar mmm = now.getMinutes() < 10 ? \"0\" + now.getMinutes() : now.getMinutes();\nvar ss = now.getSeconds() < 10 ? \"0\" + now.getSeconds() : now.getSeconds();\nnode.status({fill:\"blue\",shape:\"ring\",text:\"Last update: \"+dd + \".\" + mm + \".\" + yyyy + \" \" + hh + \":\" + mmm + \":\" + ss}); \n\nreturn [ outputs ];\n}","outputs":1,"noerr":0,"x":540,"y":672,"wires":[["a87ddc32.54d9d"]]},{"id":"a87ddc32.54d9d","type":"sqlite","z":"332c51b4.221c3e","mydb":"4b22966c.c97b68","name":"Voyage DB","x":694,"y":670,"wires":[[]]},{"id":"cdec4f99.2cde8","type":"delay","z":"332c51b4.221c3e","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":110,"y":580,"wires":[["72f8302c.54be9","e903051d.29f518","d83b1f2a.da9b9"]]},{"id":"e903051d.29f518","type":"function","z":"332c51b4.221c3e","name":"DDMM->DD.dddd","func":"var index = msg.payload.indexOf(\"IIRMC\");\n\nif (index >0){\n var split = msg.payload.split(\",\");\n if(split[7]!=\"0.0\"){\n \n var split = msg.payload.split(\",\");\n //msg.value = split[4]+\" \"+split[3]+\" \"+split[6]+\" \"+split[5]+\" \";\n\n // Convert ddmm.mmmm to degrees decimal\n var deg = split[3].toString().slice(0,2);\n var min = split[3].toString().slice(2)/60;\n var d = parseFloat(deg) + parseFloat(min);\n\n // Convert dddmm.mmmm to degrees decimal\n var deg = split[5].toString().slice(0,3);\n var min = split[5].toString().slice(3)/60;\n var e = parseFloat(deg) + parseFloat(min); \n\n if (split[4]=='S'){\n d = d*-1;\n }\n if (split[6]=='W'){\n e = e*-1;\n }\n \n msg.payload = split[0]+\"|\"+split[1]+\"|\"+split[2]+\"|\"+d.toFixed(6) + \"|\" + e.toFixed(6)+\"|\"+split[7]+\"|\"+split[9]+\"|\"+split[10]+\"|\"+split[11];\n // node.status({fill:\"blue\",shape:\"ring\",text:\"Last update: \"+msg.payload+\" \"+split[6]});\n return (msg);\n \n }else{\n \n msg.payload =\"\";\n \n }\n \n}\n","outputs":1,"noerr":0,"x":350,"y":660,"wires":[["da41542c.f974e8"]]},{"id":"8a969ff6.950da","type":"debug","z":"332c51b4.221c3e","name":"","active":false,"console":"false","complete":"false","x":670,"y":580,"wires":[]},{"id":"72f8302c.54be9","type":"function","z":"332c51b4.221c3e","name":"DDMM->DD.dddd","func":" var index = msg.payload.indexOf(\"IIRMC\");\n\nif (index >0){\n var split = msg.payload.split(\",\");\n if(split[7]!=\"0.0\"){\n\n // Convert ddmm.mmmm to degrees decimal\n var deg = split[3].toString().slice(0,2);\n var min = split[3].toString().slice(2)/60;\n var lat = parseFloat(deg) + parseFloat(min);\n\n // Convert dddmm.mmmm to degrees decimal\n var deg = split[5].toString().slice(0,3);\n var min = split[5].toString().slice(3)/60;\n var lon = parseFloat(deg) + parseFloat(min); \n \n var speed = split[7];//.toString();\n\n if (split[4]=='S'){\n lat = lat*-1;\n }\n if (split[6]=='W'){\n lon = lon*-1;\n }\n\n msg.payload = { name:\"ag\", lat:lat, lon:lon, icon: \"ship\",speed: speed*5, bearing: split[8]};\n return (msg);\n \n }else{\n \n msg.payload =\"\";\n \n }\n}\n\n\n","outputs":1,"noerr":0,"x":319,"y":479,"wires":[["b16f3800.a78718","8a969ff6.950da"]]},{"id":"b16f3800.a78718","type":"worldmap","z":"332c51b4.221c3e","name":"","lat":"","lon":"","zoom":"","cluster":"","maxage":"","usermenu":"show","panit":"true","x":654,"y":525,"wires":[]},{"id":"fc8293a8.60302","type":"function","z":"332c51b4.221c3e","name":"","func":"var map = msg.payload;\nmsg.payload={ command:{layer:map, icon: \"ship\",lat:-21.685,lon:45.1568,zoom:17} };\nreturn msg;","outputs":1,"noerr":0,"x":432,"y":522,"wires":[["b16f3800.a78718"]]},{"id":"da5eae2c.dc9ce","type":"ui_dropdown","z":"332c51b4.221c3e","name":"","label":"Map","group":"ccd5bb6e.50fd28","order":11,"width":"1","height":"1","passthru":true,"options":[{"label":"Satellite","value":"Esri Satellite","type":"str"},{"label":"OSM","value":"OSM","type":"str"}],"payload":"","topic":"","x":291,"y":524,"wires":[["fc8293a8.60302"]]},{"id":"16238767.8bd539","type":"function","z":"332c51b4.221c3e","name":"","func":"//var int ;\nlat = 25.049350;\nlon = -77.505733;\n//rssi = msg.payload.rssi;\n//dist = msg.payload.dist;\n//color= \"aqua\";\n//iconColor =msg.payload.color;\nlayer= \"test\";\ncommand = {zoom :13};\ntime = new Date().toString();\n//var ID=ID+1;\nmsg.payload ={name:time,lat,lon,layer,command};\nreturn msg;","outputs":1,"noerr":0,"x":432,"y":578,"wires":[["b16f3800.a78718","8a969ff6.950da"]]},{"id":"5a973319.26be7c","type":"inject","z":"332c51b4.221c3e","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":310,"y":560,"wires":[["16238767.8bd539"]]},{"id":"9c10ef06.ac267","type":"function","z":"332c51b4.221c3e","name":"Draw track","func":" var index = msg.payload.indexOf(\"IIRMC\");\n\nif (index >0){\n var split = msg.payload.split(\",\");\n if(split[7]!=\"0.0\"){\n\n // Convert ddmm.mmmm to degrees decimal\n var deg = split[3].toString().slice(0,2);\n var min = split[3].toString().slice(2)/60;\n var lat = parseFloat(deg) + parseFloat(min);\n\n // Convert dddmm.mmmm to degrees decimal\n var deg = split[5].toString().slice(0,3);\n var min = split[5].toString().slice(3)/60;\n var lon = parseFloat(deg) + parseFloat(min); \n \n var speed = split[7];//.toString();\n\n if (split[4]=='S'){\n lat = lat*-1;\n }\n if (split[6]=='W'){\n lon = lon*-1;\n }\n // msg.payload = { command:{layer:\"Esri Satellite\",lat:0,lon:0,zoom:10} };\n// msg.payload = { command:{layer: \"Ezri Satellite\", name:\"ag\",speed: speed, bearing: split[8], lat:lat, lon:lon, icon: \"ship\"}}\n\n//color= \"aqua\";\n//iconColor =msg.payload.color;\nlayer= \"ag\";\ncommand =\"\";\n//command = {zoom :15};\ntime = new Date().toString();\n//var ID=ID+1;\nmsg.payload ={name:time,lat,lon, layer, command, iconColor:\"BlueViolet\" };\nreturn (msg);\n }else{\n msg.payload =\"\";\n }\n}\n\n\n","outputs":1,"noerr":0,"x":470,"y":620,"wires":[["b16f3800.a78718","8a969ff6.950da"]]},{"id":"8ac6f874.721638","type":"function","z":"332c51b4.221c3e","name":"","func":" var index = msg.payload.indexOf(\"IIRMC\");\n\nif (msg.payload.indexOf(\"IIRMC\")>0){\n \nreturn msg;\n}","outputs":1,"noerr":0,"x":100,"y":400,"wires":[["cdec4f99.2cde8"]]},{"id":"d83b1f2a.da9b9","type":"delay","z":"332c51b4.221c3e","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"10","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":298,"y":615,"wires":[["9c10ef06.ac267"]]},{"id":"dccf3159.48fe5","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"38400","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"ccd5bb6e.50fd28","type":"ui_group","z":"","name":"","tab":"da2a5792.57b258","order":1,"disp":false,"width":"12"},{"id":"fb7a84b7.6b8518","type":"mqtt-broker","z":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"4b22966c.c97b68","type":"sqlitedb","z":"","db":"/mnt/usb_1//sqlite/nodered/voyagedata"},{"id":"da2a5792.57b258","type":"ui_tab","z":"","name":"Instruments","icon":"dashboard","order":1}]
I'm not using Openplotter yet but I've been watching for a while. I'm getting ready to run a copy and do some 'research' over the summer. Hopefully I'll be able to contribute more at that time. P.S. The embedded map is just for fun and a bit flaky - if you can improve on it, please post.
Posts: 1,230
Threads: 103
Joined: Mar 2016
Reputation:
72
Wasn't sure if starting a new post to share some node red was a bit untidy so maybe here's as good a place as any - is it worth having a sticky thread for people to share node-red code for others?
Anyway, first off -
This one takes a signalk feed from openplotter, turns it into json then strips out individual messages which are slowed down and sent to a gauge and graph - messages are from ds18B20 thermometers attached to engine head, alternator and exhaust.
(Also, openplotter turns the eng temp into a MTW water temp NMEA message which can be viewed in the dashboard of opencpn, really handy to see it all the time on opencpn running on an xperia android tablet in the cockpit)
Code: [
{
"id": "e4f071f4.9d219",
"type": "websocket in",
"z": "f2a52aa4.57c488",
"name": "SignalK input",
"server": "8d5a3102.d114b",
"client": "",
"x": 90,
"y": 60,
"wires": [
[
"6236cf2.e82443"
]
]
},
{
"id": "6236cf2.e82443",
"type": "json",
"z": "f2a52aa4.57c488",
"name": "",
"x": 110,
"y": 140,
"wires": [
[
"73afab5a.9132e4",
"4723ff3f.7f704",
"45d5799b.eb21c8"
]
]
},
{
"id": "73afab5a.9132e4",
"type": "jsonpath",
"z": "f2a52aa4.57c488",
"expression": "$.updates..values[?(@.path==\"propulsion.eng.temperature\")]..value",
"split": true,
"name": "EngTemp",
"x": 280,
"y": 40,
"wires": [
[
"48b77fcb.41eb6",
"e144dcc3.dd3bc"
]
]
},
{
"id": "48b77fcb.41eb6",
"type": "delay",
"z": "f2a52aa4.57c488",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "minute",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 430,
"y": 40,
"wires": [
[
"7f2f9ac3.dd65f4"
]
]
},
{
"id": "7f2f9ac3.dd65f4",
"type": "function",
"z": "f2a52aa4.57c488",
"name": "Convert to deg C",
"func": "var numInput = Number(msg.payload);\nmsg.topic = \"Eng\";\nvar T = numInput-273.15;\nmsg.payload = T.toFixed(1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 40,
"wires": [
[
"54c09bb3.2604a4"
]
]
},
{
"id": "54c09bb3.2604a4",
"type": "ui_chart",
"z": "f2a52aa4.57c488",
"name": "EngineGraph",
"group": "fd9a5f04.59fd5",
"order": 0,
"width": "23",
"height": "7",
"label": "Engine temperature history",
"chartType": "line",
"legend": "true",
"xformat": "HH:mm",
"interpolate": "linear",
"nodata": "data",
"ymin": "",
"ymax": "",
"removeOlder": "4",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": "",
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 800,
"y": 40,
"wires": [
[],
[]
]
},
{
"id": "618b030f.22a17c",
"type": "ui_gauge",
"z": "f2a52aa4.57c488",
"name": "EngTempGauge",
"group": "bdca5f6f.4b19b",
"order": 1,
"width": "3",
"height": "3",
"gtype": "gage",
"title": "Engine temperature",
"label": "Deg C",
"format": "{{value}}",
"min": 0,
"max": "120",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 800,
"y": 80,
"wires": []
},
{
"id": "4723ff3f.7f704",
"type": "jsonpath",
"z": "f2a52aa4.57c488",
"expression": "$.updates..values[?(@.path==\"propulsion.alt.temperature\")]..value",
"split": true,
"name": "Alt Temp",
"x": 280,
"y": 140,
"wires": [
[
"d06b0028.8768c",
"d8b26bd8.f0e168"
]
]
},
{
"id": "d06b0028.8768c",
"type": "delay",
"z": "f2a52aa4.57c488",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "minute",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 430,
"y": 120,
"wires": [
[
"a3a1d695.19e4d8"
]
]
},
{
"id": "a3a1d695.19e4d8",
"type": "function",
"z": "f2a52aa4.57c488",
"name": "Convert to deg C",
"func": "var numInput = Number(msg.payload);\nmsg.topic = \"Eng\";\nvar T = numInput-273.15;\nmsg.payload = T.toFixed(1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 120,
"wires": [
[
"43b342b.a6e44bc"
]
]
},
{
"id": "43b342b.a6e44bc",
"type": "ui_chart",
"z": "f2a52aa4.57c488",
"name": "Alt graph",
"group": "fd9a5f04.59fd5",
"order": 0,
"width": "23",
"height": "7",
"label": "Alt temperature history",
"chartType": "line",
"legend": "false",
"xformat": "HH:mm",
"interpolate": "linear",
"nodata": "",
"ymin": "",
"ymax": "",
"removeOlder": "4",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": "",
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 780,
"y": 120,
"wires": [
[],
[]
]
},
{
"id": "17de1699.4e1859",
"type": "ui_gauge",
"z": "f2a52aa4.57c488",
"name": "AltTempGauge",
"group": "bdca5f6f.4b19b",
"order": 1,
"width": "3",
"height": "3",
"gtype": "gage",
"title": "Alternator temperature",
"label": "Deg C",
"format": "{{value}}",
"min": 0,
"max": "120",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 800,
"y": 160,
"wires": []
},
{
"id": "45d5799b.eb21c8",
"type": "jsonpath",
"z": "f2a52aa4.57c488",
"expression": "$.updates..values[?(@.path==\"propulsion.exh.temperature\")]..value",
"split": true,
"name": "Exh Temp",
"x": 280,
"y": 240,
"wires": [
[
"29f50de2.54f8a2",
"4b8ee8f7.3b4618"
]
]
},
{
"id": "29f50de2.54f8a2",
"type": "delay",
"z": "f2a52aa4.57c488",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "minute",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 430,
"y": 200,
"wires": [
[
"32821815.27b8c8"
]
]
},
{
"id": "32821815.27b8c8",
"type": "function",
"z": "f2a52aa4.57c488",
"name": "Convert to deg C",
"func": "var numInput = Number(msg.payload);\nmsg.topic = \"Eng\";\nvar T = numInput-273.15;\nmsg.payload = T.toFixed(1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 200,
"wires": [
[
"33c47e65.c35d62"
]
]
},
{
"id": "33c47e65.c35d62",
"type": "ui_chart",
"z": "f2a52aa4.57c488",
"name": "ExhGraph",
"group": "fd9a5f04.59fd5",
"order": 0,
"width": "23",
"height": "7",
"label": "Exh temperature history",
"chartType": "line",
"legend": "true",
"xformat": "HH:mm",
"interpolate": "linear",
"nodata": "waiting",
"ymin": "",
"ymax": "",
"removeOlder": "4",
"removeOlderPoints": "",
"removeOlderUnit": "3600",
"cutout": "",
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"x": 780,
"y": 200,
"wires": [
[],
[]
]
},
{
"id": "a29c25bf.5041f8",
"type": "ui_gauge",
"z": "f2a52aa4.57c488",
"name": "ExhTempGauge",
"group": "bdca5f6f.4b19b",
"order": 1,
"width": "3",
"height": "3",
"gtype": "gage",
"title": "Exhaust temperature",
"label": "Deg C",
"format": "{{value}}",
"min": 0,
"max": "120",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 805,
"y": 240,
"wires": []
},
{
"id": "4b8ee8f7.3b4618",
"type": "delay",
"z": "f2a52aa4.57c488",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 430,
"y": 240,
"wires": [
[
"3a014991.dc6b26"
]
]
},
{
"id": "3a014991.dc6b26",
"type": "function",
"z": "f2a52aa4.57c488",
"name": "Convert to deg C",
"func": "var numInput = Number(msg.payload);\nmsg.topic = \"Eng\";\nvar T = numInput-273.15;\nmsg.payload = T.toFixed(1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 240,
"wires": [
[
"a29c25bf.5041f8"
]
]
},
{
"id": "d8b26bd8.f0e168",
"type": "delay",
"z": "f2a52aa4.57c488",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "minute",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 430,
"y": 160,
"wires": [
[
"13c78571.dc64fb"
]
]
},
{
"id": "13c78571.dc64fb",
"type": "function",
"z": "f2a52aa4.57c488",
"name": "Convert to deg C",
"func": "var numInput = Number(msg.payload);\nmsg.topic = \"Eng\";\nvar T = numInput-273.15;\nmsg.payload = T.toFixed(1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 160,
"wires": [
[
"17de1699.4e1859"
]
]
},
{
"id": "e144dcc3.dd3bc",
"type": "delay",
"z": "f2a52aa4.57c488",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"x": 430,
"y": 80,
"wires": [
[
"ddd247e5.33eef8"
]
]
},
{
"id": "ddd247e5.33eef8",
"type": "function",
"z": "f2a52aa4.57c488",
"name": "Convert to deg C",
"func": "var numInput = Number(msg.payload);\nmsg.topic = \"Eng\";\nvar T = numInput-273.15;\nmsg.payload = T.toFixed(1);\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 80,
"wires": [
[
"618b030f.22a17c"
]
]
},
{
"id": "8d5a3102.d114b",
"type": "websocket-listener",
"z": "",
"path": "ws://localhost:3000/signalk/v1/stream",
"wholemsg": "false"
},
{
"id": "fd9a5f04.59fd5",
"type": "ui_group",
"z": "",
"name": "Eng Temp Graphs",
"tab": "7cab7589.6fad8c",
"disp": true,
"width": "23"
},
{
"id": "bdca5f6f.4b19b",
"type": "ui_group",
"z": "",
"name": "Temperature gauges",
"tab": "5eb912bd.df78bc",
"disp": true,
"width": "24"
},
{
"id": "7cab7589.6fad8c",
"type": "ui_tab",
"z": "",
"name": "Graphs",
"icon": "dashboard",
"order": 2
},
{
"id": "5eb912bd.df78bc",
"type": "ui_tab",
"z": "",
"name": "Gauges",
"icon": "dashboard",
"order": 1
}
]
This one displays the Pi processor temperature..
Code: [
{
"id": "a276b9a5.e58698",
"type": "exec",
"z": "f2a52aa4.57c488",
"command": "vcgencmd ",
"addpay": true,
"append": "measure_temp",
"useSpawn": "",
"timer": "",
"name": "",
"x": 290,
"y": 360,
"wires": [
[
"7abd88bc.53ddb8",
"fe55ec93.353fb"
],
[],
[]
]
},
{
"id": "7e75445e.4ae52c",
"type": "inject",
"z": "f2a52aa4.57c488",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "30",
"crontab": "",
"once": true,
"x": 130,
"y": 360,
"wires": [
[
"a276b9a5.e58698"
]
]
},
{
"id": "7abd88bc.53ddb8",
"type": "ui_text",
"z": "f2a52aa4.57c488",
"group": "bdca5f6f.4b19b",
"order": 0,
"width": "2",
"height": "3",
"name": "Textdisplay",
"label": "Pi processor ",
"format": "{{msg.payload}}",
"layout": "col-center",
"x": 470,
"y": 320,
"wires": []
},
{
"id": "fe55ec93.353fb",
"type": "debug",
"z": "f2a52aa4.57c488",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 470,
"y": 440,
"wires": []
},
{
"id": "bdca5f6f.4b19b",
"type": "ui_group",
"z": "",
"name": "Temperature gauges",
"tab": "5eb912bd.df78bc",
"disp": true,
"width": "24"
},
{
"id": "5eb912bd.df78bc",
"type": "ui_tab",
"z": "",
"name": "Gauges",
"icon": "dashboard",
"order": 1
}
]
And this one controls a gpio pin as an output with a countdown timer. Set to seconds at the moment as I've only just got it working, easy to change to minutes by changing the "1000" to "60000". The output pin then controls a mosfet which turns on and off a fuel pump which in turn fills the diesel day tank from the main tank.
Code: [
{
"id": "7aafc8a2.97a328",
"type": "rpi-gpio out",
"z": "f2a52aa4.57c488",
"name": "GPIO 11 - fuel pump",
"pin": "11",
"set": true,
"level": "0",
"out": "out",
"x": 600,
"y": 520,
"wires": []
},
{
"id": "1edad220.4ff64e",
"type": "ui_text",
"z": "f2a52aa4.57c488",
"group": "9b61c17a.b3e3d",
"order": 0,
"width": "3",
"height": "1",
"name": "IsPumpRunning",
"label": "Pump=",
"format": "{{msg.payload}}",
"layout": "row-left",
"x": 580,
"y": 580,
"wires": []
},
{
"id": "d9824fa0.c7e1d",
"type": "debug",
"z": "f2a52aa4.57c488",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 570,
"y": 620,
"wires": []
},
{
"id": "7ac03ac7.e1f314",
"type": "function",
"z": "f2a52aa4.57c488",
"name": "",
"func": "\nvar value = context.get('value') || 1000;\n\nif (msg.topic == \"value\")\n{\n value = msg.payload * 1000;\n context.set('value',value); \n}\n\nelse if (msg.topic == \"start\")\n{\n var timer = setTimeout( myTimer,value);\n context.set('timer',timer); \n var count = value/1000;\n msg.payload=count;\n node.send([null,msg]);\n var countdown = setInterval(myCountdown, 1000);\n context.set('countdown',countdown);\n}\n\nelse if (msg.topic == \"stop\")\n{\n var timerstop = context.get('timer');\n clearTimeout(timerstop);\n var countdownstop = context.get('countdown');\n clearInterval(countdownstop);\n msg.payload = \"0\";\n node.send([msg,{ payload: \"Finished\" }]);\n}\n\n\nfunction myTimer() {\n msg.payload = \"0\";\n node.send([msg,{ payload: \"Finished\" }]);\n var countdownstop = context.get('countdown');\n clearInterval(countdownstop);\n}\n\nfunction myCountdown() {\n count=count-1;\n msg.payload=count; \n node.send([null,msg]);\n}\n",
"outputs": "2",
"noerr": 0,
"x": 370,
"y": 620,
"wires": [
[
"d9824fa0.c7e1d",
"7aafc8a2.97a328",
"1edad220.4ff64e"
],
[
"c6ccc0e8.112c6"
]
]
},
{
"id": "b6e2e216.485f5",
"type": "ui_numeric",
"z": "f2a52aa4.57c488",
"name": "",
"label": "Pump Time",
"group": "9b61c17a.b3e3d",
"order": 0,
"width": "3",
"height": "1",
"passthru": true,
"topic": "value",
"format": "{{value}}",
"min": "1",
"max": "30",
"step": 1,
"x": 190,
"y": 620,
"wires": [
[
"7ac03ac7.e1f314"
]
]
},
{
"id": "9ed2a8a6.1ba348",
"type": "ui_button",
"z": "f2a52aa4.57c488",
"name": "",
"group": "9b61c17a.b3e3d",
"order": 0,
"width": "1",
"height": "1",
"label": "Start",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "1",
"payloadType": "num",
"topic": "start",
"x": 170,
"y": 540,
"wires": [
[
"7ac03ac7.e1f314",
"7aafc8a2.97a328",
"1edad220.4ff64e"
]
]
},
{
"id": "5626da9f.3d51d4",
"type": "ui_button",
"z": "f2a52aa4.57c488",
"name": "",
"group": "9b61c17a.b3e3d",
"order": 0,
"width": "1",
"height": "1",
"label": "Stop",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "stop",
"x": 170,
"y": 580,
"wires": [
[
"7ac03ac7.e1f314"
]
]
},
{
"id": "c6ccc0e8.112c6",
"type": "ui_text",
"z": "f2a52aa4.57c488",
"group": "9b61c17a.b3e3d",
"order": 0,
"width": "5",
"height": "1",
"name": "",
"label": "Timer",
"format": "{{msg.payload}} Seconds",
"layout": "row-spread",
"x": 550,
"y": 660,
"wires": []
},
{
"id": "9b61c17a.b3e3d",
"type": "ui_group",
"z": "",
"name": "Pump",
"tab": "5eb912bd.df78bc",
"disp": true,
"width": "11"
},
{
"id": "5eb912bd.df78bc",
"type": "ui_tab",
"z": "",
"name": "Gauges",
"icon": "dashboard",
"order": 1
}
]
And finally this one either turns off the Pi or reboots it, closing down Opencpn first then waiting seconds.
Code: [
{
"id": "cb4dd236.be89",
"type": "inject",
"z": "f2a52aa4.57c488",
"name": "shutdown!",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 140,
"y": 1020,
"wires": [
[
"bac39e6f.1de66"
]
]
},
{
"id": "bac39e6f.1de66",
"type": "exec",
"z": "f2a52aa4.57c488",
"command": "killall -s TERM opencpn ",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "Shutdown Opencpn",
"x": 310,
"y": 980,
"wires": [
[],
[
"f7cda5f8.20b658"
],
[]
]
},
{
"id": "f7cda5f8.20b658",
"type": "delay",
"z": "f2a52aa4.57c488",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 480,
"y": 980,
"wires": [
[
"5c164727.7e38c8"
]
]
},
{
"id": "a4b1a0dd.d1a0c",
"type": "ui_button",
"z": "f2a52aa4.57c488",
"name": "shutdown",
"group": "5cd0dd6a.d309e4",
"order": 8,
"width": "3",
"height": "1",
"label": "Shutdown!",
"color": "red",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "date",
"topic": "",
"x": 140,
"y": 940,
"wires": [
[
"bac39e6f.1de66"
]
]
},
{
"id": "5c164727.7e38c8",
"type": "exec",
"z": "f2a52aa4.57c488",
"command": "sudo shutdown -h now",
"addpay": true,
"append": "",
"useSpawn": "",
"timer": "",
"name": "Shutdown Pi",
"x": 630,
"y": 980,
"wires": [
[],
[],
[]
]
},
{
"id": "1bd3f953.598ed7",
"type": "inject",
"z": "f2a52aa4.57c488",
"name": "Reboot",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 130,
"y": 1140,
"wires": [
[
"2e9e7073.f34f2"
]
]
},
{
"id": "2e9e7073.f34f2",
"type": "exec",
"z": "f2a52aa4.57c488",
"command": "killall -s TERM opencpn ",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "Shutdown Opencpn",
"x": 310,
"y": 1100,
"wires": [
[],
[
"af00df4e.6d5a9"
],
[]
]
},
{
"id": "af00df4e.6d5a9",
"type": "delay",
"z": "f2a52aa4.57c488",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 480,
"y": 1100,
"wires": [
[
"5a516ec.7fb8a9"
]
]
},
{
"id": "31ec7f5b.80ef9",
"type": "ui_button",
"z": "f2a52aa4.57c488",
"name": "Reboot",
"group": "5cd0dd6a.d309e4",
"order": 8,
"width": "3",
"height": "1",
"label": "Reboot",
"color": "green",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "date",
"topic": "",
"x": 140,
"y": 1060,
"wires": [
[
"2e9e7073.f34f2"
]
]
},
{
"id": "5a516ec.7fb8a9",
"type": "exec",
"z": "f2a52aa4.57c488",
"command": "sudo reboot",
"addpay": true,
"append": "",
"useSpawn": "",
"timer": "",
"name": "Reboot Pi",
"x": 620,
"y": 1100,
"wires": [
[],
[],
[]
]
},
{
"id": "5cd0dd6a.d309e4",
"type": "ui_group",
"z": "",
"name": "Shutdown",
"tab": "5eb912bd.df78bc",
"disp": true,
"width": "6"
},
{
"id": "5eb912bd.df78bc",
"type": "ui_tab",
"z": "",
"name": "Gauges",
"icon": "dashboard",
"order": 1
}
]
The final page -
Anyone else have some late night work to share
Posts: 90
Threads: 11
Joined: Jan 2017
Reputation:
2
Is there a good "How-to" for Node Red somewhere? Any recommended reading? on using node in general?
Posts: 176
Threads: 44
Joined: Mar 2016
Reputation:
0
Puh...
I hope node red will become more simple-user friedly.
I'd like to have such nice gauges, but i want to go sailing and not to beginn a new profession :-).
best regards,
Martin
Posts: 179
Threads: 39
Joined: Mar 2016
Reputation:
6
I think that's part of what we all hope to achieve here: pooling ideas and code that Sailoog can cherry pick for a "default" Node Red config.
But of course the nature of this is we all have different hardware and apply it in different applications, so what they could make turnkey would be rather general.
Posts: 3,013
Threads: 62
Joined: Mar 2016
Reputation:
282
2017-05-25, 04:32 PM
(This post was last modified: 2017-05-25, 04:34 PM by Sailoog.)
(2017-05-05, 12:12 AM)Saqqara Wrote: I think that's part of what we all hope to achieve here: pooling ideas and code that Sailoog can cherry pick for a "default" Node Red config.
But of course the nature of this is we all have different hardware and apply it in different applications, so what they could make turnkey would be rather general.
Yessss, I would like to add a default node-red panel instruments but I do not have time to play with it
PaddyB jram these gauges look sexy
Posts: 8
Threads: 2
Joined: Jul 2022
Reputation:
0
Hi @jram,
In your ui_template, you have lines to get scripts like <script src="/myjs/tween-min.js"></script>
On the Rapberry Pi & SignalK setup, what is the root path before the /myjs and is there an environment variable to setup? I have done many searches on the internet to find the root path of node red but I haven't found it; I would like be able to put png images for buttons.
Best regards
Pierre
|