Skip to content

Commit

Permalink
v6.26
Browse files Browse the repository at this point in the history
+ DietPi-Software | EmonHub: Fix renamed dtoverlay to disable Bluetooth on install. Disable via DietPi-Set_hardware on all onboard WiFi/BT devices, although research/test on RPi4 required to verify Bluetooth blocks ttyAMA0 there as well.
+ DietPi-Software | EmonHub: Disable serial console only on ttyAMA0, else primary UART device will be disabled as well, which is ttyAMA0 on non-WiFi RPi models. Instead assure on non-WiFi RPi models that this UART device is enabled.
  • Loading branch information
MichaIng authored Jul 23, 2019
1 parent 023fc39 commit 798194d
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -9940,40 +9940,31 @@ _EOF_

Banner_Configuration

# - Copy configs
# Copy config
cp /etc/emonhub/conf/default/emonhub /etc/default/emonhub

# - Setup service
# Setup service
cp /etc/emonhub/service/emonhub /etc/init.d/emonhub
chmod +x /etc/init.d/emonhub
update-rc.d emonhub defaults

chmod +x -R /etc/emonhub

# RPI 3 - Must disable BCM BT to recover UART 0
#RPI4: test required.
if (( $G_HW_MODEL == 3 )); then
# Disable onboard Bluetooth, if present, to recover ttyAMA0
# RPi4: Test required
if (( $(sed -n 10p /DietPi/dietpi/.hw_model) )); then

# - Add DToverlay to disable bluetooth
if ! grep -qi '=pi3-disable-bt' /DietPi/config.txt; then
/DietPi/dietpi/func/dietpi-set_hardware bluetooth disable

echo -e '\ndtoverlay=pi3-disable-bt' >> /DietPi/config.txt

# - Enable
else

sed -i '/pi3-disable-bt/c\dtoverlay=pi3-disable-bt' /DietPi/config.txt

fi
# Else, assure that primary UART is enabled, which is ttyAMA0 on non-onboard WiFi/BT models
else

# - Disable bluetooth service
systemctl stop hciuart
systemctl disable hciuart
G_CONFIG_INJECT 'enable_uart=' 'enable_uart=1' $FP_RPI_CONFIG

fi

#RPi - Disable serial tty that emonPi uses.
/DietPi/dietpi/func/dietpi-set_hardware serialconsole disable
# Disable console on ttyAMA0
/DietPi/dietpi/func/dietpi-set_hardware serialconsole disable ttyAMA0

# - Apply user API KEY
USER_EMONHUB_APIKEY_CURRENT=$(grep -m1 '^[[:blank:]]*SOFTWARE_EMONHUB_APIKEY=' /DietPi/dietpi.txt | sed 's/^[^=]*=//')
Expand Down

0 comments on commit 798194d

Please sign in to comment.