Commit fb1c0af8 by Tref

include node-red configuration

parent bd8c3f69
Showing with 2 additions and 0 deletions
[{"id":"9a49eee8.a93ee","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"6923df5.315752","type":"ui_button","z":"9a49eee8.a93ee","name":"","group":"6f182569.913e1c","order":2,"width":0,"height":0,"passthru":false,"label":"Engine diagnostics","tooltip":"Select the block number & start diagnostics","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":250,"y":140,"wires":[["d2b1345e.189638"]]},{"id":"d2b1345e.189638","type":"ui_text_input","z":"9a49eee8.a93ee","name":"","label":"Block number [1-127]","tooltip":"Select the block number to read","group":"6f182569.913e1c","order":1,"width":0,"height":0,"passthru":false,"mode":"number","delay":"0","topic":"","x":250,"y":200,"wires":[["293414fd.45d3ac"]]},{"id":"922ec540.570c88","type":"mqtt out","z":"9a49eee8.a93ee","name":"","topic":"/master/app/server/diagnostics/browser/blockreading","qos":"","retain":"","broker":"278f5a97.697a66","x":640,"y":120,"wires":[]},{"id":"293414fd.45d3ac","type":"function","z":"9a49eee8.a93ee","name":"","func":"if (msg.payload >= 1 && msg.payload <= 127){\n msg.payload = msg.payload.toString();\n msg.topic = \"ECU request\";\n return [msg, null];\n}else{\n msg.payload = \"ERROR: number must be between 1-127, was: \" + msg.payload;\n msg.topic = \"error\"\n return [null, msg];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","x":480,"y":200,"wires":[["922ec540.570c88","ceceb9d8.c18858","e6ed4f92.c07ab"],["e36ef48f.2686d8"]]},{"id":"bb58dd9a.a96a","type":"ui_toast","z":"9a49eee8.a93ee","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":710,"y":40,"wires":[]},{"id":"b2a99d47.454e9","type":"function","z":"9a49eee8.a93ee","name":"","func":"if(msg.topic == \"error\"){\n return msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":40,"wires":[["bb58dd9a.a96a"]]},{"id":"289af6a5.2334da","type":"link in","z":"9a49eee8.a93ee","name":"","links":["e36ef48f.2686d8","9b498cce.cf961","6b54d767.f6fd18","eb397f32.89c47","e0353736.ea04e8","27953a49.d1acc6","1b1a4a91.7d9ee5","a00fa8e2.3f1388"],"x":75,"y":40,"wires":[["b2a99d47.454e9"]]},{"id":"e36ef48f.2686d8","type":"link out","z":"9a49eee8.a93ee","name":"","links":["289af6a5.2334da"],"x":435,"y":240,"wires":[]},{"id":"6aa2a1d1.42076","type":"mqtt in","z":"9a49eee8.a93ee","name":"","topic":"/master/app/server/diagnostics/ecu/blockreading","qos":"2","datatype":"auto","broker":"278f5a97.697a66","x":280,"y":400,"wires":[["44262ada.4091d4","da108f5d.6f0d1"]]},{"id":"81d4c78c.5ecab8","type":"comment","z":"9a49eee8.a93ee","name":"","info":"ECU sends bunch of data to microC.\nEach block has up to 4 sensors.\nEach sensor send 2 integers.\nData is calculated.\nOutput is 1 string for each sensor.\nData should be sent like:\n\"sensor;data;sensor;data;sensor;data;sensor;data\"\nempty read should be (?)\n","x":340,"y":340,"wires":[]},{"id":"44262ada.4091d4","type":"function","z":"9a49eee8.a93ee","name":"","func":"if(msg.payload == \"timeout\"){\n return [null, null, null, null, msg];\n}\nvar tokens = msg.payload.split(\";\");\n\nvar o1 = {topic: \" \", payload: \" \"};\nvar o2 = {topic: \" \", payload: \" \"};\nvar o3 = {topic: \" \", payload: \" \"};\nvar o4 = {topic: \" \", payload: \" \"};\n/*var o = [msg];\nfor(i=0;i<4;i++){\n var tempMsg = msg;\n tempMsg.topic = tokens[i*2];\n tempMsg.payload = tokens[i*2+1];\n o.push(tempMsg);\n //o.push(msg);\n}*/\no1.topic = tokens[0];\no2.topic = tokens[2];\no3.topic = tokens[4];\no4.topic = tokens[6];\no1.payload = tokens[1];\no2.payload = tokens[3];\no3.payload = tokens[5];\no4.payload = tokens[7];\nreturn [o1, o2, o3, o4, null];\n//return msg_array;","outputs":5,"noerr":0,"initialize":"","finalize":"","x":560,"y":400,"wires":[["3f9f0d54.9a1862"],["9e7934fe.9e2a18"],["71a11ba1.1d4494"],["67c47310.d092fc"],["9b498cce.cf961"]]},{"id":"3f9f0d54.9a1862","type":"ui_text","z":"9a49eee8.a93ee","group":"6f182569.913e1c","order":6,"width":0,"height":0,"name":"","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-center","x":830,"y":340,"wires":[]},{"id":"9e7934fe.9e2a18","type":"ui_text","z":"9a49eee8.a93ee","group":"6f182569.913e1c","order":7,"width":0,"height":0,"name":"","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-center","x":850,"y":380,"wires":[]},{"id":"71a11ba1.1d4494","type":"ui_text","z":"9a49eee8.a93ee","group":"6f182569.913e1c","order":8,"width":0,"height":0,"name":"","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-center","x":870,"y":420,"wires":[]},{"id":"67c47310.d092fc","type":"ui_text","z":"9a49eee8.a93ee","group":"6f182569.913e1c","order":9,"width":0,"height":0,"name":"","label":"{{msg.topic}}","format":"{{msg.payload}}","layout":"row-center","x":890,"y":460,"wires":[]},{"id":"ceceb9d8.c18858","type":"ui_text","z":"9a49eee8.a93ee","group":"6f182569.913e1c","order":4,"width":0,"height":0,"name":"","label":"Reading block: ","format":"{{msg.payload}}","layout":"row-left","x":740,"y":180,"wires":[]},{"id":"e6ed4f92.c07ab","type":"trigger","z":"9a49eee8.a93ee","name":"","op1":"request","op2":"timeout","op1type":"str","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":730,"y":220,"wires":[["de6afc8c.c62dd"]]},{"id":"de6afc8c.c62dd","type":"function","z":"9a49eee8.a93ee","name":"","func":"if(msg.payload == \"request\"){\n return null;\n}else if(msg.payload == \"timeout\"){\n msg.topic =\"error\"\n return msg;\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":280,"wires":[["6b54d767.f6fd18"]]},{"id":"9b498cce.cf961","type":"link out","z":"9a49eee8.a93ee","name":"","links":["289af6a5.2334da"],"x":645,"y":480,"wires":[]},{"id":"6b54d767.f6fd18","type":"link out","z":"9a49eee8.a93ee","name":"","links":["289af6a5.2334da"],"x":1015,"y":280,"wires":[]},{"id":"da108f5d.6f0d1","type":"change","z":"9a49eee8.a93ee","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":300,"wires":[["e6ed4f92.c07ab"]]},{"id":"f11c7a7b.b839b8","type":"ui_button","z":"9a49eee8.a93ee","name":"","group":"977b7a3a.0fd208","order":2,"width":0,"height":0,"passthru":false,"label":"Error Codes","tooltip":"Press here to read error codes from the ECU","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":190,"y":560,"wires":[["f4d66684.b85698","988cba06.4a8668"]]},{"id":"f4d66684.b85698","type":"mqtt out","z":"9a49eee8.a93ee","name":"","topic":"/master/app/server/diagnostics/browser/errorreading","qos":"","retain":"","broker":"278f5a97.697a66","x":640,"y":560,"wires":[]},{"id":"b4b193b3.0656b","type":"mqtt in","z":"9a49eee8.a93ee","name":"","topic":"/master/app/server/diagnostics/ecu/errorreading","qos":"2","datatype":"auto","broker":"278f5a97.697a66","x":260,"y":660,"wires":[["fa638387.1557","c46f9c07.db75a"]]},{"id":"fa638387.1557","type":"function","z":"9a49eee8.a93ee","name":"","func":"if(msg.payload == \"error\"){\n return [null, msg];\n}\nreturn [msg, null];","outputs":2,"noerr":0,"initialize":"","finalize":"","x":600,"y":780,"wires":[["a95bb7bd.3260b8"],["e0353736.ea04e8"]]},{"id":"a95bb7bd.3260b8","type":"ui_text","z":"9a49eee8.a93ee","group":"977b7a3a.0fd208","order":3,"width":0,"height":0,"name":"","label":"Found DTCs: ","format":"{{msg.payload}}","layout":"row-center","x":850,"y":780,"wires":[]},{"id":"988cba06.4a8668","type":"trigger","z":"9a49eee8.a93ee","name":"","op1":"request","op2":"timeout","op1type":"str","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":830,"y":660,"wires":[["e3dcadb7.f0b65"]]},{"id":"e3dcadb7.f0b65","type":"function","z":"9a49eee8.a93ee","name":"","func":"if(msg.payload == \"request\"){\n return null;\n}else if(msg.payload == \"timeout\"){\n msg.topic =\"error\"\n return msg;\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":720,"wires":[["27953a49.d1acc6"]]},{"id":"e0353736.ea04e8","type":"link out","z":"9a49eee8.a93ee","name":"","links":["289af6a5.2334da"],"x":735,"y":840,"wires":[]},{"id":"27953a49.d1acc6","type":"link out","z":"9a49eee8.a93ee","name":"","links":["289af6a5.2334da"],"x":875,"y":720,"wires":[]},{"id":"c46f9c07.db75a","type":"change","z":"9a49eee8.a93ee","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":660,"wires":[["988cba06.4a8668"]]},{"id":"40a09146.1092","type":"mqtt out","z":"9a49eee8.a93ee","name":"","topic":"/master/app/server/diagnostics/browser/errordelete","qos":"","retain":"","broker":"278f5a97.697a66","x":610,"y":880,"wires":[]},{"id":"9bfdd63e.c76308","type":"ui_button","z":"9a49eee8.a93ee","name":"","group":"108e7af4.922435","order":2,"width":0,"height":0,"passthru":false,"label":"Delete error codes","tooltip":"Press here to delete error codes from the ECU","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":190,"y":880,"wires":[["40a09146.1092","98ac240c.2de118"]]},{"id":"83e924e2.9a3c28","type":"mqtt in","z":"9a49eee8.a93ee","name":"","topic":"/master/app/server/diagnostics/ecu/errordelete","qos":"2","datatype":"auto","broker":"278f5a97.697a66","x":250,"y":1000,"wires":[["2d2db32d.42ec3c","3154ba7.2708b46"]]},{"id":"3154ba7.2708b46","type":"function","z":"9a49eee8.a93ee","name":"","func":"if(msg.payload == \"error\"){\n var o = {topic: \"error\", payload: \"Failed to delete DTCs\"};\n return [o, msg];\n}\nreturn [msg, null];","outputs":2,"noerr":0,"initialize":"","finalize":"","x":600,"y":1120,"wires":[["9e5a678d.da84a8"],["1b1a4a91.7d9ee5"]]},{"id":"9e5a678d.da84a8","type":"ui_text","z":"9a49eee8.a93ee","group":"108e7af4.922435","order":3,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-center","x":830,"y":1120,"wires":[]},{"id":"98ac240c.2de118","type":"trigger","z":"9a49eee8.a93ee","name":"","op1":"request","op2":"timeout","op1type":"str","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":830,"y":1000,"wires":[["cbfa1b9a.4cbc68"]]},{"id":"cbfa1b9a.4cbc68","type":"function","z":"9a49eee8.a93ee","name":"","func":"if(msg.payload == \"request\"){\n return null;\n}else if(msg.payload == \"timeout\"){\n msg.topic =\"error\";\n msg.payload = \"Failed to delete DTCs\";\n return msg;\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":1060,"wires":[["a00fa8e2.3f1388","9e5a678d.da84a8"]]},{"id":"1b1a4a91.7d9ee5","type":"link out","z":"9a49eee8.a93ee","name":"","links":["289af6a5.2334da"],"x":735,"y":1180,"wires":[]},{"id":"a00fa8e2.3f1388","type":"link out","z":"9a49eee8.a93ee","name":"","links":["289af6a5.2334da"],"x":875,"y":1060,"wires":[]},{"id":"2d2db32d.42ec3c","type":"change","z":"9a49eee8.a93ee","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":1000,"wires":[["98ac240c.2de118"]]},{"id":"c5e1e4fe.264a38","type":"ui_button","z":"9a49eee8.a93ee","name":"","group":"e65127de.646628","order":0,"width":0,"height":0,"passthru":false,"label":"Ignition","tooltip":"","color":"","bgcolor":"orange","icon":"","payload":"","payloadType":"str","topic":"","x":160,"y":1360,"wires":[["21b71d31.e46202"]]},{"id":"21b71d31.e46202","type":"mqtt out","z":"9a49eee8.a93ee","name":"","topic":"/master/app/server/body/browser/ignition","qos":"","retain":"","broker":"278f5a97.697a66","x":460,"y":1360,"wires":[]},{"id":"6f182569.913e1c","type":"ui_group","name":"Block Reading","tab":"775aac30.fb3144","order":2,"disp":true,"width":"6","collapse":false},{"id":"278f5a97.697a66","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"977b7a3a.0fd208","type":"ui_group","name":"DTC reading","tab":"775aac30.fb3144","order":3,"disp":true,"width":"6","collapse":false},{"id":"108e7af4.922435","type":"ui_group","name":"Delete DTCs","tab":"775aac30.fb3144","order":4,"disp":true,"width":"6","collapse":false},{"id":"e65127de.646628","type":"ui_group","name":"Ignition","tab":"423190e5.56565","order":1,"disp":true,"width":"6","collapse":false},{"id":"775aac30.fb3144","type":"ui_tab","name":"Diagnostics","icon":"dashboard","disabled":false,"hidden":false},{"id":"423190e5.56565","type":"ui_tab","name":"Body Control","icon":"dashboard","disabled":false,"hidden":false}]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment