Bei Raspbbian (Debian auf dem Raspberry) gibt es das Programm gpio womit man den Ausgang/Eingang etc steuern kann.
Das aber auffällt ist, dass “readall” nicht funktioniert (Unbekanntes Board 17). Anfangs dachte ich an einen Fehler, aber ein apt upgrade brachte keinen Erfolg. Auch andere Programme zu steuern des GPIO Ports schlugen fehl.
Die Lösung ist eine neue Version per Hand zu installieren.
cd /tmp wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb
Danach klappt es bei mir mit dem schalten. 😃
Ich steuere jetzt meinen Lüfter auf dem Raspberry Pi mit Node Red 😃 Ein Beschaltungsplan findet man hier. Ich nutze da aber nur den Anteil mit dem Transistor. Den bekommt man z.B. bei ELV für wenige Cent. Etwas Schrumpfschlauch drüber und fertig 😃 Passende Steckbrücken gibt es auch 😃
[{"id":"c071c762.57f998","type":"ui_chart","z":"bdd1b89d.421f98","name":"","group":"64f6d013.8d639","order":3,"width":0,"height":0,"label":"CPU Temp","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"20","ymax":"","removeOlder":"2","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":430,"y":240,"wires":[[]]},{"id":"ca9663e7.644d5","type":"ioBroker in","z":"bdd1b89d.421f98","name":"CPU Temp","topic":"moma.0.cpuTemperature.main","payloadType":"value","onlyack":"","func":"all","gap":"","x":100,"y":200,"wires":[["c071c762.57f998","a6b7a76.0ef4558"]]},{"id":"3ce6d04a.15a9a","type":"inject","z":"bdd1b89d.421f98","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":40,"wires":[["90974c36.e234a"]]},{"id":"98ebd182.46717","type":"inject","z":"bdd1b89d.421f98","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":80,"wires":[["90974c36.e234a"]]},{"id":"90974c36.e234a","type":"pi-gpiod out","z":"bdd1b89d.421f98","name":"gpio17 11d","host":"::1","port":8888,"pin":"17","set":true,"level":"0","out":"out","sermin":"1000","sermax":"2000","x":630,"y":40,"wires":[]},{"id":"a6b7a76.0ef4558","type":"function","z":"bdd1b89d.421f98","name":"Steuerung","func":"var temp = parseInt(msg.payload);\nvar result = -1;\nif (temp >= 50) {\n result = 1;\n}\nif (msg.payload < 45){\n result = 0;\n}\n\nmsg.payload=result;\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":160,"wires":[["6c03f947.cff3b8"]]},{"id":"6c03f947.cff3b8","type":"switch","z":"bdd1b89d.421f98","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"-1","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":140,"wires":[[],["90974c36.e234a","e03796c8.4f0ff8"]]},{"id":"e03796c8.4f0ff8","type":"debug","z":"bdd1b89d.421f98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":180,"wires":[]},{"id":"64f6d013.8d639","type":"ui_group","z":"","name":"CPU","tab":"9f7696fe.37b808","disp":true,"width":"6","collapse":false},{"id":"9f7696fe.37b808","type":"ui_tab","z":"","name":"System","icon":"dashboard","disabled":false,"hidden":false}]
Update: Damit die Ansteuerung klappt, habe ich noch pigpiod auf dem Raspberry aktiviert und das entsprechende Node Red Modul benutzt. Damit kann Node Red auch auf einem anderen System laufen!