Raspberry + Hifiberry + RTC

  • Hello,


    I am configuring LibreELEC (9.0.2) for a media center project that is progressing well (Raspberry Pi + HifiBerry Dac+ + DS3231SN RTC module in a recycled iMac).


    However, I have a little problem, this media center will never be connected to the Internet for good reason, I live in a home that is not connected to any network (except a little sharing of 4G connection on my smartphone), so I have a little problem with the time that is not kept by the Raspberry.


    So I would like to be able to configure all these devices.


    For the Hifiberry, no problem, it can be configured in Kodi, but for the RTC, it's another story.


    In "/flash/overlays", I crossed some modules that interest me:

    - hifiberry-dacplus.dtbo

    - i2c-rtc-gpio.dtbo

    - i2c-rtc.dtbo

    - spi-rtc.dtbo


    Which RTC module should be added to config.txt?

    Do I have to put the HifiBerry module back in?

    Won't there be a conflict between the two? (and how to possibly counter them?)


    Thank you in advance for your help!

  • Thanks Da Flex for the help, after a few adventures, I finally managed to have a module that works perfectly, so I share the method:

    I have added both modules in config.txt :

    Code
    dtoverlay=hifiberry-dacplus
    dtoverlay=i2c-rtc

    Then connected my raspberry pi to the internet to get a precise date thanks to NTP.

    I then ran the following command:

    Code
    echo ds3231 0x68 | tee /sys/class/i2c-dev/i2c-1/device/new_device
    hwclock -w

    I finally created the file /storage/.config/autostart.sh with the following commands:

    Code
    (
     echo ds3231 0x68 | tee /sys/class/i2c-dev/i2c-1/device/new_device;
     /sbin/hwclock -u -s;
    ) &
    
    nohup script.sh &

    Finally, by SSH, make the file executable:

    Code
    chmod +x /storage/.config/autostart.sh

    After the reboot and even without internet, I keep a correct time.

    Edited once, last by MrSoul (March 2, 2020 at 4:10 PM).

  • I'm sorry I'm only answering now, I didn't see your answer.

    No, I did not solder the RTC module to the DAC, I soldered a new row of pins on the parallel GPIO port of the HifiBerry and connected it with wires.