From 8f0c187c8fa79398e42c352b39df0d9f2f1a3abe Mon Sep 17 00:00:00 2001 From: arfrie22 <43021241+arfrie22@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:39:00 -0400 Subject: [PATCH] make sure raspi-config is there to enable i2c --- build.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index c7bea7a4..8fbd108a 100755 --- a/build.sh +++ b/build.sh @@ -2,9 +2,14 @@ set -e function enable_i2c { - sudo raspi-config nonint do_i2c 0 - sudo dtparam i2c_baudrate=400000 - sudo modprobe i2c-dev + if command -v raspi-config &> /dev/null; then + echo "Enabling i2c" + sudo raspi-config nonint do_i2c 0 + sudo dtparam i2c_baudrate=400000 + sudo modprobe i2c-dev + else + echo "Can not automatically enable i2c you might have to do this manually" + fi } DEBUG=""