Raspberry Pi scheduled Shutdown or Restart using Node-RED
Node-RED is a flow-based low-code platform for IoT-based system prototyping and testing. We can restart or shut down Raspberry Pi using Node-RED by using the rpi-shutdown node.
To install the nodes, simply run the following npm command in the Raspberry pi terminal or ssh.
npm install node-red-contrib-rpi-shutdown
Or, we can install the latest stable library from the manage palette option in Node-RED. For this, go to the MENU - MANAGE PALETTE - INSTALL option, search for node-red-contrib-rpi-shutdown and click the install button.
Restart or shut down Raspberry pi using Node-RED |
Nodes to shut down or restart your Raspberry Pi |
These nodes only support raspberry pi boards.alert-warning
Example flows for restart and shutdown of the Raspberry pi
Import the following flow on the Node-RED server running on Raspberry pi to set up restart or shut down configuration.
[{"id":"3f09ab070dd9ceea","type":"tab","label":"Shutdown/Restart RPi","disabled":false,"info":"","env":[]},{"id":"c7cdf82876806fcb","type":"shutdown","z":"3f09ab070dd9ceea","name":"","x":380,"y":200,"wires":[]},{"id":"fa94ebba60d211c9","type":"restart","z":"3f09ab070dd9ceea","name":"","x":370,"y":260,"wires":[]},{"id":"5ab85d78890755ee","type":"inject","z":"3f09ab070dd9ceea","name":"Shutdown","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":200,"wires":[["c7cdf82876806fcb"]]},{"id":"0dedf5962bd32b56","type":"inject","z":"3f09ab070dd9ceea","name":"Restart","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":260,"wires":[["fa94ebba60d211c9"]]}]code-box
Visit the official page of the node-red-contrib-rpi-shutdown node for more detailed information.
Post a Comment