I think I'm having an issue similar to Yozza, but I think all the permissions are correct. Implementing on a raspberry pi zero w.
I don't specifically need to call the macro gpio.sh, right? I'm calling it button1.sh
button1.sh runs fine in terminal and I get my LED to blink. button1.sh code is below, referenced from here: https://elinux.org/RPi_GPIO_Code_Samples#Shell
I'm trying to get it to execute with button1 press in the GUI, but it's not working. I tried echo 'test' >> macrotest.txt with the command line and it worked, but not with the GUI button press.
/www/var/html contains the userbuttons file, which references button1.sh
/www/var/html contains index.php. Changed line 59 to sy button1.sh
Used ls -l to see the permissions of the files and folders. Screenshots attached.
button1.sh code below. Turns the LED on for 1 second, then off.
# GPIO numbers should be from this list
# 0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25
# Set up GPIO 17 and set to output
echo "17" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio17/direction
# Write output
echo "1" > /sys/class/gpio/gpio17/value
# Clean up
echo "17" > /sys/class/gpio/unexport
Can anyone help me out with this?