Paso 6: Flujo de importación nodo rojo
- Abierto http://localhost:1880 / en su navegador
- Copia el código JSON que indicamos a continuación
- Haga clic en el botón de menú en la esquina superior derecha y seleccione Importar > Portapapeles y pegue el código JSON
[{"id":"4f7a7d17.b08584","type":"bean","name":"meanbean","uuid":"","connectiontype":"constant","connectiontimeout":"0"},{"id":"45c62790.ba39d8","type":"bean serial","name":"Bean serial","bean":"4f7a7d17.b08584","newline":"\\n","bin":"false","out":"char","addchar":true,"x":86.66666412353516,"y":268.8888854980469,"z":"5ed181e8.a12e8","wires":[["7ee00806.811ff8"]]},{"id":"7ee00806.811ff8","type":"switch","name":"Check motion","property":"payload","rules":[{"t":"eq","v":"1"}],"checkall":"true","outputs":1,"x":253.66666412353516,"y":268.8888854980469,"z":"5ed181e8.a12e8","wires":[["de364926.21c9b8","c1d68100.3e298"]]},{"id":"de364926.21c9b8","type":"change","name":"","rules":[{"t":"set","p":"payload","to":"1"}],"action":"","property":"","from":"","to":"","reg":false,"x":440.6666717529297,"y":231.1388874053955,"z":"5ed181e8.a12e8","wires":[["28bd047.fd742fc"]]},{"id":"fd8cf1a2.02731","type":"function","name":"Extract password and command","func":"if (msg.payload.length == 6)\n{\n var pwd = msg.payload.substring(0,4);\n var cmd = msg.payload.substring(4,6);\n \n msg.payload = {};\n msg.payload.pwd = pwd;\n msg.payload.cmd = cmd;\n \n return msg;\n}\nreturn null;","outputs":1,"valid":true,"x":365.66666412353516,"y":423.5555419921875,"z":"5ed181e8.a12e8","wires":[["a396029a.5c6a"]]},{"id":"a396029a.5c6a","type":"switch","name":"Verify password","property":"payload.pwd","rules":[{"t":"eq","v":"1234"}],"checkall":"true","outputs":1,"x":603.6666641235352,"y":423.5555419921875,"z":"5ed181e8.a12e8","wires":[["5823ab3e.a7dc54"]]},{"id":"5823ab3e.a7dc54","type":"change","name":"","rules":[{"t":"set","p":"payload","to":"msg.payload.cmd"}],"action":"","property":"","from":"","to":"","reg":false,"x":796.6666641235352,"y":423.5555419921875,"z":"5ed181e8.a12e8","wires":[["11a116da.ee5ee9","2f12e66a.d0ed1a","5f46d32d.a0b92c"]]},{"id":"58eb0b09.a714f4","type":"twitter in","twitter":"","tags":"","user":"dm","name":"","topic":"tweets","x":97.66666412353516,"y":423.2221984863281,"z":"5ed181e8.a12e8","wires":[["fd8cf1a2.02731"]]},{"id":"11a116da.ee5ee9","type":"debug","name":"","active":true,"console":"false","complete":"false","x":988.4166793823242,"y":486.8888912200928,"z":"5ed181e8.a12e8","wires":[]},{"id":"2f12e66a.d0ed1a","type":"bean serial","name":"Bean serial","bean":"4f7a7d17.b08584","newline":"\\n","bin":"false","out":"char","addchar":false,"x":986.6666793823242,"y":423.13888931274414,"z":"5ed181e8.a12e8","wires":[[]]},{"id":"2db5ea45.d24a16","type":"exec","command":"python","addpay":true,"append":"/Users/ashish/Documents/MotionDetector/upload_twitter.py","useSpawn":false,"name":"Upload to twitter","x":781.4166641235352,"y":315.8888854980469,"z":"5ed181e8.a12e8","wires":[[],[],[]]},{"id":"5f46d32d.a0b92c","type":"switch","name":"Turn on camera?","property":"payload","rules":[{"t":"eq","v":"10"},{"t":"eq","v":"11"},{"t":"eq","v":"00"},{"t":"eq","v":"01"}],"checkall":"true","outputs":4,"x":999.6666641235352,"y":357.8888854980469,"z":"5ed181e8.a12e8","wires":[["3314ac40.cceb54"],["3314ac40.cceb54"],["c76d9c3e.38926"],["c76d9c3e.38926"]]},{"id":"a775d7eb.588a28","type":"exec","command":"python","addpay":true,"append":"/Users/ashish/Documents/MotionDetector/camera.py","useSpawn":"","name":"Start camera","x":1406.6666641235352,"y":319.8888854980469,"z":"5ed181e8.a12e8","wires":[[],[],[]]},{"id":"53a9f805.ac5608","type":"udp out","name":"Stop camera","addr":"localhost","iface":"","port":"5005","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":1404.6666641235352,"y":396.8888854980469,"z":"5ed181e8.a12e8","wires":[]},{"id":"c76d9c3e.38926","type":"change","name":"","rules":[{"t":"set","p":"payload","to":"0"}],"action":"","property":"","from":"","to":"","reg":false,"x":1213.6666641235352,"y":396.8888854980469,"z":"5ed181e8.a12e8","wires":[["53a9f805.ac5608"]]},{"id":"3314ac40.cceb54","type":"change","name":"","rules":[{"t":"set","p":"payload","to":""}],"action":"","property":"","from":"","to":"","reg":false,"x":1210.6666641235352,"y":319.8888854980469,"z":"5ed181e8.a12e8","wires":[["a775d7eb.588a28"]]},{"id":"762ac427.89d53c","type":"udp out","name":"Take picture","addr":"localhost","iface":"","port":"5005","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":767.6666641235352,"y":230.88888549804688,"z":"5ed181e8.a12e8","wires":[]},{"id":"43ccb64.fbc3348","type":"inject","name":"disarm","topic":"","payload":"123400","payloadType":"string","repeat":"","crontab":"","once":false,"x":87.66666412353516,"y":366.8888854980469,"z":"5ed181e8.a12e8","wires":[["fd8cf1a2.02731"]]},{"id":"fb624da.f049db","type":"inject","name":"enable gun+camera","topic":"","payload":"123411","payloadType":"string","repeat":"","crontab":"","once":false,"x":120.41666412353516,"y":478.8888897895813,"z":"5ed181e8.a12e8","wires":[["fd8cf1a2.02731"]]},{"id":"78e2552e.871dac","type":"inject","name":"enable camera only","topic":"","payload":"123410","payloadType":"string","repeat":"","crontab":"","once":false,"x":155.66666412353516,"y":533.8888854980469,"z":"5ed181e8.a12e8","wires":[["fd8cf1a2.02731"]]},{"id":"22191388.dde6ec","type":"inject","name":"enable gun only","topic":"","payload":"123401","payloadType":"string","repeat":"","crontab":"","once":false,"x":217.66666412353516,"y":591.8888854980469,"z":"5ed181e8.a12e8","wires":[["fd8cf1a2.02731"]]},{"id":"28bd047.fd742fc","type":"delay","name":"","pauseType":"delay","timeout":"0.5","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":609.6666641235352,"y":230.88888549804688,"z":"5ed181e8.a12e8","wires":[["762ac427.89d53c"]]},{"id":"c1d68100.3e298","type":"delay","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":422.66666412353516,"y":315.8888854980469,"z":"5ed181e8.a12e8","wires":[["3466c14b.cb993e"]]},{"id":"3466c14b.cb993e","type":"change","name":"","rules":[{"t":"set","p":"payload","to":""}],"action":"","property":"","from":"","to":"","reg":false,"x":594.6666641235352,"y":315.8888854980469,"z":"5ed181e8.a12e8","wires":[["2db5ea45.d24a16"]]}]