NodeRED Lesson: Reboot & Shutdown

Node-RED Reboot dan Shutdown menggunakan node exec bagi menjalankan arahan terminal. Arahan terminal ini boleh memberi arahan untuk reboot ataupun shutdown.

Berikut adalah video demo nya.

Node-RED Flow

[{"id":"ce00d5a8.bceab8","type":"inject","z":"3dccd5a5.2de07a","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":360,"y":160,"wires":[["23eef5a4.72f76a"]]},{"id":"23eef5a4.72f76a","type":"exec","z":"3dccd5a5.2de07a","command":"sudo reboot now","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"Reboot","x":520,"y":160,"wires":[[],[],[]]},{"id":"2a3df390.7d0cfc","type":"inject","z":"3dccd5a5.2de07a","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":360,"y":240,"wires":[["95eb9938.db4c48"]]},{"id":"95eb9938.db4c48","type":"exec","z":"3dccd5a5.2de07a","command":"sudo shutdown now","addpay":false,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"Shutdown","x":520,"y":240,"wires":[[],[],[]]}]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.