-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 4505
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: [SOLVED] after yesterday's update the i2c clock doesn't
That seems unlikely, but not impossible. Did you do anything other than a software update between it working and not working? Have you tried setting the clock and rebooting?
Re: [SOLVED] after yesterday's update the i2c clock doesn't
No other changes, it worked, I updated, now it doesn't work.
Setting the clock and rebooting will always bring back 1970 now.
Is there an rpi-update command I can use to try an older kernel pre tree-change?
Setting the clock and rebooting will always bring back 1970 now.
Is there an rpi-update command I can use to try an older kernel pre tree-change?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 4505
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: [SOLVED] after yesterday's update the i2c clock doesn't
Yes. sudo rpi-update <git hash>, where you can get the hash for a revision from here: https://github.com/Hexxeh/rpi-firmware/commits/master
For the last pre-3.18, pre-device-tree kernel:
For the last pre-3.18, pre-device-tree kernel:
Code: Select all
sudo rpi-update f74b92120e0d469fc5c2dc85b2b5718d877e1cbb
Re: [SOLVED] after yesterday's update the i2c clock doesn't
Code: Select all
uname -a
Linux bjortjonn 3.12.36+ #737 PREEMPT Wed Jan 14 19:40:07 GMT 2015 armv6l GNU/Linux
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...
/dev/rtc0 does not have interrupt functions. Waiting in loop for time from /dev/rtc0 to change
...got clock tick
Time read from Hardware Clock: 2013/04/17 23:50:49
Hw clock time : 2013/04/17 23:50:49 = 1366242649 seconds since 1969
Thu 18 Apr 2013 01:50:49 CEST -0.821951 seconds
Code: Select all
date
Mon Mar 30 15:08:44 CEST 2015
sudo hwclock --rtc /dev/rtc0 --systohc
sudo hwclock --rtc /dev/rtc0 -r
Mon 30 Mar 2015 15:10:15 CEST -0.188787 seconds
Code: Select all
date
Mon Mar 30 15:12:59 CEST 2015
sudo hwclock --rtc /dev/rtc0 -r
Mon 30 Mar 2015 15:13:33 CEST -0.410315 seconds
Could it be related to the "interrupt" thing, or is that way off? "/dev/rtc0 does not have interrupt functions."
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 4505
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: [SOLVED] after yesterday's update the i2c clock doesn't
The message about it not having interrupt functions is because it is an I2C device - this isn't the cause of the problem. I have a PCF8523 running with a new kernel, and it also shows the same message when I run hwclock with --debug.
So, there are a few things you could try:
1) Make sure that you have correct /lib/udev/hwclock-set, then rpi-update again.
2) If that doesn't work, try adding "device_tree=" to your config.txt and rebooting, which will disable device tree. Then try the old method of configuring the RTC. If this works it will tell us that the problem is DT-related. If it doesn't, then it is probably a driver issue.
So, there are a few things you could try:
1) Make sure that you have correct /lib/udev/hwclock-set, then rpi-update again.
2) If that doesn't work, try adding "device_tree=" to your config.txt and rebooting, which will disable device tree. Then try the old method of configuring the RTC. If this works it will tell us that the problem is DT-related. If it doesn't, then it is probably a driver issue.
Re: [SOLVED] after yesterday's update the i2c clock doesn't
Same problem - something must be wrong with the 3.18 driver.
I also just now tried the latest hwclock from util-linux 2.26.1 as suggested elsewhere, and it does make a difference. hwclock now works!
With debug it gives the same error as before, but both -s and -r gives expected results.
What's different?
I also just now tried the latest hwclock from util-linux 2.26.1 as suggested elsewhere, and it does make a difference. hwclock now works!
Code: Select all
sudo hwclock --rtc /dev/rtc0 -r
Mon 30 Mar 2015 16:02:39 CEST .978874 seconds
sudo hwclock --rtc /dev/rtc0 -r --debug
hwclock from util-linux 2.26.1
Using the /dev interface to the clock.
Last drift adjustment done at 1427723960 seconds after 1969
Last calibration done at 1427723960 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
select() to /dev/rtc0 to wait for clock tick timed out...synchronization failed
What's different?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 4505
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: [SOLVED] after yesterday's update the i2c clock doesn't
The diff for hwclock.c back to the 2.20.1 release is 1275 lines, and even the commit log is 530 lines. If you feel adventurous you could use git bisect to narrow it down to a single commit, which may only take 9 or 10 builds.
Re: [SOLVED] after yesterday's update the i2c clock doesn't
I had a quick look into it, but then realised there's other things that doesn't work in 3.18 too (mjpeg-streamer with Logitech Quickcam Pro 9000) , so I'm just going to give it up and go with 3.12 for now.PhilE wrote:The diff for hwclock.c back to the 2.20.1 release is 1275 lines, and even the commit log is 530 lines. If you feel adventurous you could use git bisect to narrow it down to a single commit, which may only take 9 or 10 builds.
Re: [SOLVED] after yesterday's update the i2c clock doesn't
Worked like a charm (with one obvious appropriate change) for an A+ with a DS1307 !PhilE wrote: Try this:
1. Addto config.txt .Code: Select all
dtoverlay=i2c-rtc,pcf8563
2. Disable or remove the fake-hwlock.should do it.Code: Select all
dpkg --purge fake-hwclock
3. Edit /lib/udev/hwclock-set and change both occurrences of "--systz" to "--hctosys".
4. Delete /etc/adjtime .
5. Reboot.
+1
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
Re: [SOLVED] after yesterday's update the i2c clock doesn't
very helpful ... I never had this problem with raspbian .. in archlinux WHEN I UPGRADED via pacman -Su I lost my i2c and fstab had an entry for /root removed causing the disk to go into read only .. very confusing since I did fschecks and everything was fine .. .. back together again ..
in archlinux thre was a config.txt.pacnew which has everything there and I just had to uncomment the i2c stuff..
in archlinux thre was a config.txt.pacnew which has everything there and I just had to uncomment the i2c stuff..
-
- Posts: 9
- Joined: Mon Jul 20, 2015 5:05 pm
I killed the system
After added the devicetree lines to /boot/command.txt
my raspberry PI dont boot up.
I love all this wonderful tutorials.
my raspberry PI dont boot up.
I love all this wonderful tutorials.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 4505
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: after yesterday's update the i2c clock doesn't work (sol
Your post reads like a complaint - sarcasm rarely gets a good response.
If you are actually asking for help then you will need to provide more information. Examples of useful information include what you did (e.g. what software you started with, how you upgraded, the content of config.txt, etc.) and what you observed (output from the kernel or just a rainbow screen).
If you are actually asking for help then you will need to provide more information. Examples of useful information include what you did (e.g. what software you started with, how you upgraded, the content of config.txt, etc.) and what you observed (output from the kernel or just a rainbow screen).
Re: after yesterday's update the i2c clock doesn't work (sol
Hi!
I have tried to add the following to boot/config.txt as I have a Pi 2 B+
device_tree=bcm2708-rpi-b-plus.dtb
device_tree_param=i2c1=on
device_tree_param=spi=on
But I think I have made an error and now the Pi wont boot up! How can I rescue this without factory resetting and loosing my work :S
I have tried to add the following to boot/config.txt as I have a Pi 2 B+
device_tree=bcm2708-rpi-b-plus.dtb
device_tree_param=i2c1=on
device_tree_param=spi=on
But I think I have made an error and now the Pi wont boot up! How can I rescue this without factory resetting and loosing my work :S
Re: after yesterday's update the i2c clock doesn't work (sol
Can you plug the Sd card in another pc and modify the file?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 4505
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: after yesterday's update the i2c clock doesn't work (sol
If you can edit config.txt then delete:
It is the wrong dtb for a Pi2. The firmware will automatically load the correct one, and as you have found, setting it manually has its pitfalls. Next change i2c1 to I2c_arm, since that is more portable. Then try booting.
You might want to read https://www.raspberrypi.org/documentati ... ce-tree.md for some background.
Code: Select all
device_tree=bcm2708-rpi-b-plus.dtb
You might want to read https://www.raspberrypi.org/documentati ... ce-tree.md for some background.
Re: after yesterday's update the i2c clock doesn't work (sol
Thanks for the reply..
I wiped the Pi in the end as I couldn't access the config file from my pc.
Anyhow, I still have the same issue I started with. When I try to run 'gpio load i2c', I get an error saying
file not present /dev/i2c-0.
Here is my auto generated setting from my config file...What do I need to add/remove?
Thanks for your support.
I wiped the Pi in the end as I couldn't access the config file from my pc.
Anyhow, I still have the same issue I started with. When I try to run 'gpio load i2c', I get an error saying
file not present /dev/i2c-0.
Here is my auto generated setting from my config file...What do I need to add/remove?
Code: Select all
# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1
config_hdmi_boost=4
overscan_left=24
overscan_right=24
overscan_top=16
overscan_bottom=16
disable_overscan=0
device_tree=
Thanks for your support.
Re: after yesterday's update the i2c clock doesn't work (sol
Oh I assume I have a PI 2 b+, it says on the PI ' Model B VI.I
Thanks
Thanks
- DougieLawson
- Posts: 42154
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: after yesterday's update the i2c clock doesn't work (sol
Get rid of that device_tree= null line. That's going to stop a whole lot of hardware from working.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: after yesterday's update the i2c clock doesn't work (sol
Ok I removed the tree line and then re-enabled i2c and SPI and I still get
file not present /dev/i2c-0.
file not present /dev/i2c-0.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 4505
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: after yesterday's update the i2c clock doesn't work (sol
You shouldn't be accessing /dev/i2c-0 on a Pi 2 - it's reserved for the camera and other peripherals that the GPU controls.
Also, In order for /dev/i2c-0 and /dev/i2c-1 to be available, the i2c-dev module must be loaded. This isn't something that Device Tree can do (well, it's not supposed to...), so just add it to /etc/modules.
But that doesn't explain why this gpio utility is trying to use i2c-0. Doesn't it have a command line parameter (like i2c-detect -y 1) to choose an I2C bus?
Also, In order for /dev/i2c-0 and /dev/i2c-1 to be available, the i2c-dev module must be loaded. This isn't something that Device Tree can do (well, it's not supposed to...), so just add it to /etc/modules.
But that doesn't explain why this gpio utility is trying to use i2c-0. Doesn't it have a command line parameter (like i2c-detect -y 1) to choose an I2C bus?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 4505
- Joined: Mon Sep 29, 2014 1:07 pm
- Location: Cambridge
Re: after yesterday's update the i2c clock doesn't work (sol
Ah, if you are using "gpio load i2c" to cause the kernel module to be loaded (I found the documenation), don't - Device Tree will do that automatically for you provided you have enabled the underlying interface, and that is what "dtparam=i2c_arm=on" does for you.
Re: after yesterday's update the i2c clock doesn't work (sol
According to the /etc/moddules file, the i2c-dev module is loaded.
I am trying to do this project: http://www.stuff.tv/features/how-build- ... thermostat and within 'configure raspberry PI' section, I need to Enable SPI and i2C protocols.
How can I get around this issue? Do I need to do something different to enable the i2c protocol as I have a Pi 2 B +? Or can I assume it is running even though 'GPIO load i2c' returns this missing file error?
Appreciate your support!
I am trying to do this project: http://www.stuff.tv/features/how-build- ... thermostat and within 'configure raspberry PI' section, I need to Enable SPI and i2C protocols.
How can I get around this issue? Do I need to do something different to enable the i2c protocol as I have a Pi 2 B +? Or can I assume it is running even though 'GPIO load i2c' returns this missing file error?
Appreciate your support!
- DougieLawson
- Posts: 42154
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: after yesterday's update the i2c clock doesn't work (sol
Can you run an lsmod (ell,ess,emm,oh,dee) command and post the results?
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: after yesterday's update the i2c clock doesn't work (sol
I cannot get this command to work? Google auto corrected to insmod and this still chucked an error?
- DougieLawson
- Posts: 42154
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: after yesterday's update the i2c clock doesn't work (sol
It's ls (list) mod (modules) and it will show you what's loaded. It doesn't even need root privileges.
turn off auto-correct because it's clearly insane.
Code: Select all
pi@aplus ~ $ lsmod
Module Size Used by
rpcsec_gss_krb5 22276 0
ctr 4001 1
ccm 8278 1
arc4 1972 2
rt2800usb 18832 0
rt2800lib 81962 1 rt2800usb
rt2x00usb 11918 1 rt2800usb
rt2x00lib 47910 3 rt2x00usb,rt2800lib,rt2800usb
mac80211 622304 3 rt2x00lib,rt2x00usb,rt2800lib
cfg80211 499834 2 mac80211,rt2x00lib
crc_ccitt 1620 1 rt2800lib
rfkill 22491 2 cfg80211
spi_bcm2835 7948 0
bcm2835_gpiomem 3703 0
uio_pdrv_genirq 3690 0
uio 10002 1 uio_pdrv_genirq
bcm2708_rng 1220 0
i2c_bcm2708 6252 0
i2c_dev 6730 0
snd_bcm2835 22317 0
snd_pcm 92581 1 snd_bcm2835
snd_timer 23454 1 snd_pcm
snd 68161 3 snd_bcm2835,snd_timer,snd_pcm
fuse 91981 1
ipv6 360374 56
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.