I have a Witty Pi 4 with the following script:
BEGIN 2015-08-01 07:00:00 END 2030-07-31 23:59:59 ON M15 WAIT OFF S0
It is suppose to just star the Raspberry every 15m and then when the tasks are done it will shutdown automatically. But when i shutdown it wont start again. Am i doing something wrong on the script?
OFF S0
You can not specify the duration of "OFF" to 0 second. Witty Pi doesn't know what to do in such case.
You may do this instead:
BEGIN 2015-08-01 07:00:00 END 2030-07-31 23:59:59 ON M1 WAIT OFF M14
@admin Changed the script to that and it continues not starting
@jorge-silva then you should check wittyPi.log or schedule.log, and see if the startup time has been properly scheduled.
@admin Here it is
chedule.log
--------------- 2025-03-18 16:10:14 --------------- Skip scheduling next shutdown, which should be done externally. Schedule next startup at: 2025-03-18 16:15:00 --------------------------------------------------- --------------- 2025-03-18 16:24:40 --------------- Skip scheduling next shutdown, which should be done externally. Schedule next startup at: 2025-03-18 16:30:00 ---------------------------------------------------
wittyPi.log
[2025-03-18 16:20:18] Done :-) [2025-03-18 16:20:18] Firmware ID: 0x26 [2025-03-18 16:20:18] Firmware Revison: 0x06 [2025-03-18 16:20:18] Current Vout=5.04V, Iout=1.03A [2025-03-18 16:20:18] System starts up because the button is clicked. [2025-03-18 16:24:40] Skip scheduling next shutdown, which should be done externally. [2025-03-18 16:24:40] Schedule next startup at: 2025-03-18 16:30:00 [xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.21) is started. [xxxx-xx-xx xx:xx:xx] System: Debian GNU/Linux 12 (bookworm), Kernel: Linux 6.12.18-v8-16k+, Architecture: arm64 [xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi Compute Module 5 Rev 1.0 [xxxx-xx-xx xx:xx:xx] RTC offset register has value 0x77 [xxxx-xx-xx xx:xx:xx] Seems RTC has good time, write RTC time into system [xxxx-xx-xx xx:xx:xx] Writing RTC time to system... [2025-03-18 16:51:40] Done :-) [2025-03-18 16:51:40] Firmware ID: 0x26 [2025-03-18 16:51:40] Firmware Revison: 0x06 [2025-03-18 16:51:40] Current Vout=5.05V, Iout=1.01A [2025-03-18 16:51:40] System starts up because the button is clicked.
[2025-03-18 16:24:40] Schedule next startup at: 2025-03-18 16:30:00
The startup was scheduled at 16:30. However there is no log message about the shutdown, and I guess you called shutdown command directly.
Although it may not be the problem itself, it may be better to set GPIO-4 to output mode and output LOW, which will be detected by daemon.sh and then log message into the file.
gpio -g mode 4 out
gpio -g write 4 0
If the shutdown happened after 16:30, there is no way that Witty Pi can still wake up your Raspberry Pi, because in such case the startup was scheduled in the past.
Also, if you are using power bank, there is chance that the power bank entered sleep mode after your Raspberry Pi is off, and Witty Pi can not wake up your Raspberry Pi because it was not powered when the schedule startup was due.
@admin After setting GPIO-4 to output mode and output LOW the machine turns off immediately and starts on the correct time, but it doesn't change the 'Schedule next startup'.
[2025-03-20 10:43:22] Copying "turn_on_every_15m.wpi" to "schedule.wpi"... [2025-03-20 10:43:22] Running the script... [2025-03-20 10:43:22] I can not find the end time in the script... [2025-03-20 10:43:22] Done :-) [2025-03-20 10:43:49] Skip scheduling next shutdown, which should be done externally. [2025-03-20 10:43:49] Schedule next startup at: 2025-03-20 10:45:00 [xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.21) is started. [xxxx-xx-xx xx:xx:xx] System: Debian GNU/Linux 12 (bookworm), Kernel: Linux 6.12.18-v8-16k+, Architecture: arm64 [xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi Compute Module 5 Rev 1.0 [xxxx-xx-xx xx:xx:xx] RTC offset register has value 0x77 [xxxx-xx-xx xx:xx:xx] Seems RTC has good time, write RTC time into system [xxxx-xx-xx xx:xx:xx] Writing RTC time to system... [2025-03-20 10:45:35] Done :-) [2025-03-20 10:45:35] Firmware ID: 0x26 [2025-03-20 10:45:35] Firmware Revison: 0x06 [2025-03-20 10:45:35] Current Vout=5.06V, Iout=1.07A [2025-03-20 10:45:35] System starts up because scheduled startup is due.
Schedule log file after the restart:
--------------- 2025-03-20 10:43:50 --------------- Skip scheduling next shutdown, which should be done externally. Schedule next startup at: 2025-03-20 10:45:00 ---------------------------------------------------
but it doesn't change the 'Schedule next startup'
It should not. The only purpose of setting GPIO-4 to output mode and output LOW, is to let daemon.sh to detect and log the shutdown event, so you get more information for troubleshooting the issue. For example, if you see in the log that the shutdown happened too late (after the scheduled startup time), then you know why it couldn't wake up your Raspberry Pi later.
However your latest log still doesn't show any message about the shutdown event (and I don't know why). It does show the startup was properly scheduled, and the startup took place on time.
The "WAIT" syntax skips the scheduling of next shutdown, but not the next startup.
Your log shows the next startup was properly scheduled.
If it didn't happen, you may want to check if Witty Pi was actually powered when the scheduled startup time was due.
Another possibility is that you shut down your Pi AFTER the scheduled startup time, which makes the startup not going to happen. That's why I suggested you to control GPIO-4 for shutdown, so that you can check whether it was the case.
If it didn't happen, you may want to check if Witty Pi was actually powered when the scheduled startup time was due.
Its always connected to the power.
Another possibility is that you shut down your Pi AFTER the scheduled startup time, which makes the startup not going to happen.
The shutdown command was sent before the startup schedule time.
Is it possible that the Witty Pi 4 is not working correctly? Sometimes when i click the button to start, on witty, it doesn't start, but when i press it on the raspberry it starts.
What power source are you using?
Im using the power supply that came with the raspberry pi.
I don't understand. Which button did you press?
The one signed in the photo below.
The one signed in the photo below.
That seems to be the official IO board for Raspberry Pi Compute Module 5. Although I think it may work, Witty Pi 4 is not designed for that and we have not tested Witty Pi 4 with that board.
Witty Pi boots Raspberry Pi by powering it. If Raspberry Pi's own button has a default OFF state and it would not be bypassed when powering via GPIO header, then it wouldn't boot until you tap that button.