-
Notifications
You must be signed in to change notification settings - Fork 12
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
Just a few comments & questions #2
Comments
This repo is old, you can do everything with the standard-driver now. You should have a look at two of my other repos: one is https://github.com/bablokb/pcb-pi-batman (scroll to the bottom for the complete Be sure to add the wakeup-source parameter to the overlay
Doing a
will give you the current state of your rtc. |
I'm overwhelmed :) Let me try to digest this & I'll follow up here if that's OK? |
No problem. Maybe to sum up things
You need root-permissions for the command that sets the alarm time. See the man-page of |
Helpful summation! Just so I am clear - is this a summation for this repo ("pi-wake-on-rtc"), and not the "batman" or "uptime-manager" repos?
date -d '+ 2 minutes' +%s | sudo tee /sys/class/rtc/rtc0/wakealarm
Once
While the This behavior is different from last night - the Is there a "control" to clear the alarm?? Could the re-installation of |
This is for the newer repos, not pi-wake-on-rtc, which uses a python-lib to set the alarms. To clear the alarm-date, write a zero to the wakealarm file. This might also clear the alarm-state, but I haven't tried. It is usually the driver at boot which resets the alarm. The code in this repository can do all this, that is the reason I wrote it. And you should not use fake-hwclock together with a real rtc, this won't work. |
Dear Bernhard, I really appreciate this project and i use this method intead of hwclock on some of my rpi computers. Unfortunatelly I faced that it doesn't work with the newest raspbian OS due to the version of python. (I tried to force python2, but the smbus library seems missing, and seems to be no longer available for python2. ). In the end I updated your code to python3 on my computer. I am still testing it, it looks to be okay. Are you interested the updated files (rtcctl and ds3231.py)? Thank you for your effort on this project again! |
Hi Janos, that would be great. Could you fork the repo, update the python-files and create a pull-request? I will be happy to merge the changes, since python2 is outdated. The only reason I haven't updated this is that the standard driver now does everything I need. (but I do have some older systems still using this). Thanks, Bernhard |
@bablokb :
Could you tell us which standard driver are you referring to? Thanks! |
That is written above in the commands:
This is the standard driver. With the command date -d "date-time-spec" +%s > /sys/class/rtc/rtc0/wakealarm You can set the alarm (see comments above about variation if sudo is needed).
will let you query datetime, alarm-state and time and so on of your rtc. All of this also works for other RTCs, as long as the driver implements the standard kernel-interfaces for RTCs. The python-lib here allows a different level of control over the RTC, e.g. it also supports alarm2. But most of the time I only need the standard functionality. |
Ah - yes... I knew of that & have used it for a while now. I'm sorry to have troubled you, but when you said it was new I assumed it was one I wasn't aware of. Thanks |
Hello Bernhard, Great! I've tried to fork the repo and upload the files according to tutorials, I don't know wether it was succesful. I made a folder named python3 with the new files. Can you see that ones? If yes, please take a look, and test it if you have chance. Thanks |
Well, I can see your fork here: https://github.com/UtolsoLoteriKutya/pi-wake-on-rtc But it seems you have not changed anything, it still tells me it is up to date with my branch. Normally, you would download your fork to your pc
and then change/add files. The changed/new files need to be added to the clone on your PC
and commited, e.g.
Then you would push this to your fork
Once you have pushed the code, it is visible on github and you can create a pull request using the github website. I hope this helps. Bernhard |
For info: very nicely done (the install script is way past my ability). It appears to me that the only changes necessary for Rpi 4B, Ubuntu 20.04.1, and python3 are:
|
Sorry, I spoke too quickly. It is also necessary to put comment lines in /etc/wake-on-rtc.conf on separate lines and the chang shebangs (#!) to #!/use/bin/python3 or equivalently make /usr/bin/python a symbolic link to python. |
Sorry, I spoke too quickly. It is also necessary to put comment lines in /etc/wake-on-rtc.conf on separate lines and then change the shebangs (#!) to #!/use/bin/python3 or equivalently make /usr/bin/python a symbolic link to python3. (Yech!) |
This is the repo I have been looking for - and you have done it extremely well!
I am working on something very similar: I want to use my RPi 3B in an "off-grid" application. The system is powered by a 30 watt solar panel, and therefore the RPi must be powered OFF when it is not required. I have worked out a method that should work to remove power from the RPi, but I have been struggling to devise a method to restore power. It seems you found an answer - even before I thought of the problem :)
My question has to do with setting the DS3231 alarm: As my DS3231 is set up now (using
dtoverlay=i2c-rtc,ds3231
), the DS3231 registers cannot be accessed when the RPi is running. But I need to be able to set the alarm time based on inputs from the system's sensors. I've seen that you do not use the system driver, but replace it with your software. And so my question is, "Does your design allow the RPi to set the alarm time while the DS3231 is maintaining time for the system?"The text was updated successfully, but these errors were encountered: