Notifications
Clear all

Witty Pi 4: Scheduled Shutdown Works, but RTC Startup Fails — Manual Alarm Test Succeeds

10 Posts
2 Users
0 Reactions
204 Views
(@slavag)
Posts: 10
Active Member
Topic starter
 

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:

  1. Verified RTC time and system time synchronization.
  2. Verified successful automatic scheduled shutdown.
  3. Verified successful RTC startup using manually configured alarms.
  4. Verified that the schedule engine calculates the expected startup times.
  5. Tested automatic startup after a 30-minute scheduled sleep.
  6. Confirmed that the external power supply remained connected.
  7. Verified that manual power-on using the Witty Pi button works.
  8. Inspected runScript.sh, daemon.sh, and utilities.sh.
  9. Inspected controller alarm configuration and RTC registers through I²C.
  10. 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!

 
Posted : 06/11/2026 8:31 am
(@admin)
Posts: 856
Member Admin
 

One thing that concerns me is the reported Vout of only 4.40–4.47V, which is significantly below the expected 5V operating voltage. This suggests a possible power supply issue.

Could you clarify what power supply you are using (type, model, rated voltage/current), and how it is connected to Witty Pi 4?

An insufficient power supply may cause a significant voltage drop when the Raspberry Pi starts up, potentially even resetting the Witty Pi's microcontroller. This could explain the failed automatic startup, although it does not fully explain why manual startup succeeds.

Before investigating the firmware or scheduling logic further, I would recommend testing with a reliable 5V power supply capable of delivering sufficient current, using a suitable cable. If possible, please also measure the actual 5V output voltage with a multimeter (on Raspberry Pi's 5V pin in GPIO header).

 
Posted : 09/11/2026 8:52 am
(@slavag)
Posts: 10
Active Member
Topic starter
 

@admin 
Hi, thanks for your reply, the power supplied to witty 4 from Waveshare Solar Power Manager (D) which is getting (currently) power from 12v 5A supplier, the power from Waveshare Solar Power Manager  is taken screw terminal (3) which provide 5v up to 3A. Checking with voltmeter the output voltage there shows me stable 5.07v. So' I'm not sure that this is the issue, as once it started manually (by pressing the latch button) it's work stable without issues.

Thanks

 
Posted : 09/11/2026 9:57 am
(@slavag)
Posts: 10
Active Member
Topic starter
 

@admin Bi, is there any update on this?

Thanks 

 
Posted : 22/11/2026 7:36 am
(@admin)
Posts: 856
Member Admin
 

@slavag 

As mentioned earlier, Witty Pi itself reports Vout of 4.40–4.47V. A reading of 5.07V at the Waveshare terminal doesn't explain that — it only shows the voltage is lost somewhere between the supply and the Witty Pi output. That manual startup works doesn't rule out power either.

Please temporarily bypass the Waveshare Solar Power Manager, use a reliable 5V power adapter to power Witty Pi 4 directly, and repeat your 30-minute schedule test. Please also measure the voltage on 5V pin in the GPIO header while the Pi is running.

We need to confirm that the issue can be reproduced under normal power supply conditions before investigating the firmware or scheduling logic further. If scheduled startup also fails in that setup, please post the full wittyPi.log so we can look into it further.

Firmware revision 0x07 and software V4.23 are the latest.

 
Posted : 23/11/2026 11:55 am
(@slavag)
Posts: 10
Active Member
Topic starter
 

@admin Thanks for the reply, but if from the terminal there's 5v output and nothing to connected to this terminal except witty 4 (no any compoenent between them) and same 5v are ariving to the witty 4, so , why it's related to that ? I measured on witty 4 also, same 5v

 
Posted : 25/11/2026 8:27 am
(@slavag)
Posts: 10
Active Member
Topic starter
 

@admin

However, the power supply provides 5V at its output terminals, and the Witty Pi 4 is connected directly to these terminals, with no intermediate components. I also measured the voltage directly at the Witty Pi 4 input and confirmed that it receives the same 5V. Given this, could you explain why the power supply would be related to this issue?

I also have another question: if the power supply voltage drops or the power is suddenly disconnected, causing both the Witty Pi 4 and the Raspberry Pi to shut down unexpectedly without a graceful shutdown, could this affect the next scheduled startup?

Is it possible that an unexpected power loss leaves the Witty Pi 4 controller in an inconsistent internal state, prevents some internal flags from being cleared, or otherwise interferes with the previously configured RTC startup alarm?

The reason I'm asking is that scheduled shutdown and startup work reliably during controlled tests, but the scheduled morning startup occasionally fails after an unexpected power loss.

 
Posted : 25/11/2026 8:46 am
(@admin)
Posts: 856
Member Admin
 

@slavag If the power is lost unexpectedly, the supply is involved, and the cause of that power loss is something to find out on your side. That’s why a test with a regular 5V adapter matters: it helps you narrow down the scope of the problem.

About your question: the startup alarm is stored in the controller’s EEPROM and survives a power loss. The controller checks the RTC every second and triggers the startup only within 2 seconds after the scheduled time. If Witty Pi has no power at that moment, that startup is missed, and it will not be triggered later when power comes back. If power is restored before the scheduled time, the startup should work as usual.

So for the failed mornings, please check whether the power had been restored before the scheduled startup time.

If you want the Pi to start whenever power is restored, set “Default state when powered” to ON (option 11 → [1] in wittyPi.sh). After startup, the schedule script will be revised automatically.

This also explains the register difference you saw earlier: the RTC alarm registers are only loaded shortly before each alarm, so they don’t always match the controller’s configuration.

 
Posted : 25/11/2026 4:43 pm
(@slavag)
Posts: 10
Active Member
Topic starter
 

@admin Thanks, the question was if not proper shutdown (power loss) and the power back before the RTC alrm timr can somehow to clear RTC alarm or to prevent from it to turn RPI on ?
Also, can you elaborate more on "This also explains the register difference you saw earlier: the RTC alarm registers are only loaded shortly before each alarm, so they don’t always match the controller’s configuration."
Thanks

 
Posted : 25/11/2026 5:02 pm
(@admin)
Posts: 856
Member Admin
 

@slavag

As mentioned in my previous reply, an improper shutdown itself should not affect a previously configured startup alarm, provided that power is restored before the scheduled startup time, and the RTC time remains correct (require CR2032 battery).

The RTC chip has only one set of hardware alarm registers, while Witty Pi maintains separate startup and shutdown alarms in the microcontroller. The corresponding alarm configuration is copied to the RTC shortly before it is due. The register difference you observed is therefore expected behavior, not an indication of a malfunction.

I would suggest focusing on reproducing the reported issue under normal power supply conditions rather than investigating hypothetical failure scenarios.

 
Posted : 26/11/2026 4:45 pm
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.