Hallo Leute,
ich möchte dass mein Pi nach dem Neustart noch die GPIO Einstellungen hat.
Soll heißen, dass ich GPIO23 per
sudo echo "0" > /sys/class/gpio/export
sudo echo "out" > /sys/class/gpio/gpio0/direction
nutzbar gemacht habe und auch schalten kann.
Dies möchte ich auch nach dem Neustart.
Also habe ich mir, nach Kampis Anleitung, ein Startscript mit folgendem inhalt erstellt:
#!/bin/sh
echo "23" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio23/direction
chmod 666 /sys/class/gpio23/value
chmod 666 /sys/class/gpio/gpio23/direction
und unter /home/pi/gpioreboot.sh abgelegt.
Anschließend alles in die Datei /etc/rc.local eingetragen
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/home/pi/gpioreboot.sh
exit 0
Dann noch die Datei ausführbar gemacht mit:
chmod +x /home/pi/gpioreboot.sh
Doch nach einem Neustart sind alle Einstellung wieder weg und ich muß alles von neuem anlegen.
Warum ist das so?
Vielen Dank!!!
edit: Habe nochmal das ganze Betriebssystem neu aufgesetzt und nun funkt es.