Files
controller-wisetopdataserver/run-setup-uart.sh
T
2021-12-20 14:52:55 +08:00

21 lines
481 B
Bash
Executable File

#!/usr/bin/env bash
# call by install.sh
# enable SPI
raspi-config nonint do_spi 0
# disable serial
raspi-config nonint do_serial 2
# disable Bluetooth using UART
systemctl disable hciuart
if [ ! -f '/etc/udev/rules.d/91-local.rules' ]; then
echo 'KERNEL=="ttyS0", MODE="660", OWNER="pi", GROUP="dialout"' > /etc/udev/rules.d/91-local.rules
fi
if [ -z "$(grep dtoverlay=pi4-disable-bt /boot/config.txt)" ]; then
echo 'dtoverlay=pi4-disable-bt' >> /boot/config.txt
fi