Hi all,
Apologies if this has been answered a dozen times, I'm pretty inexperienced with Linux/BusyBox and couldn't understand how to get this to work.
I'm using a Raspberry Pi running OpenWRT and have a couple of Relay drivers on GPIO Ports 23 & 24. I've inserted the following commands in the Local Startup (under System -> Startup) to generate the refences folders for each GPIO line.
echo "23" > /sys/class/gpio/export
echo "24" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio23/direction
echo "out" > /sys/class/gpio/gpio24/direction
If I run the commands:
echo 1 > /sys/class/gpio/gpio23/value
echo 0 > /sys/class/gpio/gpio23/value
I can switch a Relay ON and OFF.
What I'd like to do is assign the commands to actually control the Relay State to the System -> Custom Commands so I can push a GUI button and have the Relay change State.
I've pasted in my command "echo 1 > /sys/class/gpio/gpio23/value" into the Command line field, but when it's run, I get the output
# echo 1 ">" /sys/class/gpio/gpio23/value
1 > /sys/class/gpio/gpio23/value
How do I make the 'echo' in this command output to the file /sys/class/gpio/gpio23/value and not to the screen?
Thanks in advance
Rich