LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   DS3231 RTC installation guide for RPi updated (https://www.linuxquestions.org/questions/slackware-arm-108/ds3231-rtc-installation-guide-for-rpi-updated-4175577289/)

Penthux 04-12-2016 12:23 PM

DS3231 RTC installation guide for RPi updated
 
The ChronoDot RTC [DS3231] installation guide for the Raspberry Pi has been updated to include Device Tree (DT) and non-Device Tree (pre-DT) methods.

http://rpi.fatdog.eu/index.php?p=chronodot-rtc

Whichever method you choose to use, it should be easy to install and configure a DS3231 RTC on your Slackware ARM system.

slackist 05-27-2016 02:48 PM

And many thanks for doing that. I got my first ever Raspi this morning and it came bundled with a DS1307 rtc module, your instructions were very helpful.

Penthux 05-27-2016 03:50 PM

Quote:

Originally Posted by slackist (Post 5551907)
And many thanks for doing that. I got my first ever Raspi this morning and it came bundled with a DS1307 rtc module, your instructions were very helpful.

You are very welcome, and I hope you have a wonderful Slackware ARM on a Raspberry Pi experience. :)

slackist 09-15-2016 12:07 AM

How many wires does an rtc need?

I just received a breadboard and one of the T-cobbler things ( :D ) so my rtc (this model):
http://thaieasyelec.com/en/developme...pi-detail.html

is now hooked up to it all and working fine. To play it safe I used 10 wires (because I know nothing about this stuff so I was being cautious) and just replicated the pins that the rtc usually covers on the GPIO but 10 seems excessive for a clock!

I've been goggling it for a while and as far as I can tell it will only need 5V, GND and the GPIO2, GPIO3 (aka SDA1 i2c and SCL1 i2c aaka Pins 3 & 5 depending on which schematic you follow)

Is that right?

Penthux 09-15-2016 09:07 AM

Quote:

Originally Posted by slackist (Post 5605484)
How many wires does an rtc need?

I've been goggling it for a while and as far as I can tell it will only need 5V, GND and the GPIO2, GPIO3 (aka SDA1 i2c and SCL1 i2c aaka Pins 3 & 5 depending on which schematic you follow)

Is that right?

Only 4 connections are required and you already have it absolutely correct, slackist. Use the wiring layout from sarpi if it helps. The hardware may be different but the connections are exactly the same for DS1307 and DS3231 RTCs. For connecting a RTC such as yours you might consider using a GPIO extender, such as this, but only if raising the height of the GPIO pins is going to make things easier.

There are quite a few differences from device to device in quality and reliability with RTCs. I find the ones with Maxim controllers to be the easiest to work with, the best supported, and the most reliable. The DS1307 is regulated by a frequency-based crystal oscillator and the DS3231 is regulated by an integrated temperature-compensated crystal oscillator. The difference here is; the DS3231 is a hell of a lot more accurate at keeping time than the DS1307. With the DS1307 you could be very lucky and get a really good one which only loses/gains a second per month. With the DS3231 you probably won't lose/gain a second in two or three months.

slackist 09-15-2016 10:20 AM

Brilliant and thanks so much for the assist Penthux.

New cron.weekly job is set up to write clock time from a server.

After I fiddle with it tomorrow hopefully it will look better without so many wires attached to the breadboard.

Penthux 09-15-2016 02:56 PM

Quote:

Originally Posted by slackist (Post 5605662)
Brilliant and thanks so much for the assist Penthux.

New cron.weekly job is set up to write clock time from a server.

After I fiddle with it tomorrow hopefully it will look better without so many wires attached to the breadboard.

You're welcome. Sharing experience and knowledge is hopefully going to save you time and effort. Although seriously, I would think about a GPIO extender (like these - 2x5pins) for your particular RTC, but only if it isn't going to get in the way of the heatsink/fan when it's installed. Then you could kiss goodbye and good riddance to those wires. ;)

glorsplitz 09-15-2016 07:57 PM

wittyPi2
 
2 Attachment(s)
I got wittyPi2 to do rtc and have an ON switch.

I can shutdown and the sarpi turns off and I can push the little black button to turn it on.

Using their software I was able to get the rtc stuff together but not sure why system and rtc are 1 hour off, haven't had time to look into it.

The case with fan is from amazon, fan is very noisy.

slackist 09-15-2016 08:27 PM

I've got a 40 pin GPIO extender and the ribbon cable that leads to the T-cobbler on the breadboard takes up all of it and I am reluctant to start snipping wires off because I am a total newb at this sort of thing.

It now has a little (14x14x10mm) heat sink mounted the SoC and I think I can scavenge a fan from my Mrs desktop that has a spare one in the case so that will be the next steps.

bassmadrigal 09-16-2016 01:39 PM

Quote:

Originally Posted by glorsplitz (Post 5605877)
Using their software I was able to get the rtc stuff together but not sure why system and rtc are 1 hour off, haven't had time to look into it.

If you happen to be +/- 1hr from GMT/UTC, it could be one item is set to utc and the other is set to the local timezone.

Penthux 09-17-2016 07:35 AM

Quote:

Originally Posted by glorsplitz (Post 5605877)
Using their software I was able to get the rtc stuff together but not sure why system and rtc are 1 hour off, haven't had time to look into it.

I've had the same issue and the answer was setting the timezone manually. Perform this as 'root' and set <YOUR_LOCATION> - e.g. Europe/Paris, America/New_York, Africa/Johannesburg, Australia/Melbourne

# rm -f /etc/localtime
# ln -sf /usr/share/zoneinfo/<YOUR_LOCATION> /etc/localtime
# ntpdate 0.pool.ntp.org
# hwclock -w

This will set your timezone correctly.

Take a look in /usr/share/zoneinfo/ for the different zone locations.

< edit - oops! should have been 'hwclock -w' >

glorsplitz 09-17-2016 05:31 PM

Thanks bassmadrigal, Penthux for replying.

I did what Penthux said and now running ./wittyPi.sh I'm getting:

>>> Your system time is: Sat 17 Sep 2016 17:28:11 EST
>>> Your RTC time is: Sat 17 Sep 2016 17:28:11 EST

Cheers!

slackist 12-11-2016 09:06 PM

I'm having an odd problem with my ds1307.

It seems that when I add or remove anything from the breadboard it is connected to it resets itself. Even a simple led+resistor+cables will make the rtc forget its data.

My house electrics aren't earthed/grounded (that is pretty common here in Thailand) so I thought that was the problem but it seems to happen randomly. Sometimes a 'halt' command will carry the date from the rtc upon starting up again, sometimes a 'reboot' command will do also but as often as not either command will cause the clock to reset.

I have tried stopping anything that might write/reset to hwclock and also the ntpdate in rc.local is commented out but it is still happening.

Penthux 12-12-2016 06:34 AM

Quote:

Originally Posted by slackist (Post 5640856)
I'm having an odd problem with my ds1307.

Do you have just the one DS1307 RTC? If you have another then test with it and see if it produces the same error(s). It's a strange problem that might come about if you have a faulty back-up battery connection or some kind of reset going on. Perhaps getting rid of the breadboard setup is the first step?

I would highly recommend that you ditch the DS1307 and replace it with a DS3231 which are vastly more reliable/accurate. ;)


All times are GMT -5. The time now is 12:06 PM.