Wie aktiviere ich den SPI und/oder I2C Bus auf dem Raspberry Pi?
Einleitung:
In diesem FAQ wird beschrieben, wie der SPI bzw. I2C Bus des Raspberry Pi aktiviert wird.
Achtung! Diese Anleitung gilt nur für für Raspbian/Wheezy vor Kernel-Version 3.18.
Ab 3.18 ist der devicetree zu nutzen ( siehe -> hier <- ).
Vorgehen:
Root-Shell aufmachen:
Die Datei /etc/modules ändern:
Zitat
# /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.snd-bcm2835
~
für I2C: i2c-dev und i2c-bcm2708 einfügen, falls nicht bereits vorhanden:
ZitatAlles anzeigen
# /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.i2c-dev
i2c-bcm2708
snd-bcm2835
~
für SPI: spi-bcm2708 einfügen, falls nicht bereits vorhanden:
ZitatAlles anzeigen
# /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.spi-bcm2708
snd-bcm2835
~
oder gleich alle drei Zeilen entsprechend anpassen (für I2C und SPI).
Danach die Datei /etc/modprobe.d/raspi-blacklist.conf ändern:
Zitat
# blacklist spi and i2c by default (many users don't need them)blacklist spi-bcm2708
blacklist i2c-bcm2708
~
für I2C: blacklist i2c-bcm2708 auskommentieren
Zitat
# blacklist spi and i2c by default (many users don't need them)blacklist spi-bcm2708
#blacklist i2c-bcm2708
~
für SPI: blacklist spi-bcm2708 auskommentieren
Zitat
# blacklist spi and i2c by default (many users don't need them)#blacklist spi-bcm2708
blacklist i2c-bcm2708
~
oder eben wieder beide Einträge auskommentieren.
Root shell verlassen:
Jetzt kann das/können die Modul(e) testweise per Hand geladen werden. Dieser Ladevorgang wird durch den Eintrag in /etc/modules zukünftig bei jedem booten automatisch ausgeführt.
Für I2C:
Für SPI:
bye,
-ds-