DS1307 not detected by i2cdetect

I have the following setup:

  • BalenaFin v1.1 with CM3+ lite attached
  • RTC battery (fresh, measured 3.24V) placed in its socket
  • flashed Raspbian Stretch (using Balena Etcher)
  • I2C activated in raspi-config -> Interfacing Options -> I2C
  • last line of /boot/config.txt is “dtoverlay=i2c-rtc,ds1307”

However, the output of “sudo i2cdetect -y 1” still shows that there is no I2C device.
Other I2C devices (for example an ADS1115 a/d-converter) are seen by i2cdetect (after connected to the I2C pins), so I guess the I2C bus itself is working.

I also tried flashing the following operating systems and got the same result:
Raspbian Jessie
Raspbian Buster
Raspbian (balena version from https://www.balena.io/fin/1.1/docs/downloads/)

Am I missing something?
Is there any way to tell if the RTC module is working/broken?

Any help would be appreciated.

// Philipp

Hi and welcome to the forums!
You could try using the timedatectl utility: if that shows the RTC output, then RTC is working.
More info on that here
Tell us if this solves your issue or if you need anything else!

Hi,
the ouput of timedatectl on Raspbian Stretch says RTC time: n/a.

If I flash the balena-preconfigured Raspbian, timedatectl says RTC time: Wed 2019-07-17 05:17:47.
The command i2cdetect -y 1 still indicates that no I2C device is found, but the RTC seems to work.

This would mean that some configuration step is missing on Raspbian Stretch apart from these:

  • I2C activated in raspi-config -> Interfacing Options -> I2C
  • last line of /boot/config.txt is “dtoverlay=i2c-rtc,ds1307”

Can anyone give me a hint what I am missing?

Hi,
just made it work. Here is my setup now:

  • BalenaFin v1.1 with CM3+ lite attached
  • RTC battery (fresh, measured 3.24V) placed in its socket
  • flashed Raspbian Stretch (using Balena Etcher)
  • I2C activated in raspi-config -> Interfacing Options -> I2C
  • added to /boot/config.txt: “dtoverlay=balena-fin”
  • added to /etc/modules: “rtc_ds1307”

Why it didn’t work:

  • I assumed that the DS1307 was on i2c-1 (as described on https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time). Instead, the RTC is on i2c-3, which is not available without using “dtoverlay=balena-fin”.
  • Adding “dtoverlay=i2c-rtc,ds1307” does not load the module “rtc_ds1307”. Without that, “timedatectl” does not give an RTC output. I had to load the module explicitly in /etc/modules

Thanks for the hint with timedatectl, that led me on the right track.

Greetings

// Philipp