Posts: 1
Threads: 1
Joined: Nov 2017
Reputation:
0
Hello all, my first post here
Im trying to make my RPI3 turn ON/OFF on button push. But i cant make OpenPlotter run a python script on boot.
Everything i tried nothing, rc.local, bash, crontab. I added permissions so anybody can run script, but it wont run on boot.
Anyone had similiar problem? Thanks
Posts: 799
Threads: 46
Joined: Jun 2017
Reputation:
25
2017-11-18, 10:24 AM
(This post was last modified: 2017-11-18, 11:12 AM by jim321.)
here is what i was thinking of doing in node red untested but you get the idea..i haven't figured out the ON part yet but i got reboot power down.
welcome to the forum..
Code: [{"id":"20000d95.1907a2","type":"exec","z":"7546b9b.db0b448","command":"sudo shutdown -h now","addpay":true,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"Shutdown Pi","x":630,"y":760,"wires":[[],[],[]]},{"id":"1c00de2f.060cb2","type":"exec","z":"7546b9b.db0b448","command":"sudo reboot","addpay":true,"append":"","useSpawn":"","timer":"","oldrc":false,"name":"Reboot Pi","x":620,"y":700,"wires":[[],[],[]]},{"id":"f097e51f.98a528","type":"rpi-gpio in","z":"7546b9b.db0b448","name":"","pin":"13","intype":"down","debounce":"25","read":false,"x":340,"y":700,"wires":[["db885066.03cf4"]]},{"id":"db885066.03cf4","type":"switch","z":"7546b9b.db0b448","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","outputs":2,"x":470,"y":700,"wires":[[],["1c00de2f.060cb2"]]}]
a little googling and seems simple enough change to pin 5
"There's nothing to build here, but we need to understand how to wake up the Pi from a halt state before we build the shutdown functionality. Simply put, shorting pins 5 and 6 (GPIO3 and GND) together will wake the Pi up from a halt state."
Posts: 2,893
Threads: 59
Joined: Mar 2016
Reputation:
278
There are actions "shutdown" and "reset" on actions tab. Just connect your swith to GPIO pins, set the signal k key on GPIO tab and set a trigger/action for that signal k key.
If you set that anybody can run script included owner, the script will never run usin "myscript.py".
On that case you have to run it with: "python myscript.py"
|