diff options
Diffstat (limited to 'NODERED/garbage-sorting-machine-client.json')
-rw-r--r-- | NODERED/garbage-sorting-machine-client.json | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/NODERED/garbage-sorting-machine-client.json b/NODERED/garbage-sorting-machine-client.json new file mode 100644 index 0000000..5c1383d --- /dev/null +++ b/NODERED/garbage-sorting-machine-client.json @@ -0,0 +1 @@ +[{"id":"6b8a1dc6.8f8fd4","type":"tab","label":"Main Flow","disabled":false,"info":""},{"id":"c4f7b9e6.7b2448","type":"json","z":"6b8a1dc6.8f8fd4","name":"","property":"payload","action":"obj","pretty":false,"x":570,"y":360,"wires":[["ecfc31e4.13119"]]},{"id":"ecfc31e4.13119","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"var b = JSON.parse(JSON.stringify(msg.payload)); \nb=msg;\nreturn msg;","outputs":1,"noerr":0,"x":830,"y":460,"wires":[["cd471dca.cbbcc","1c10287c.3a1948","f6449c0c.80fb2","ba9ca32e.6e2ef","4578b6f3.e4108","c33104ed.20b2a","3d597f64.693478","dda6ef7f.75f6","bc393b7d.51be38","e56fed75.406938","1f6ef25b.dfa3fe","a9083db4.d26208","27a539b1.90f5c6"]]},{"id":"cd471dca.cbbcc","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"if (msg.payload.running === 0) {\n msg.payload = \"<span class=\\\"text-stop\\\">Stop</span>\";\n return msg;\n} else {\n msg.payload = \"<span class=\\\"text-run\\\">Running</span>\";\n return msg;\n}","outputs":1,"noerr":0,"x":1130,"y":60,"wires":[["ccf58f15.9dc6a8"]]},{"id":"1c10287c.3a1948","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"if (msg.payload.material == 0) {\n msg.payload = \"Dry\";\n return msg;\n} else if (msg.payload.material == 1) {\n msg.payload = \"Wet\";\n return msg;\n} else if (msg.payload.material == 2) {\n msg.payload = \"Metal\";\n return msg;\n} else {\n msg.payload = \"None\";\n return msg;\n}","outputs":1,"noerr":0,"x":1130,"y":160,"wires":[["a76bc292.67253"]]},{"id":"f6449c0c.80fb2","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.countTotal;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":240,"wires":[["aad83c6e.79dbc"]]},{"id":"ba9ca32e.6e2ef","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.countMetal;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":320,"wires":[["4d346132.77f84"]]},{"id":"37a6505b.c7aab","type":"debug","z":"6b8a1dc6.8f8fd4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":580,"wires":[]},{"id":"ccf58f15.9dc6a8","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/running","qos":"","retain":"","broker":"4e914494.745dc4","x":1340,"y":60,"wires":[]},{"id":"a76bc292.67253","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/material","qos":"","retain":"","broker":"4e914494.745dc4","x":1340,"y":160,"wires":[]},{"id":"aad83c6e.79dbc","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/countTotal","qos":"","retain":"","broker":"4e914494.745dc4","x":1350,"y":240,"wires":[]},{"id":"4d346132.77f84","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/countMetal","qos":"","retain":"","broker":"4e914494.745dc4","x":1350,"y":320,"wires":[]},{"id":"4578b6f3.e4108","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.countWet;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":400,"wires":[["1f3986ca.064909"]]},{"id":"1f3986ca.064909","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/countWet","qos":"","retain":"","broker":"4e914494.745dc4","x":1350,"y":400,"wires":[]},{"id":"c33104ed.20b2a","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.countDry;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":480,"wires":[["f7ddccde.581fa8"]]},{"id":"f7ddccde.581fa8","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/countDry","qos":"","retain":"","broker":"4e914494.745dc4","x":1340,"y":480,"wires":[]},{"id":"3d597f64.693478","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.conveyorTimer;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":580,"wires":[["280063c6.f67a0c"]]},{"id":"280063c6.f67a0c","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/timer","qos":"","retain":"","broker":"4e914494.745dc4","x":1330,"y":580,"wires":[]},{"id":"dda6ef7f.75f6","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.distance;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":680,"wires":[["6d114bc4.b3309c"]]},{"id":"6d114bc4.b3309c","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/distance","qos":"","retain":"","broker":"4e914494.745dc4","x":1340,"y":680,"wires":[]},{"id":"bc393b7d.51be38","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.moisture;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":780,"wires":[["e1d366f4.9d17f"]]},{"id":"e1d366f4.9d17f","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/moisture","qos":"","retain":"","broker":"4e914494.745dc4","x":1340,"y":780,"wires":[]},{"id":"e56fed75.406938","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.metal;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":880,"wires":[["9892cec1.0aff48"]]},{"id":"9892cec1.0aff48","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/metal","qos":"","retain":"","broker":"4e914494.745dc4","x":1330,"y":880,"wires":[]},{"id":"1f6ef25b.dfa3fe","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.servoTimer;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":960,"wires":[["c8d5f0eb.f4ce7"]]},{"id":"c8d5f0eb.f4ce7","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/servoTimer","qos":"","retain":"","broker":"4e914494.745dc4","x":1350,"y":960,"wires":[]},{"id":"62bbdd42.0e3a14","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/wetTimer","qos":"","retain":"","broker":"4e914494.745dc4","x":1340,"y":1040,"wires":[]},{"id":"a9083db4.d26208","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"msg.payload=msg.payload.wetTimer;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":1040,"wires":[["62bbdd42.0e3a14"]]},{"id":"40ad2c87.481d6c","type":"mqtt out","z":"6b8a1dc6.8f8fd4","name":"","topic":"/processedTimer","qos":"","retain":"","broker":"4e914494.745dc4","x":1370,"y":1120,"wires":[]},{"id":"27a539b1.90f5c6","type":"function","z":"6b8a1dc6.8f8fd4","name":"","func":"const clamp = (num, min, max) => Math.min(Math.max(num, min), max);\nif (msg.payload.servoTimer == -1) {\n msg.payload = clamp(msg.payload.conveyorTimer, 0, 200);\n return msg;\n} else {\n msg.payload = clamp(msg.payload.servoTimer, 0, 70);\n return msg;\n}","outputs":1,"noerr":0,"x":1130,"y":1120,"wires":[["40ad2c87.481d6c"]]},{"id":"1dc06c7e.c40304","type":"serial in","z":"6b8a1dc6.8f8fd4","name":"","serial":"2a28de2.be99322","x":260,"y":480,"wires":[["c4f7b9e6.7b2448","37a6505b.c7aab"]]},{"id":"4e914494.745dc4","type":"mqtt-broker","z":null,"name":"cloud thing","broker":"45.76.160.37","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"2a28de2.be99322","type":"serial-port","z":"","serialport":"/dev/ttyACM1","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"\\n","bin":"false","out":"char","addchar":"","responsetimeout":"10000"}]
\ No newline at end of file |