nxet
Posts: 7
Joined: Fri Jan 15, 2016 7:04 pm

wiringPi gpio command not working from crontab

Sun Apr 17, 2016 6:12 pm

I have tested every single possible configuration, but still I can't get it to work. When I issue any "gpio command" from the console, everything works just fine. Set mode or Write both return the expected results.
But when the commands are issued via crontab (root's) @reboot, nothing works and I can't even set the pin mode.
I have a fresh install of Raspbian, installed git-core and then built from wiringPi folder. Dependencies seem met given the working commands from cli, but still I can't figure out where it's failing at boot.
A simple "@reboot gpio mode 0 out; gpio write 0 1" in the crontab file doesn't turn on the led.

Thanks in advance for any pointer
Raspbian, Raspberry Pi 2 Model B V1.1

User avatar
joan
Posts: 14553
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: wiringPi gpio command not working from crontab

Sun Apr 17, 2016 6:34 pm

If you had tested every single possible configuration it would be working.

In crontab use the full path to executables and files. Do not assume they are in the current environment's path.

Return to “Troubleshooting”