Witty Pi 4 — Scheduled Shutdown Works, but Automatic RTC Startup Fails
Hi,
I’m experiencing a persistent issue with my Witty Pi 4 connected to a Raspberry Pi Zero 2 W.
The Witty Pi reliably shuts down the Raspberry Pi at the scheduled time but consistently fails to power it back on at the next scheduled startup time.
Interestingly, a short test using manually configured shutdown/startup alarms worked correctly.
I’ve performed extensive troubleshooting, including a complete power reset, without resolving the issue.
1. Hardware and Software Configuration
|
Component |
Details |
|---|---|
|
Raspberry Pi |
Raspberry Pi Zero 2 W Rev 1.0 |
|
Operating system |
Raspberry Pi OS / Raspbian GNU/Linux 13 (Trixie) |
|
Kernel |
Linux 6.18.50+rpt-rpi-v7 |
|
Architecture |
armhf |
|
Witty Pi |
Witty Pi 4 |
|
Witty Pi software |
v4.23 |
|
Firmware ID |
0x26 |
|
Firmware revision |
0x07 |
|
RTC |
Integrated Witty Pi RTC |
|
Power supply |
External power supply, continuously connected |
|
Default power state |
OFF |
|
Power cut delay |
15 seconds |
|
Pulsing interval during sleep |
20 seconds |
|
Low voltage threshold |
3.5 V |
|
Recovery voltage threshold |
3.7 V |
|
Observed Vout |
4.40–4.47 V |
|
Observed Iout |
0.43–0.51 A |
The project is an outdoor digital photo frame.
The Witty Pi controls power to the Raspberry Pi, which also drives an HDMI LCD and a presence sensor.
During the failed startup attempts, an external power supply remained connected. The Raspberry Pi could be powered on immediately using the Witty Pi button.
2. Expected Behavior
The intended schedule is:
- Power ON at 07:00, Sunday through Friday.
- Power OFF at 18:00, Sunday through Friday.
- Remain OFF throughout Saturday.
The current schedule is based on fixed-duration intervals and has a separate daylight-saving-time issue, causing shutdown to occur at 17:00 instead of 18:00.
However, the startup failure occurs even when the next startup alarm is explicitly programmed for 07:00.
3. Current Schedule
The active schedule.wpi file contains:
BEGIN 2026-03-22 07:00:00
END 2036-03-07 18:00:00
ON H10
OFF H14
ON H10
OFF H14
ON H10
OFF H14
ON H10
OFF H14
ON H10
OFF H14
ON H10
OFF H38
The scheduler successfully calculates and programs the next shutdown and startup times.
For example, on November 5:
>>> Your system time is: 2026-11-05 09:08:38 IST
>>> Your RTC time is: 2026-11-05 09:08:40 IST
4. Schedule next shutdown [05 17:00:00]
5. Schedule next startup [06 07:00:00]
6. Choose schedule script [in use]
The RTC and system clocks are synchronized within approximately two seconds.
4. Evidence of Failed Automatic Startup
On November 4, Witty Pi programmed the following schedule:
[2026-11-04 12:45:21] Schedule next shutdown at: 2026-11-04 17:00:00
[2026-11-04 12:45:21] Schedule next startup at: 2026-11-05 07:00:00
The shutdown occurred successfully:
[2026-11-04 16:59:59] Shutting down system because scheduled shutdown is due.
[2026-11-04 16:59:59] Halting all processes and then shutdown Raspberry Pi...
However, the Raspberry Pi did not start at 07:00 on November 5.
I manually started it at approximately 09:07.
The log confirms that startup was triggered by the button rather than the RTC alarm:
[2026-11-05 09:07:03] Firmware ID: 0x26
[2026-11-05 09:07:03] Firmware Revison: 0x07
[2026-11-05 09:07:03] Current Vout=4.4V, Iout=0.45A
[2026-11-05 09:07:03] System starts up because the button is clicked.
[2026-11-05 09:07:09] Schedule next shutdown at: 2026-11-05 17:00:00
[2026-11-05 09:07:09] Schedule next startup at: 2026-11-06 07:00:00
The same failure occurred on November 4, following the scheduled shutdown on November 3.
5. Successful Test — Manually Configured RTC Alarms
To verify that the RTC wake-up hardware works, I temporarily disabled the schedule and manually configured the shutdown/startup alarms through wittyPi.sh.
The test used:
- Shutdown: November 4, 12:38.
- Startup: November 4, 12:40.
Both events succeeded.
Relevant logs:
[2026-11-04 12:35:07] Seting shutdown time to "04 12:38:00"
[2026-11-04 12:35:18] Seting startup time to "04 12:40:00"
[2026-11-04 12:37:58] Shutting down system because scheduled shutdown is due.
[2026-11-04 12:37:58] Halting all processes and then shutdown Raspberry Pi...
[2026-11-04 12:40:30] System starts up because scheduled startup is due.
This demonstrates that the Witty Pi can successfully power on the Raspberry Pi using an RTC alarm.
6. Failed Test — 30-Minute Schedule-Based Wake-Up
I then created a temporary schedule to test the same mechanism using runScript.sh.
The temporary schedule was:
BEGIN 2026-11-05 10:14:17
END 2026-11-06 10:11:17
ON M0
OFF M30
ON H23
OFF H1
The scheduler output was:
--------------- 2026-11-05 10:11:18 ---------------
Schedule next shutdown at: 2026-11-05 10:14:17
Schedule next startup at: 2026-11-05 10:44:17
---------------------------------------------------
Result:
- Scheduled shutdown at approximately 10:14: successful.
- Scheduled startup at approximately 10:44: failed.
The Raspberry Pi remained powered off and required manual intervention.
Therefore, the failure is not limited to overnight sleep intervals.
7. RTC Register Investigation
I inspected the Witty Pi registers through I²C.
Commands:
sudo i2cget -y 1 0x08 9
sudo i2cget -y 1 0x08 10
sudo i2cget -y 1 0x08 54
sudo i2cget -y 1 0x08 55
for reg in 65 66 67 68 69; do
sudo i2cget -y 1 0x08 "$reg"
done
for reg in 27 28 29 30 31; do
sudo i2cget -y 1 0x08 "$reg"
done
Results:
Controller alarm flags:
Register 9: 0x00
Register 10: 0x00
RTC control:
Register 54: 0x00
Register 55: 0x80
RTC alarm:
Register 65: 0x00
Register 66: 0x00
Register 67: 0x07
Register 68: 0x05
Register 69: 0x80
Controller startup configuration:
Register 27: 0x00
Register 28: 0x00
Register 29: 0x07
Register 30: 0x06
Register 31: 0x00
An interesting observation is that the controller’s startup configuration referenced November 6 at 07:00, while the RTC alarm registers referenced November 5 at 07:00.
These values were collected while the Raspberry Pi was running.
I understand that the microcontroller may update the RTC alarm registers when transitioning into the powered-off state, so I cannot determine whether this discrepancy is expected behavior.
I would appreciate clarification about how the firmware synchronizes the controller’s startup configuration with the underlying RTC alarm.
8. Troubleshooting Already Performed
The following troubleshooting steps have been completed:
- Verified RTC time and system time synchronization.
- Verified successful automatic scheduled shutdown.
- Verified successful RTC startup using manually configured alarms.
- Verified that the schedule engine calculates the expected startup times.
- Tested automatic startup after a 30-minute scheduled sleep.
- Confirmed that the external power supply remained connected.
- Verified that manual power-on using the Witty Pi button works.
- Inspected
runScript.sh,daemon.sh, andutilities.sh. - Inspected controller alarm configuration and RTC registers through I²C.
- Performed a complete hardware power reset:
- Disconnected external power.
- Removed the RTC CR battery.
- Waited for residual power to dissipate.
- Reconnected the battery and external power.
- Reset/reconfigured Witty Pi settings.
The problem persisted after the complete power reset.
9. Questions for UUGear Support
I would appreciate assistance with the following questions:
1. Why would manually configured RTC alarms successfully wake the Raspberry Pi while alarms configured through runScript.sh fail?
Both methods appear to use the same set_startup_time() function.
2. Is the discrepancy between the controller’s startup configuration and the underlying RTC alarm registers expected?
Specifically:
Controller startup: November 6, 07:00
RTC alarm: November 5, 07:00
Does the microcontroller update the hardware RTC alarm immediately, or only when the Raspberry Pi enters the powered-off state?
3. Could this be a known issue with firmware revision 0x07 or Witty Pi software v4.23?
Is there a newer firmware revision or a recommended firmware recovery procedure?
4. Is there a way to inspect the microcontroller’s internal alarm state after a failed startup?
Ideally, I would like to determine whether:
- The RTC alarm triggered but the microcontroller failed to enable power.
- The RTC alarm was not correctly armed.
- The RTC alarm was triggered but subsequently cleared or ignored.
5. Are there any additional diagnostic registers or firmware debug options that could help isolate this problem?
10. Summary
The key observation is:
Manually configured RTC startup works, but startup configured through the schedule engine fails, despite the schedule correctly calculating the startup time.
Automatic shutdown consistently works.
The problem persists after a complete power reset, including removal of the RTC backup battery.
Any suggestions regarding firmware behavior, alarm synchronization, or additional diagnostics would be greatly appreciated.
Thank you!
