User Tools

Site Tools


1wireandraspicam

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
1wireandraspicam [10.08.2014 14:13]
andreas
1wireandraspicam [15.08.2014 13:37] (current)
andreas [Solving the issue, if it's bigger]
Line 13: Line 13:
 This is a known issue as it can be read [[https://​github.com/​raspberrypi/​linux/​issues/​435|here]]. It's related to an issue with the 1wire kernel module //​w1-gpio//,​ This module overwrites the setup of the I²C pins and prevents the access of the RaspberryPi camera, which is also using the I²C bus. This is a known issue as it can be read [[https://​github.com/​raspberrypi/​linux/​issues/​435|here]]. It's related to an issue with the 1wire kernel module //​w1-gpio//,​ This module overwrites the setup of the I²C pins and prevents the access of the RaspberryPi camera, which is also using the I²C bus.
 To solve this problem, it's just important to ensure the correct order, when which module is loaded. To solve this problem, it's just important to ensure the correct order, when which module is loaded.
 +\\ 
 +\\
 ===== Prerequisites ===== ===== Prerequisites =====
 You want to use the RaspberryPi Cam by using the mmal interface and you want to use the 1wire modules. If you e.g. want to take the temperature with an DS18S20 1wire temp sensor, then you get an error, you probably get the temp, but no cam pic anymore. You want to use the RaspberryPi Cam by using the mmal interface and you want to use the 1wire modules. If you e.g. want to take the temperature with an DS18S20 1wire temp sensor, then you get an error, you probably get the temp, but no cam pic anymore.
 +\\
 +\\
 ===== Preparation ===== ===== Preparation =====
 Fist update everything by calling Fist update everything by calling
Line 27: Line 30:
 sudo apt-get install i2c-tools sudo apt-get install i2c-tools
 </​code>​ </​code>​
 +
 +If you haven'​t had loaded your 1wire modules you can do that now by calling:
 +<code bash>
 +sudo modprobe w1-gpio
 +sudo modprobe w1-therm
 +</​code>​
 +
 +If you now want to test your I²C bus, you get the following errors, which prove, that the I²C bus is somehow disturbed:
 +<​code>​
 +pi@raspberrypi ~ $ sudo i2cdetect -y 0
 +Error: Could not open file `/​dev/​i2c-0'​ or `/​dev/​i2c/​0':​ No such file or directory
 +pi@raspberrypi ~ $ sudo i2cdetect -y 1
 +Error: Could not open file `/​dev/​i2c-1'​ or `/​dev/​i2c/​1':​ No such file or directory
 +</​code>​
 +\\
 ===== Solving the issue ===== ===== Solving the issue =====
 +
 +As said before, to get the error solved, it's just important to ensure the order how the modules will be loaded and this what has to be done.
 +
 +Therefore edit the **/​etc/​modules** with an editor of your coice and make it a least look like this one:
 +<​code>​
 +# /​etc/​modules:​ kernel modules to load at boot time.
 +#
 +# This file contains the names of kernel modules that should be loaded
 +# at boot time, one per line. Lines beginning with "#"​ are ignored.
 +# Parameters can be specified after the module name.
 +
 +wire
 +w1-gpio
 +w1-therm
 +i2c-bcm2708
 +i2c-dev
 +snd-bcm2835
 +</​code>​
 +
 +
 +Then ensure, that the modules **spi-bcm2708** and **i2c-bcm2708** are on the blacklist, so that they are not immediately loaded.
 +
 +<code bash>
 +pi@raspberrypi ~ $ cat /​etc/​modprobe.d/​raspi-blacklist.conf ​
 +# blacklist spi and i2c by default (many users don't need them)
 +
 +blacklist spi-bcm2708
 +blacklist i2c-bcm2708
 +</​code>​
 +
 +Finally make a reboot, so that all modules are loaded again:
 +<code bash>​sudo reboot</​code>​
 +
 +After that, you can verify your I²C bus again and you will get these promising results:
 +<​code>​
 +pi@raspberrypi ~ $ sudo i2cdetect -y 0
 +     ​0 ​ 1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
 +00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +30: -- -- -- -- -- -- 36 -- -- -- -- -- -- -- -- -- 
 +40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +70: -- -- -- -- -- -- -- --                         
 +pi@raspberrypi ~ $ sudo 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: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +70: -- -- -- -- -- -- -- --                         
 +</​code>​
 +\\
 +===== Solving the issue, if it's bigger =====
 +
 +__Important additional information:​__ Since the newest firmware (kernel 3.12.26+), the i2c-1 address 0x3b is now been taken over by the OS, this might result in an I²C bus result, with having the **UU** here:
 +
 +<​code>​
 +pi@raspberrypi ~ $ sudo i2cdetect -y 1
 +     ​0 ​ 1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
 +00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +30: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 
 +40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 +70: -- -- -- -- -- -- -- --                         
 +</​code>​
 +
 +UU means that probing was skipped, because this address is currently in use by a driver. This strongly suggests that there is a chip at this address, but in this case, it's an error.
 +
 +To fix this, you have to add two more modules to the blacklist (/​etc/​modprobe.d/​raspi-blacklist.conf),​ this finally has to look like this:
 +<​code>​
 +blacklist spi-bcm2708
 +blacklist i2c-bcm2708
 +blacklist snd-soc-bcm2708-i2s
 +blacklist snd_soc_wm8804
 +</​code>​
 +
 +Then reboot the Raspberry Pi and recheck the bus status, not it should be fixed and you get the same result as above with e.g. the 36 (but no UU anymore).
1wireandraspicam.1407672838.txt.gz · Last modified: 10.08.2014 14:13 by andreas