From df50620f3abca0978e5f35cd103ac85fca090c2f Mon Sep 17 00:00:00 2001 From: nebhead Date: Wed, 1 May 2024 19:33:13 -0700 Subject: [PATCH] v1.7.1 Hot Fix for Raspberry Pi OS Bookworm Raspberry Pi OS Bookworm moves the config.txt from /boot to /boot/firmware which can cause issues with a fresh installation (and when enabling certain features). This should resolve the issue in the initial installation script. --- auto-install/install.sh | 13 +++++++++---- updater/post-update-message.html | 5 ++++- updater/updater_manifest.json | 4 ++-- wizard/ds18b20.sh | 10 ++-------- wizard/pwm_rpi_platform.sh | 14 ++++++++++---- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/auto-install/install.sh b/auto-install/install.sh index 4e385980..d36411cc 100644 --- a/auto-install/install.sh +++ b/auto-install/install.sh @@ -146,12 +146,17 @@ echo "** **" echo "*************************************************************************" # Enable SPI - Needed for some displays -echo "dtparam=spi=on" | $SUDO tee -a /boot/config.txt > /dev/null +$SUDO raspi-config nonint do_spi 0 + # Enable I2C - Needed for some displays, ADCs, distance sensors -echo "dtparam=i2c_arm=on" | $SUDO tee -a /boot/config.txt > /dev/null -echo "i2c-dev" | $SUDO tee -a /etc/modules > /dev/null +$SUDO raspi-config nonint do_i2c 0 + # Enable Hardware PWM - Needed for hardware PWM support -echo "dtoverlay=pwm,pin=13,func=4" | $SUDO tee -a /boot/config.txt > /dev/null +if test -f /boot/firmware/config.txt; then + echo "dtoverlay=pwm,gpiopin=13,func=4" | $SUDO tee -a /boot/firmware/config.txt > /dev/null +else + echo "dtoverlay=pwm,gpiopin=13,func=4" | $SUDO tee -a /boot/config.txt > /dev/null +fi # Setup backlight / power permissions if a DSI screen is installed clear diff --git a/updater/post-update-message.html b/updater/post-update-message.html index d01799fe..41e60721 100644 --- a/updater/post-update-message.html +++ b/updater/post-update-message.html @@ -1,7 +1,7 @@

- PiFire 1.7.0 Release - May 2024 + PiFire 1.7.1 Release - May 2024

@@ -164,6 +164,9 @@

  • MQTT Bug Fixes contributed by @ericpalmquist
  • +
  • + Hot fix for fresh install with Raspberry Pi OS Bookworm where config.txt has moved to /boot/firmware/ +
  • diff --git a/updater/updater_manifest.json b/updater/updater_manifest.json index e0d9d8e3..6f310278 100644 --- a/updater/updater_manifest.json +++ b/updater/updater_manifest.json @@ -1,10 +1,10 @@ { "metadata" : { "versions" : { - "server" : "1.7.0", + "server" : "1.7.1", "cookfile" : "1.5.0", "recipe" : "1.0.0", - "build" : 57 + "build" : 58 }, "update_notes" : "", "update_warnings" : "" diff --git a/wizard/ds18b20.sh b/wizard/ds18b20.sh index 84d67c2b..a4e3f677 100644 --- a/wizard/ds18b20.sh +++ b/wizard/ds18b20.sh @@ -1,8 +1,2 @@ -# This file will add the kernel support for 1-wire on pin 31 (GPIO 6) - -if grep -wq "dtoverlay=w1-gpio,gpiopin=6,pullup=\"y\"" /boot/config.txt; then - echo "1-Wire enabling already exists in /boot/config.txt" -else - echo "Adding 1-Wire support in /boot/config.txt" - echo "dtoverlay=w1-gpio,gpiopin=6,pullup=\"y\"" | sudo tee -a /boot/config.txt > /dev/null -fi \ No newline at end of file +# This file will add the kernel support for 1-wire on (GPIO 4) +sudo raspi-config nonint do_onewire 0 # Enable 1-wire support \ No newline at end of file diff --git a/wizard/pwm_rpi_platform.sh b/wizard/pwm_rpi_platform.sh index ffa662d1..76e996c2 100644 --- a/wizard/pwm_rpi_platform.sh +++ b/wizard/pwm_rpi_platform.sh @@ -1,8 +1,14 @@ # This file will add the PWM pin definition if it does not already exist in the file +# Enable Hardware PWM - Needed for hardware PWM support +if test -f /boot/firmware/config.txt; then + CONFIG='/boot/firmware/config.txt' +else + CONFIG='/boot/config.txt' +fi -if grep -wq "dtoverlay=pwm,pin=13,func=4" /boot/config.txt; then - echo "PWM pin definition exists in /boot/config.txt" +if grep -wq "dtoverlay=pwm" $CONFIG; then + echo "PWM pin definition exists in $CONFIG" else - echo "Adding PWM definition in /boot/config.txt" - echo "dtoverlay=pwm,pin=13,func=4" | sudo tee -a /boot/config.txt > /dev/null + echo "Adding PWM definition in $CONFIG" + echo "dtoverlay=pwm,gpiopin=13,func=4" | sudo tee -a $CONFIG > /dev/null fi \ No newline at end of file