What happens to the Pi's on/off scheduling if the battery connection is removed from the board to swap the LiPo (in the absence of uninterupted 5V input over USB C)? Are the selected parameters maintained in internal memory of the L3V7's uC between power cycles? Or, is it necessary to reconfigure the schedule script using the Witty Pi script after a cold reboot?
If the information is maintained internally, does disconnection duration (seconds~hours) matter in the absence of a battery backup or supercapacitor?
The Witty Pi 4 L3V7's configuration parameters, including the scheduled startup and shutdown times, are stored in the MCU's EEPROM. These values are non-volatile and will survive a complete power loss, regardless of how long the board remains disconnected.
The schedule script (schedule.wpi) is stored on the Raspberry Pi's filesystem, so it will also remain available after a battery replacement. You do not need to select or configure the schedule script again.
However, there is an important distinction between retaining the scheduling configuration and retaining the correct time.
As explained in Section 10.1 of the Witty Pi 4 L3V7 user manual, this model does not have a backup battery or supercapacitor for its RTC. If both the lithium battery and USB-C power supply are disconnected, the RTC will lose its timekeeping capability.
After replacing the battery, you should:
- Start the Raspberry Pi manually if it does not turn on automatically.
- Make sure the system time and RTC time are correct, and synchronize them if necessary.
- Run ./runScript.sh in the ~/wittypi directory to recalculate the upcoming startup and shutdown times.
Once the correct time has been restored and the schedule has been recalculated, the existing schedule script can continue operating without being reconfigured.
