You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i use cron on boot and for shutdown.
i use the cron command 30 23 * * * /sbin/shutdown -h now,but when the pi shutdown to red light the lights of christmas tree freezes,they did not turn off,can you please advise me a simple cron command to auto turn them off ?
The text was updated successfully, but these errors were encountered:
The shutdown command means you lose control of the Python process and the lights stay on. You're probably better off managing the shutdown from Python, or a minute before cron shutdown, turn the lights off in Python.
You can use gpiozero's TimeOfDay to turn the lights off:
Obviously change the times to suit yourself and whatever script you are running. My cron turns the tree on on Dec 1st and off on Jan 6th, with a bash script checking the date on reboot in case the machine reboots during the 'on' period. I uploaded the scripts here: https://github.com/stroggprog/xmas-tree
i use cron on boot and for shutdown.
i use the cron command 30 23 * * * /sbin/shutdown -h now,but when the pi shutdown to red light the lights of christmas tree freezes,they did not turn off,can you please advise me a simple cron command to auto turn them off ?
The text was updated successfully, but these errors were encountered: