[SOLVED] [Raspberry_Pi] RTC Clock Support?

July 31st, 2013

Home Forums Feedback [SOLVED] [Raspberry_Pi] RTC Clock Support?

This topic contains 5 replies, has 2 voices, and was last updated by  Linux_Guy 1 year, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6621

    Linux_Guy
    Member

    Hello, and again thank you for porting to the Raspberry Pi.
    Is there any way to get a kernel build that will support a Real Time Clock (RTC)?
    I have a pcf2127a clock and would love to make it work instead of the ntp.
    The npt requests are filling my firewall logs in my router-server (Smoothwall.org).
    I had built a kernel module for the RTC for rasbian, but I don’t see any provision for
    the module under /lib/modules/3.6.1.1/kernel/driver/. Am I missing something?

    Thanks.
    LG

    #6622

    Warped Rudi
    Moderator

    We recently added support for this module. It features a PCF2129A in I2C mode (address 0x51). If the PCF2127A on your module is also connected to I2C (and not to SPI), you might want to try snapshot r16285 or later. With this, the “hwclock” command on the console should work. In order to let the system make use of that you need to run “systemctl unmask hwclock-sync” once.

    BTW, which kernel module did you use on Raspbian ?

    • This reply was modified 1 year, 2 months ago by  Warped Rudi.
    #6644

    Linux_Guy
    Member

    I am currently running r16294.
    The RTC kernel module I built from the latest rpi-3.6.y source (3.6.1.1) from Raspberry Pi
    (https://github.com/raspberrypi/linux/archive/rpi-3.6.y.tar.gz)
    I have the RTC connected via I2C.
    The RTC is from ModMyPi….they got it from:
    http://afterthoughtsoftware.com/products/rasclock

    instead of downloading a new image for the kernel, I built the module and inmod
    as was suggested in one of the replies by user OE3SUW. There was an error with his instructions
    however another user had a one line fix.
    The RTC ran fine under raspbian. and I could see there were many kernel modules in the rtc directory
    (/lib/modules/3.6.1.1/kernel/driver/rtc), however i don’t have an rtc directory using geexbox.
    I am assuming the rtc was never built for it.

    Thank you for your reply.

    #6646

    Warped Rudi
    Moderator

    Since the only difference between the PCF2129A and PCF2127A appears to be the lack/presence of 512 bytes of battery-backed RAM, your device should work with the kernel we supply in r16294 “out of the box”. I.e. no need to compile anything. There are no modules in the rtc directory, because the one and only RTC driver we have configured (i.e. AbioRTC/PCF2129) is built directly into the kernel. It *should* auto-detect the device no matter which revision of the RPi hardware is used.

    Did you check, if your RTC is recognized ? I.e. run “hwclock” from a console (telnet, ssh or serial) ? Does /sys/class/rtc/rtc0 exist ?

    #6649

    Linux_Guy
    Member

    I had time this morning to run the “systemctl unmask hwclock-sync” and “hwclock’. I set the date and used hwclock to set the hardware time.
    now for the silly question, I was under the impression that I should see the rtc module when I typed lsmod.
    but I don’t see it listed. How can I be sure it is there?

    LG

    #6651

    Linux_Guy
    Member

    Sorry I missed your last post, yes it is there.
    rtc0 -> ../../devices/platform/bcm2708_i2c.1/i2c-1/1-0051/rtc/rtc0
    so I guess it is working.
    I was put off a bit by the seconds column being all zeros.
    “Wed Jul 31 04:45:01 2013 0.000000 seconds”
    as on the raspbian build I have it shows numbers in the seconds columns.
    “Wed Jul 31 04:39:20 2013 0.231923 seconds”

    Thank you for you help and explaining it to me, even after using Linux for 15 years,
    I can still learn new tricks. I am still having fun.

    I guess we can mark this as solved.

    LG

    • This reply was modified 1 year, 2 months ago by  Linux_Guy.
    • This reply was modified 1 year, 2 months ago by  Linux_Guy. Reason: grammatical corrections
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Comments are closed.