Raspberry Pi hardware real-time-clock?

roger peppe roger.peppe at canonical.com
Fri Dec 30 13:52:34 UTC 2016


On 29 December 2016 at 19:15, roger peppe <roger.peppe at canonical.com> wrote:
> It seems to work well, with one caveat: for about a minute after rebooting,
> the time is wrong - it becomes correct eventually:

I spoke too soon - I'm not seeing the clock updated from the RTC any more,
however long I wait.

For some reason it seems to like 17:37 on 26th December - it seems to
return to that time when rebooted.

The value in the RTC device is correct AFAICS.

Some things that may or may not be relevant: the hwclock command says
it can't find the rtc device:

    # hwclock --debug
    hwclock from util-linux 2.27.1
    hwclock: cannot open /dev/rtc: No such file or directory
    No usable clock interface found.
    hwclock: Cannot access the Hardware Clock via any known method.

A couple of lines in /var/log/kern.log mention "rtc":

    Dec 26 17:37:01 localhost kernel: [    0.000000] Kernel command
line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656
bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa01041
bcm2709.serial=0x1917350 smsc95xx.macaddr=B8:27:EB:91:73:50
bcm2708_fb.fbswap=1 bcm2709.uart_clock=3000000
bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0
vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty0
elevator=deadline root=/dev/disk/by-label/writable net.ifnames=0
init=/lib/systemd/systemd ro panic=-1 fixrtc snap_core=core_645.snap
snap_kernel=pi2-kernel_22.snap
    Dec 26 17:37:01 localhost kernel: [    6.560643] hctosys: unable
to open rtc device (rtc0)

Any ideas?

FWIW time keeping is particularly important for my application as it's
acting as a time clock for
a household's electricity supply.

  cheers,
    rog.




More information about the Snapcraft mailing list