On Thu, Jul 27, 2017 at 4:24 PM, William B <wbbena...@gmail.com> wrote:

> Is there any other difference in this latest version of Debian? I'm
> following a tutorial below, but the command "hwclock -r -f /dev/rtc1" is
> indicating failure to communicate with the new device:
>
> *TUTORIAL*:
> https://learn.adafruit.com/adding-a-real-time-clock-to-
> beaglebone-black/set-rtc-time
>
> *ERROR*:
> root@beaglebone:~# hwclock -r -f /dev/rtc1
> hwclock: Cannot access the Hardware Clock via any known method.
>
> *DEVICES*:
> root@beaglebone:/# ls -la /sys/bus/i2c/devices
> total 0
> drwxr-xr-x 2 root root 0 Jul 27 20:19 .
> drwxr-xr-x 4 root root 0 Jul 27 20:19 ..
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 0-0024 ->
> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 0-0034 ->
> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0034
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 0-0050 ->
> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0050
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 0-0070 ->
> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0/0-0070
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 2-0054 ->
> ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0054
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 2-0055 ->
> ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0055
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 2-0056 ->
> ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0056
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 2-0057 ->
> ../../../devices/platform/ocp/4819c000.i2c/i2c-2/2-0057
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 i2c-0 ->
> ../../../devices/platform/ocp/44e0b000.i2c/i2c-0
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 i2c-1 ->
> ../../../devices/platform/ocp/4802a000.i2c/i2c-1
> lrwxrwxrwx 1 root root 0 Jul 27 20:19 i2c-2 ->
> ../../../devices/platform/ocp/4819c000.i2c/i2c-2
>
>
You have to write to the RTC before you can read from it. Something that
guide confuses . . . So actually the first steps you need to take is like
this:
root@wgd:~# apt-get install ntpdate
root@wgd:~# ntpdate pool.ntp.org
27 Jul 16:39:29 ntpdate[1903]: adjust time server 199.223.248.101 offset
0.004123 sec

Then if it's important to be on the right timezone . . .
( optional )
root@wgd:~# dpkg-reconfigure tzdata

Current default time zone: 'America/Phoenix'
Local time is now:      Thu Jul 27 16:40:54 MST 2017.
Universal Time is now:  Thu Jul 27 23:40:54 UTC 2017.

Then you can write to the RTC:
root@wgd:~# hwclock -w -f /dev/rtc1

So what all this does is update the system time, configures the timezone,
so that system time can be written to the real time clock. You could in
fact just write to the real time clock without doing all the above. But the
RTC will not be accurate.

Now we should be able to read from the RTC.
root@wgd:~# hwclock -r -f /dev/rtc1
Thu Jul 27 16:45:41 2017  -0.646341 seconds

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORrR4sni%2BWPaRymd8POvkfkdJwwwgS0FZy9Z7zPuPLjzTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to