User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

after yesterday's update the i2c clock doesn't work (solved)

Wed Jan 21, 2015 5:05 am

Hello

I did an update yesterday

Code: Select all

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
$ sudo rpi-update
and rebooted the system

Like usually I did

Code: Select all

$ sudo hwclock
but I got

Code: Select all

hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
so

Code: Select all

$ sudo i2cdetect -y 0
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory
$ sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory
$ lsmod
Module                  Size  Used by
fuse                   92153  3
tun                    20798  2
w1_therm                3325  0
w1_gpio                 4068  0
wire                   31280  2 w1_gpio,w1_therm
cn                      5756  1 wire
rtc_ds1307              9868  0
i2c_dev                 6709  0
i2c_bcm2708             6004  0
snd_bcm2835            21342  0
sg                     21787  0
snd_usb_audio         127474  0
snd_hwdep               6545  1 snd_usb_audio
snd_usbmidi_lib        22236  1 snd_usb_audio
snd_seq_midi            5037  0
snd_seq_midi_event      7831  1 snd_seq_midi
snd_rawmidi            23955  2 snd_usbmidi_lib,snd_seq_midi
snd_pcm                93100  2 snd_bcm2835,snd_usb_audio
snd_seq                61097  2 snd_seq_midi_event,snd_seq_midi
snd_seq_device          7209  3 snd_seq,snd_rawmidi,snd_seq_midi
snd_timer              23007  2 snd_pcm,snd_seq
snd                    67211  9 snd_bcm2835,snd_usb_audio,snd_hwdep,snd_timer,snd_pcm,snd_seq,snd_rawmidi,snd_usbmidi_lib,snd_seq_device
evdev                  11000  2
joydev                  9766  0
uio_pdrv_genirq         3666  0
uio                     9897  1 uio_pdrv_genirq
uas                    15604  0
Last edited by Onira on Wed Jan 21, 2015 6:24 am, edited 1 time in total.
Cogito ergo sum

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: after yesterday's update the i2c clock doesn't work anym

Wed Jan 21, 2015 5:15 am

Surprise!

http://www.raspberrypi.org/forums/viewt ... 29&t=97216

I got around the problem I was seeing by adding "device_tree=" in /boot/config.txt

Section 4.3 in the documentation here:
https://github.com/raspberrypi/document ... ce-tree.md

YMMV

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: after yesterday's update the i2c clock doesn't work anym

Wed Jan 21, 2015 5:32 am

didn't help or did I do something wrong?

Code: Select all

$ dmesg | grep i2c
[   12.946174] i2c /dev entries driver
$ sudo i2cdetect -y 1
Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory
$ sudo i2cdetect -y 0
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory
$ sudo hwclock
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
$ cat /boot/cmdline.txt
#dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
dwc_otg.lpm_enable=0 console=ttyUSB0,115200 kgdboc=ttyUSB0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
device_tree=
Cogito ergo sum

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: after yesterday's update the i2c clock doesn't work anym

Wed Jan 21, 2015 5:34 am

It should be in /boot/config.txt

I think you added it to /boot/cmdline.txt

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: after yesterday's update the i2c clock doesn't work anym

Wed Jan 21, 2015 6:20 am

I'm sooo silly :P

Code: Select all

$ sudo hwclock
śro, 21 sty 2015, 07:17:31  -0.878636 seconds
dispalaying in polish 'cos I'm PL
LANG=C doesn't change

Thank you ame
Cogito ergo sum

User avatar
DougieLawson
Posts: 35811
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 8:46 am

Model A & B users should add this to /boot/config.txt

Code: Select all

device_tree=bcm2708-rpi-b.dtb
device_tree_param=i2c1=on
device_tree_param=spi=on
Model A+ & B+ users should add this

Code: Select all

device_tree=bcm2708-rpi-b-plus.dtb
device_tree_param=i2c1=on
device_tree_param=spi=on
Reboot and SPI & I2C will work in the way they did with 3.12.35+

The problem is that folks got in the bad habit of running sudo rpi-update when they don't need to push the kernel/firmware forwards to the leading edge of the RPF's development version.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 8:53 am

DougieLawson
But what is the difference between adding "device_tree=" or those lines you mentioned?

Bad habbits are major human diseases ;)
Cogito ergo sum

User avatar
rpdom
Posts: 15005
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 9:43 am

Onira wrote:But what is the difference between adding "device_tree=" or those lines you mentioned?
Adding "device_tree=" disables the new method and forces it to run the old way.

Adding the other lines will correctly set up the new method.

User avatar
Onira
Posts: 233
Joined: Tue Oct 02, 2012 6:24 pm
Location: Poland

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 9:50 am

Now I understand :)
Cogito ergo sum

User avatar
DougieLawson
Posts: 35811
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 9:54 am

Onira wrote: But what is the difference between adding "device_tree=" or those lines you mentioned?
One embraces the new technology. The other disables it.

Device tree is the future, so if you can get your system running with it you should use it. Moving forwards and solving problems as we meet them is better in the long run than taking a retrograde step and sticking with something that "works for me".
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 1:56 pm

I often wonder why rpi-update is installed by default in recent versions of Raspbian, it was nice and safe hidden away in github and the 2 people who actually needed it could install it. Its a complete waste of time (or in this case worse) for 99.9% of Pi users.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2316
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 1:59 pm

I would argue it gives us another tier of testing, before a release hits the real mainstream.

User avatar
blachanc
Posts: 456
Joined: Sat Jan 26, 2013 5:03 am
Location: Quebec,canada(french)

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 2:05 pm

PhilE wrote:I would argue it gives us another tier of testing, before a release hits the real mainstream.
Agreed,
but a call for beta testers would cover this, and keep regular users from using the command without understanding what it will achieve.

maybe sudo rpi-update should output a warning like:
"you are leaving the main path to the equivalent of nightly builds, are you sure you want to do this ?" (I know, I am exaggerating a bit ;) )

Ben
Autism/Asperger syndrome: what is your score on this quiz?
http://www.raspberrypi.org/forums/viewtopic.php?f=62&t=70191

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 2:06 pm

Maybe it should be made a lot clearer in the program that it is completely unnecessary and can break things.

Standard users should not be used as unwitting beta-testers. Leave on github, for those who do want to be and understand the implications of being a beta-tester.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

User avatar
DougieLawson
Posts: 35811
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 2:19 pm

PhilE wrote:I would argue it gives us another tier of testing, before a release hits the real mainstream.
Testing in the field is a very risky operation that's 100% guaranteed to upset some folks.

The problem is that the rpi-update genie is out of the bottle. The update-meme throught "morphic resonance" has lead to folks thinking it's a requirement as part of their update/upgrade process.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

milhouse
Posts: 636
Joined: Mon Jan 16, 2012 12:59 pm

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 3:50 pm

Perhaps there should be a "release" thread - no discussion - with details of the changes (and potential problems/solutions) for each release, described in such a way that the user can quickly determine the changes that have occurred since their current kernel was installed.

Display the url of this release thread whenever rpi-update is run, and quiz the user to enter a randomly selected word from the first post (Manic Miner style) to confirm the release thread has been accessed and ideally, read and understood, with all consequences accepted. :)

Being able to run rpi-update is useful, but being able to run it when totally unprepared for the potential consequences is simply asking for trouble.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5879
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 4:01 pm

milhouse wrote:Perhaps there should be a "release" thread - no discussion - with details of the changes (and potential problems/solutions) for each release, described in such a way that the user can quickly determine the changes that have occurred since their current kernel was installed.

Display the url of this release thread whenever rpi-update is run, and quiz the user to enter a randomly selected word from the first post (Manic Miner style) to confirm the release thread has been accessed and ideally, read and understood, with all consequences accepted. :)

Being able to run rpi-update is useful, but being able to run it when totally unprepared for the potential consequences is simply asking for trouble.
That would just be duplicating what's already on github though. https://github.com/raspberrypi/firmware/commits/master

milhouse
Posts: 636
Joined: Mon Jan 16, 2012 12:59 pm

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 4:35 pm

ShiftPlusOne wrote:That would just be duplicating what's already on github though. https://github.com/raspberrypi/firmware/commits/master
True, and while there are users here who read and understand what is posted on github, there are a lot more that don't. However the main point of my post was to somehow ensure the user had read and understood the changes they were about to apply. You could use github for that too, but a single forum thread might be easier to "digest", perhaps even worded using slightly less "techy" language.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2316
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Wed Jan 21, 2015 4:53 pm

FYI, there is a new post explaining the Device Tree changes here: http://www.raspberrypi.org/forums/viewt ... 29&t=97314

subnet
Posts: 39
Joined: Wed Dec 26, 2012 10:30 pm

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Sun Jan 25, 2015 9:02 pm

DougieLawson wrote: The problem is that folks got in the bad habit of running sudo rpi-update when they don't need to push the kernel/firmware forwards to the leading edge of the RPF's development version.
I totally agree (especially referring to me). Almost every time I launch rpi-update I have a problem (in this case with i2c, but solved thanks to this post).
I promise I will not do it again:-)

many thanks

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Mon Jan 26, 2015 12:09 am

[rant]
Whoever put rpi-update into standard raspbian wants hanging by the thumbs. It should have remained an obscure curio languishing on github for the 2 people who actually need it. Its become an endemic plague since.

Some appear to think its the only way of upgrading the Pi's "firmware" (it doesn't have firmware in the first place, which is one of its greatest assets IMO). Firmware is somewhere between easily changed software and not so easily changed hardware, The Pi has software of a slightly different ilk and a hardwired bit in the GPU......
[/rant]
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2316
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Mon Mar 30, 2015 9:59 am

[ This was the answer to a post that was deleted while I was writing this ]

Try this:
1. Add

Code: Select all

dtoverlay=i2c-rtc,pcf8563
to config.txt .
2. Disable or remove the fake-hwclock.

Code: Select all

dpkg --purge fake-hwclock
should do it.
3. Edit /lib/udev/hwclock-set and change both occurrences of "--systz" to "--hctosys".
4. Delete /etc/adjtime .
5. Reboot.

More details on the RTC issue: http://www.raspberrypi.org/forums/viewt ... 92#p690492
More details on Device Tree: http://www.raspberrypi.org/forums/viewt ... 28&t=97314

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Mon Mar 30, 2015 11:28 am

Thanks, PhilE!

I'm a stickler for getting stuff in the right place, guess I missed the mark this time :)

Unfortunately the fixes doesn't work - the problem seems to be with hwclock itself, not the parameters passed to it.

While the I2C looks just fine:

Code: Select all

i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- 6a 6b -- -- -- --
70: -- -- -- -- -- -- -- --

Code: Select all

[    6.331210] rtc-pcf8563 1-0051: chip found, driver version 0.4.3
[    6.598646] rtc-pcf8563 1-0051: rtc core: registered rtc-pcf8563 as rtc0
Any command sent by hwclock will give timeout:

Code: Select all

sudo hwclock --rtc /dev/rtc0 -r
hwclock: select() to /dev/rtc0 to wait for clock tick timed out: Success

sudo hwclock --rtc /dev/rtc0 --hctosys
hwclock: select() to /dev/rtc0 to wait for clock tick timed out: Success

sudo hwclock --rtc /dev/rtc0 --systohc
hwclock: select() to /dev/rtc0 to wait for clock tick timed out: Success

sudo hwclock --rtc /dev/rtc0 -r --debug
hwclock from util-linux 2.20.1
Using /dev interface to clock.
Last drift adjustment done at 1427714563 seconds after 1969
Last calibration done at 1427714563 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
hwclock: select() to /dev/rtc0 to wait for clock tick timed out: Success
...synchronization failed
And I am stuck in 1970 every reboot.
This is an offgrid RPi that doesn't have any other way of keeping time and turns on and off according to ambient light levels - so RTC operation is essential :)

This exact setup has served me for a couple of years now, but with the new kernel I just cannot bring it back. Could it be that hwclock no longer works as it should with the new kernel? See http://www.raspberrypi.org/forums/viewt ... 8&p=688215 and http://www.raspberrypi.org/forums/viewt ... 50#p729850

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2316
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Mon Mar 30, 2015 11:42 am

Strange. Try unloaded the driver module (sudo rmmod rtc_pcf8563) and dumping the device:

Code: Select all

sudo i2cdump -y 1 0x51
On a pcf8523 I get output like this:

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 86 16 08 51 36 11 30 01 03 15 80 80 80 80 00 00    ???Q6?0???????..
10: 07 00 07 6e 00 47 00 00 00 00 00 00 00 00 00 00    ?.?n.G..........
20: 86 16 08 51 36 11 30 01 03 15 80 80 80 80 00 00    ???Q6?0???????..
30: 07 00 07 6e 00 47 00 00 00 00 00 00 00 00 00 00    ?.?n.G..........
...
You can see the time (11:36:51) and date (30/03/15) in little-endian BCD format in there if you look carefully.

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: [SOLVED] after yesterday's update the i2c clock doesn't

Mon Mar 30, 2015 12:09 pm

Code: Select all

sudo i2cdump -y 1 0x51
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
10: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
20: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
30: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
40: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
50: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
60: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
70: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
80: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
90: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
a0: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
b0: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
c0: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
d0: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
e0: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
f0: 08 40 46 11 41 41 44 41 70 09 01 01 04 c4 47 60    ?@F?AADAp?????G`
is it broken?

Return to “Troubleshooting”