From b462e8a724573bec45d387cfea06a9774751d251 Mon Sep 17 00:00:00 2001 From: Baozhu Zuo Date: Fri, 16 Feb 2018 16:01:47 +0800 Subject: [PATCH] fix i2c cannt auto load on raspbian lite os --- install.sh | 4 ++-- seeed-voicecard | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 59c8af0..ad19be4 100755 --- a/install.sh +++ b/install.sh @@ -19,8 +19,8 @@ ver="0.3" marker="0.0.0" apt update -apt-get -y install raspberrypi-kernel-headers raspberrypi-kernel -apt-get -y install dkms +apt-get -y install raspberrypi-kernel-headers raspberrypi-kernel +apt-get -y install dkms git i2c-tools # locate currently installed kernels (may be different to running kernel if # it's just been updated) diff --git a/seeed-voicecard b/seeed-voicecard index e988982..38bd5df 100755 --- a/seeed-voicecard +++ b/seeed-voicecard @@ -22,6 +22,14 @@ set -x exec 1>/var/log/$(basename $0).log 2>&1 +#enable i2c interface +dtparam i2c_arm=on +modprobe i2c-dev + +#enable spi interface +dtparam spi=on +sleep 1 + is_1a=$(i2cdetect -y 1 0x1a 0x1a | grep 1a | awk '{print $2}')