0

HardwareSet up: Pi Model B, with Raspian Stretch. Boots up. Now try to install RTC Ds3231 module (with yellow capacitor at back) and plugged into the GPIO pins. Software:

$ lsmod shows
part of the list shows:

rtc_ds1307  13908  0
hwmon       10552  1 rtc_ds1307
i2c_dev     6913   0

$i2cdetect -y 1

responds all blanks

Q: What went wrong?

After $ls mode I have

Module                  Size  Used by
fuse                   99603  3
binfmt_misc             7988  1
snd_soc_bcm2835_i2s     7480  0
snd_soc_core          179915  1 snd_soc_bcm2835_i2s
snd_compress           10384  1 snd_soc_core
snd_pcm_dmaengine       5894  1 snd_soc_core
snd_bcm2835            24427  1
snd_pcm                98501  4 snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core
snd_timer              23968  1 snd_pcm
i2c_bcm2835             7167  0
bcm2835_gpiomem         3940  0
snd                    70032  7 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
uio_pdrv_genirq         3923  0
uio                    10204  1 uio_pdrv_genirq
fixed                   3285  0
8192cu                582217  0
cfg80211              543091  1 8192cu
evdev                  12423  6
joydev                  9988  0
rfkill                 20851  3 cfg80211
rtc_ds1307             13908  0
hwmon                  10552  1 rtc_ds1307
i2c_dev                 6913  0
ip_tables              13161  0
x_tables               20578  1 ip_tables
ipv6                  409035  24
pi@raspberrypi:~ $ 

I also have my Wifi set up so the time is from network protocol. This DIY module does not come with coin battery. Does it matter? All GPIO ports are enabled.

Anyway upon issue of

#timedatectl

root@raspberrypi:/sys/class/i2c-adapter# timedatectl
      Local time: Wed 2017-10-18 12:57:19 +08
  Universal time: Wed 2017-10-18 04:57:19 UTC
        RTC time: n/a
       Time zone: Asia/Kuching (+08, +0800)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no

root@raspberrypi:/sys/class/i2c-adapter#

After issue command

i2cdetect-y 1

root@raspberrypi:/sys/class/i2c-adapter# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@raspberrypi:/sys/class/i2c-adapter#

I had removed the fake hwclock

After issue $dmesg command I get the following

pi@raspberrypi:~ $ dmesg | grep ds1307
[    4.871029] rtc-ds1307: probe of 1-0068 failed with error -5
pi@raspberrypi:~ $ 

I got the reference from https://ubuntu-mate.community/t/supporting-ds3231-rtc-source-synchronise-with-network-time/5711

  • Did you enable I2c using sudo raspi-config? – Steve Robillard Oct 17 '17 at 9:04
  • @Steve . Yes I did enable I2C. – mark Oct 17 '17 at 9:32
  • The reference is for a Pi2 or Pi3. It WILL NOT work for a Model B i2cdetect -y 1 will never show ANYTHING, because it is NOT CONNECTED. i2cdetect -y 0 would show any device. What does ls /dev/i2c* show? – Milliways Oct 19 '17 at 4:12
  • i2cdetect -y 1 will show "UU" for an RTC that's been claimed by a kernel module. You'll also see some messages in a dmesg command for the I2C device. – Dougie Dec 3 '18 at 11:42
1

Enter dtoverlay=i2c-rtc,ds1307 into /boot/config.txt or dtoverlay=i2c-rtc,ds3231 if using DS3231 (they all use rtc_ds1307)

See /boot/overlays/README for detail

DO NOT modify anything else!

  • @Miliways, edited and reboot and try – mark Oct 17 '17 at 9:46
  • FYI the physical device is DS3231 ic chip, logically I should use DS3231 in the code – mark Oct 17 '17 at 9:51
  • still a series of dots... nothing – mark Oct 17 '17 at 9:52
  • it cannot recognise the module – mark Oct 17 '17 at 9:52
  • 1
    @mark I would not worry about i2cdetect (which AFAIK on Pi B uses I²C 0) What does timedatectl show? DO NOT paste detail into Comments, edit into your question. I must admit I haven't used RTC in an old Pi, although I have used I²C – Milliways Oct 17 '17 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.