Is there a simple way to input time to display on the dashboard from the DS3231 RTC module? Using the I2C IN node, I can see and read what looks like seconds and minutes data using the 00 and 01 commands in those nodes. The SECONDS update to a new number every second, but it isn't decimal. The seconds start at 0 and count to 9 then jump to 16. It displays erratically up to 100 and then the minutes digit changes.
So now I suppose I have to decode this somehow to decimal to display a real looking clock on the dashboard.
Looking at the datasheet the upper 4 bits are the 10 seconds and the lower the seconds, same for the minutes etc.
I don't know Javascript good enough for bit manipulation.
In C we AND the right 4 bits to get the seconds value and then shift the left 4 bits to right to get 10th seconds value.
Yes, I recognize it as HEXADECIMAL, and I could certainly decode it in C but that really wasn't my question.
This was very easy to do on an Arduino so I'll rephrase my question: isn't there an easier way to read this very common device (DS3231 RTC) in NODE RED? Surely someone has done this before.
Only today I could have a better look on them. Both are lacking a Github repository. It seems to me they are abandoned. You probably did the right choice on handling them directly with I2C node, reading the internal registers.
Well, I seemed to have really messed something up. All was working well until I followed some tutorials about how to set the HWCLOCK.
Now, when I scan using 'i2cdetect -y 1' it shows ports 57 and a UU in port 68 where the DS3231 is supposed to be. The 'UU' is supposedly a conflict but the commands 'sudo hwclock -r' and sudo hwclock -w' entered into the terminal seem to work.
Yet using the i2c Scan node, a port 87 appears. I get errors when I try to use the 'i2c in' nodes to connect to 57 or 68. It will connect to the phantom port 87 but I only receive '255' in the msg.