fix i2c cannt auto load on raspbian lite os

This commit is contained in:
Baozhu Zuo 2018-02-16 16:01:47 +08:00
parent e2266a2791
commit b462e8a724
2 changed files with 10 additions and 2 deletions

View file

@ -20,7 +20,7 @@ marker="0.0.0"
apt update
apt-get -y install raspberrypi-kernel-headers raspberrypi-kernel
apt-get -y install dkms
apt-get -y install dkms git i2c-tools
# locate currently installed kernels (may be different to running kernel if
# it's just been updated)

View file

@ -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}')