Open Grandpa-G opened 2 years ago
You have right, we will fix that.
Also, using the command line I did
megabas 0 rtcwr 12 21 21 09 31 00 it responded done then megabas 0 rtcrd and it returned 00/00/00 00:00:00
Am I doing this incorrectly?
Looks like you do the right thing, let me know what is the firmware version of the card by issuing "megabas 0 board"
Firmware ver 01.01, CPU temperature 37 C, Power source 21.50 V, Raspberry 4.98 V
Please update your card firmware, instructions here: https://github.com/SequentMicrosystems/megabas-rpi/blob/master/update/README.md Make sure no-one try to access the card during the update process.
Yeepee. That fixed it.
FYI
Thank you for the info will fix it except for the battery holder..
Thanks.
Is there an overlay to interface with the RTC? Or what is the best way to use the RTC?
Can I ask what you mean by overlay? The only options are command line, python (soon), and NodeRed (i have to check but is duable).
the overlay is given in the config.txt file for the pi.
Here is a reference, mainly the first part. The reference talks about a specific RTC, but gives you the idea. https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time
Thanks, I will take a look.
Did you come up with a way to have your RTC interact directly with Raspberry clock? By any chance is your RTC a DS 1307 look-alike?
Will be nice, but frankly I do not know when I start doing it.. Bottom line is that I can not give you a timeframe for it.
I understand completely. I just don't know how to use your RTC then. Is the idea to set the Raspberry clock on every boot from the RTC vial a megabas command?
That was the idea to read the RTC at power up when you have no internet connectivity, otherwise if you are connected to the internet you can read your time from there.
Ok, I will work with that. It just takes a bit more to know (in code) that you don't have an internet connection.
Thanks for your help.
Can I get this functionality added to a node-red node?
You mean reading and setting the RTC?
It is good to set the RTC set and get are now available.
However - for rtcGet, the month is off by 1. For today, it reports the results as 2022 8 13 9 18 52
import megabas
year, month, day, hour, minute, second = rtcGet(0)
print(year, month, day, hour, minute, second)
Also, all the new I2C definitions of the address space aren't necessary. The definitions are already given at the top of the module, just without the I2C prefix.
In Python Library, I don't see any way to read or set the Real Time Clock.
Am I missing something?