I have a Raspberry Pi that runs a Python 3 program every night at 10pm to take a picture of my Solar Panel Meter, from a command in crontab.
This works fine but recently after years of running without problem the picture was just a black image. I traced this to the fact that although the camera was working the IR lights controlled by GPIO 7 were not working. I further traced this to a problem with the GPIO output which seems to fail regularly using lasting around a day before failing.
However, I found that by rebooting the Pi using the Menu option, it would work perfectly again for a while before failing again.
I would like therefore to reboot the Pi automatically at say 9pm each day to ensure it is working properly to take the picture.
Despite trying many ways to achieve automatic bootup using crontab, I cannot get it to work. The latest way I tried was:
0 21 * * * /sbin/shutdown -r now
previously:
0 21 * * * reboot
Could someone please advise how to use cron to reboot a Pi
Thank you
This works fine but recently after years of running without problem the picture was just a black image. I traced this to the fact that although the camera was working the IR lights controlled by GPIO 7 were not working. I further traced this to a problem with the GPIO output which seems to fail regularly using lasting around a day before failing.
However, I found that by rebooting the Pi using the Menu option, it would work perfectly again for a while before failing again.
I would like therefore to reboot the Pi automatically at say 9pm each day to ensure it is working properly to take the picture.
Despite trying many ways to achieve automatic bootup using crontab, I cannot get it to work. The latest way I tried was:
0 21 * * * /sbin/shutdown -r now
previously:
0 21 * * * reboot
Could someone please advise how to use cron to reboot a Pi
Thank you
Statistics: Posted by RDS — Tue Mar 05, 2024 2:17 pm