Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wakeup settings lost when battery is exhausted #1035

Open
hplato opened this issue Nov 18, 2023 · 2 comments
Open

Wakeup settings lost when battery is exhausted #1035

hplato opened this issue Nov 18, 2023 · 2 comments

Comments

@hplato
Copy link

hplato commented Nov 18, 2023

I have added the wakup command to my cron:

@reboot /usr/bin/python3 /home/pi/PiJuice/Software/Test/wakeup_enable.py

I use the rpi to wakeup at 3:00am and to fetch some information to write to an eink display. When the battery dies, I plug it in for a few hours, then press the power-on button, which restarts the PI to pull down the daily information.

I've noticed that often when the battery dies, the wakeup settings are blank. Is there any way to programmatically set these at a reboot so that it can reliably restart on a periodic basis?

@hplato
Copy link
Author

hplato commented Dec 1, 2023

In the pijuice_util there is a --get-alarm that provides some JSON with the alarm details. Looking through the library there is an rtc.setAlarm function that take an object and sets time. My python is pretty rusty, is there a code example of how to use SetAlarm to programatically set the pijuice alarm parameters?

@tvoverbeek
Copy link
Contributor

Look at how picuije_cli and pijuice_gui do it.
For pijuice_cli look at _set_alarm starting on line 1174 (https://github.com/PiSupply/PiJuice/blob/master/Software/Source/src/pijuice_cli.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants