I've got a Raspberry Pi. I've installed on it WiringPi for pilot GPIO on the board via command line.
I've done a script called aggiornaora.sh
gpio -g write 18 1 #it set the GPIO port to 1
#log with reverse append
(echo 'accensione';date;echo ' ') | cat - logstufa.txt > temp && mv temp logstufa.txt
This script work fine if I try to exec it directly via sh aggiornaora.sh
.
But when cron run the script, it do only the second action. All with root permission.
I've checked this problem through "gpio readall".
In your opinion what could be the problem?