Skip to content

Commit

Permalink
add waveshare 2.0 inch LCD support
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlenberg committed Dec 1, 2023
1 parent 2995282 commit 502acda
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 66 deletions.
21 changes: 2 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,25 +168,8 @@ This is the sd card image you should choose if your at the beginning of your Ras
<!--- _WARNING: THIS IS STILL A RELEASE CANDIDATE VERSION</br>
JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!_ -->

- **FATPACK SD CARD IMAGE ⮕ [raspiblitz-fat-v1.10.0-2023-09-22.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.10.0-2023-09-22.img.gz)**
- SHA-256: 50b48e078d162dfafc2b80025cf493141b0d8ab5774519bff4c3239d5d246f8f
GPG 64-bit (main): 1C73 060C 7C17 6461 & (sub): AA9D D1B5 CC56 47DA
- Signature-File: [raspiblitz-fat-v1.10.0-2023-09-22.img.gz.sig](https://raspiblitz.fulmo.org/images/raspiblitz-fat-v1.10.0-2023-09-22.img.gz.sig)
- Torrent: [raspiblitz-fat-v1.10.0-2023-09-22.img.gz.torrent](https://github.com/rootzoll/raspiblitz/raw/dev/home.admin/assets/raspiblitz-fat-v1.10.0-2023-09-22.img.gz.torrent)
- [How to verify the SD card image after download?](FAQ.md#how-to-verify-the-sd-card-image-after-download)

### MINIMAL SD Card Image (Experienced Users - SSH)

This is the sd card image for RaspiBlitz users that are already more experienced and want to use just a limited set of features of the RaspiBlitz. This image has just the bare minimum of features pre-installed - LCD & HDMI output is off by default. Setup, Update or Recovery needs to be done thru SSH login - API & WebUI are later available but are not preinstalled/activated by default. The RaspiBlitz will download & compile just the tools that are in your ´raspiblitz.conf´ - this will take longer but as a trade-off this RaspiBlitz then just runs with a reduced set of dependencies and so a minimalized attack vector and better performance. Its for the serious & experienced node runners.

<!-- _WARNING: THIS IS STILL A RELEASE CANDIDATE VERSION</br>
JUST USE FOR TESTING, HIGHER RISK OF LOSING FUNDS!_ -->

- **MINIMAL SD CARD IMAGE ⮕ [raspiblitz-min-v1.10.0-2023-09-22.img.gz](https://raspiblitz.fulmo.org/images/raspiblitz-min-v1.10.0-2023-09-22.img.gz)**
- SHA-256: 77674947b6682cfcc507179038ad532d4b7e60eb5274edca1a62ee78882108ad
- GPG 64-bit (main): 1C73 060C 7C17 6461 & (sub): AA9D D1B5 CC56 47DA
- Signature-File: [raspiblitz-min-v1.10.0-2023-09-22.img.gz.sig](https://raspiblitz.fulmo.org/images/raspiblitz-min-v1.10.0-2023-09-22.img.gz.sig)
- Torrent: [raspiblitz-min-v1.10.0-2023-09-22.img.gz.torrent](https://github.com/rootzoll/raspiblitz/raw/dev/home.admin/assets/raspiblitz-min-v1.10.0-2023-09-22.img.gz.torrent)
- **FATPACK SD CARD IMAGE (with 2.0 inch LCD) ⮕ [raspiblitz-fat-v1.10.0-2.0_inch_LCD-2023-11-18.img.gz](https://1drv.ms/u/s!AoYeoNb29-3HjWVDq-K7eb2vv6uU)**
- SHA-256: 7A962397527850BEAEFE7C65E2B4E633784E77AFFAA10BA9A130F150CB140ECF
- [How to verify the SD card image after download?](FAQ.md#how-to-verify-the-sd-card-image-after-download)

Further Info:
Expand Down
24 changes: 16 additions & 8 deletions build_sdcard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Options:
-f, --fatpack [0|1] fatpack mode (default: 1)
-u, --github-user [raspiblitz|other] github user to be checked from the repo (default: ${defaultRepo})
-b, --branch [v1.7|v1.8] branch to be built on (default: ${defaultBranch})
-d, --display [lcd|hdmi|headless] display class (default: lcd)
-d, --display [lcd35|lcd20|hdmi|headless] display class (default: lcd35)
-t, --tweak-boot-drive [0|1] tweak boot drives (default: 1)
-w, --wifi-region [off|US|GB|other] wifi iso code (default: US) or 'off'
Expand Down Expand Up @@ -205,9 +205,9 @@ curl --header "X-GitHub-Api-Version:2022-11-28" -s "https://api.github.com/repos

# DISPLAY-CLASS
# ----------------------------------------
# Could be 'hdmi', 'headless' or 'lcd' (lcd is default)
: "${display:=lcd}"
range_argument display "lcd" "hdmi" "headless"
# Could be 'hdmi', 'headless', 'lcd35' or 'lcd20' (lcd35 is default)
: "${display:=lcd35}"
range_argument display "lcd35" "lcd20" "hdmi" "headless"

# TWEAK-BOOTDRIVE
# ---------------------------------------
Expand Down Expand Up @@ -580,6 +580,8 @@ if [ $(sudo cat /etc/group | grep -c "^admin") -lt 1 ]; then
else
echo -e "\nOK group admin exists"
fi
# add admin to gpio group to be able to control GPIOs (fan control pwm of waveshare NAS device)
usermod -a -G gpio admin

echo -e "\n*** ADDING SERVICE USER bitcoin"
# based on https://raspibolt.org/guide/raspberry-pi/system-configuration.html
Expand Down Expand Up @@ -818,7 +820,7 @@ echo "Provisioning BLITZ WEB SERVICE"
# *** FATPACK *** (can be activated by parameter - see details at start of script)
if ${fatpack}; then
echo "* FATPACK activated"
/home/admin/config.scripts/blitz.fatpack.sh || exit 1
/home/admin/config.scripts/blitz.fatpack.sh ${display} || exit 1
else
echo "* skipping FATPACK"
fi
Expand Down Expand Up @@ -860,13 +862,19 @@ echo "1. login fresh --> user:admin password:raspiblitz"
echo -e "2. run --> release\n"

# make sure that at least the code is available (also if no internet)
/home/admin/config.scripts/blitz.display.sh prepare-install
# (do last - because it might trigger reboot)
/home/admin/config.scripts/blitz.display.sh prepare-install "${display}"
# (do last - because might trigger reboot)
if [ "${display}" != "headless" ] || [ "${baseimage}" = "raspios_arm64" ]; then
echo "*** ADDITIONAL DISPLAY OPTIONS ***"
echo "- calling: blitz.display.sh set-display ${display}"
/home/admin/config.scripts/blitz.display.sh set-display ${display}
/home/admin/config.scripts/blitz.display.sh rotate 1
if [ "${display}" == "lcd20" ]; then
# activate fan control service as well
cp /home/admin/raspiblitz20lcd/fan_control.service /etc/systemd/system/fan_control.service
systemctl enable fan_control.service
else
/home/admin/config.scripts/blitz.display.sh rotate 1
fi
fi

echo "# BUILD DONE - see above"
2 changes: 1 addition & 1 deletion home.admin/_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function lcd() {
confirmMsg lcd
if [ $confirm -eq 1 ]; then
echo "# SWITCHING VIDEO OUTPUT TO --> LCD"
sudo /home/admin/config.scripts/blitz.display.sh set-display lcd
sudo /home/admin/config.scripts/blitz.display.sh set-display lcd20
restart
fi
}
Expand Down
107 changes: 74 additions & 33 deletions home.admin/config.scripts/blitz.display.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo
echo "# sudo blitz.display.sh rotate [on|off]"
echo "# sudo blitz.display.sh test-lcd-connect"
echo "# sudo blitz.display.sh set-display [hdmi|lcd|headless]"
echo "# sudo blitz.display.sh prepare-install"
echo "# sudo blitz.display.sh set-display [hdmi|lcd35|lcd20|headless]"
echo "# sudo blitz.display.sh prepare-install [lcd35|lcd20]"
exit 1
fi

Expand Down Expand Up @@ -198,13 +198,22 @@ if [ "${command}" == "test-lcd-connect" ]; then
fi

function prepareinstall() {
repoCloned=$(sudo -u admin ls /home/admin/wavesharelcd-64bit-rpi/README.md 2>/dev/null| grep -c README.md)
lcd_type=${1}
lcd_driver_repo="https://github.com/tux1c/wavesharelcd-64bit-rpi.git"
lcd_driver_dir="wavesharelcd-64bit-rpi"

if [ "$lcd_type" == "lcd20" ]; then
lcd_driver_repo="https://github.com/semafelectronics/raspiblitz20lcd.git"
lcd_driver_dir="raspiblitz20lcd"
fi

repoCloned=$(sudo -u admin ls /home/admin/$lcd_driver_dir/README.md 2>/dev/null| grep -c README.md)
if [ ${repoCloned} -lt 1 ]; then
echo "# clone/download https://github.com/tux1c/wavesharelcd-64bit-rpi.git"
echo "# clone/download $lcd_driver_repo"
cd /home/admin/
sudo -u admin git clone --no-checkout https://github.com/tux1c/wavesharelcd-64bit-rpi.git
sudo -u admin chmod -R 755 wavesharelcd-64bit-rpi
sudo -u admin chown -R admin:admin wavesharelcd-64bit-rpi
sudo -u admin git clone --no-checkout $lcd_driver_repo
sudo -u admin chmod -R 755 $lcd_driver_dir
sudo -u admin chown -R admin:admin $lcd_driver_dir
else
echo "# LCD repo already cloned/downloaded (${repoCloned})"
fi
Expand All @@ -231,6 +240,7 @@ function uninstall_hdmi() {

function install_lcd() {

lcd_type=${1:-lcd35}
if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian_rpi64" ]; then

echo "# INSTALL 64bit LCD DRIVER"
Expand All @@ -245,22 +255,34 @@ function install_lcd() {
sudo apt-mark hold raspberrypi-bootloader

# Downloading LCD Driver from Github
prepareinstall
cd /home/admin/wavesharelcd-64bit-rpi
prepareinstall "$lcd_type"

lcd_driver_dir="wavesharelcd-64bit-rpi"

[ "$lcd_type" == "lcd20" ] && lcd_driver_dir="raspiblitz20lcd"

cd /home/admin/$lcd_driver_dir

sudo -u admin git checkout master
sudo -u admin git reset --hard 5a206a7 || exit 1

if [ "$lcd_type" != "lcd20" ]; then
sudo -u admin git reset --hard 5a206a7 || exit 1
fi
sudo -u admin /home/admin/config.scripts/blitz.git-verify.sh \
'GitHub' 'https://github.com/web-flow.gpg' '4AEE18F83AFDEB23' || exit 1

# customized from https://github.com/tux1c/wavesharelcd-64bit-rpi/blob/master/install.sh
# prepare X11
mkdir -p /etc/X11/xorg.conf.d
mv /etc/X11/xorg.conf.d/40-libinput.conf /home/admin/wavesharelcd-64bit-rpi/40-libinput.conf 2>/dev/null
cp -rf ./99-calibration.conf /etc/X11/xorg.conf.d/99-calibration.conf
# sudo cp -rf ./99-fbturbo.conf /etc/X11/xorg.conf.d/99-fbturbo.conf # there is no such file

# add waveshare mod
cp ./waveshare35a.dtbo /boot/overlays/
if [ "$lcd_type" == "lcd20" ]; then
cp ./waveshare20lcd.dtbo /boot/overlays/
else
# customized from https://github.com/tux1c/wavesharelcd-64bit-rpi/blob/master/install.sh
# prepare X11
mkdir -p /etc/X11/xorg.conf.d
mv /etc/X11/xorg.conf.d/40-libinput.conf /home/admin/wavesharelcd-64bit-rpi/40-libinput.conf 2>/dev/null
cp -rf ./99-calibration.conf /etc/X11/xorg.conf.d/99-calibration.conf
# sudo cp -rf ./99-fbturbo.conf /etc/X11/xorg.conf.d/99-fbturbo.conf # there is no such file
# add waveshare mod
cp ./waveshare35a.dtbo /boot/overlays/
fi

# modify /boot/config.txt
sed -i "s/^hdmi_force_hotplug=.*//g" /boot/config.txt
Expand All @@ -276,8 +298,12 @@ function install_lcd() {
# echo "dtparam=spi=on" >> /boot/config.txt
# echo "enable_uart=1" >> /boot/config.txt
sed -i "s/^dtoverlay=.*//g" /boot/config.txt
echo "dtoverlay=waveshare35a:rotate=90" >> /boot/config.txt

if [ "$lcd_type" == "lcd20" ]; then
echo "dtoverlay=waveshare20lcd" >> /boot/config.txt
else
echo "dtoverlay=waveshare35a:rotate=90" >> /boot/config.txt
fi
# modify cmdline.txt
modification="dwc_otg.lpm_enable=0 quiet fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo"
containsModification=$(grep -c "${modification}" /boot/cmdline.txt)
Expand All @@ -295,9 +321,12 @@ function install_lcd() {
exit 1
fi

# touch screen calibration
apt-get install -y xserver-xorg-input-evdev
cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
if [ "$lcd_type" != "lcd20" ]; then
# touch screen calibration
apt-get install -y xserver-xorg-input-evdev
cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
fi

# TODO manual touchscreen calibration option
# https://github.com/tux1c/wavesharelcd-64bit-rpi#adapting-guide-to-other-lcds

Expand All @@ -316,7 +345,8 @@ function install_lcd() {
}

function uninstall_lcd() {

lcd_type=${1:-lcd35}

if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian_rpi64" ]; then

echo "# UNINSTALL 64bit LCD DRIVER"
Expand All @@ -343,12 +373,16 @@ function uninstall_lcd() {
sed -i "s/ dwc_otg.lpm_enable=0 quiet fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo//g" /boot/cmdline.txt

# un-prepare X11
mv /home/admin/wavesharelcd-64bit-rpi/40-libinput.conf /etc/X11/xorg.conf.d/40-libinput.conf 2>/dev/null
rm -rf /etc/X11/xorg.conf.d/99-calibration.conf

# remove github code of LCD drivers
rm -r /home/admin/wavesharelcd-64bit-rpi

if [ "$lcd_type" == "lcd20" ]; then
rm -r /home/admin/raspiblitz20lcd 2>/dev/null
# 'lcd35' or 'lcd' (old naming)
else
mv /home/admin/wavesharelcd-64bit-rpi/40-libinput.conf /etc/X11/xorg.conf.d/40-libinput.conf 2>/dev/null
rm -rf /etc/X11/xorg.conf.d/99-calibration.conf 2>/dev/null

# remove github code of LCD drivers
rm -r /home/admin/wavesharelcd-64bit-rpi 2>/dev/null
fi
echo "# OK uninstall LCD done ... reboot needed"

else
Expand Down Expand Up @@ -423,7 +457,8 @@ function uninstall_headless() {
###################

if [ "${command}" == "prepare-install" ]; then
prepareinstall
lcd_type=${2:-lcd35}
prepareinstall $lcd_type
exit 0
fi

Expand Down Expand Up @@ -467,14 +502,20 @@ if [ "${command}" == "set-display" ]; then
echo "# old(${displayClass})"
echo "# new(${paramDisplayClass})"

if [ "${paramDisplayClass}" == "hdmi" ] || [ "${paramDisplayClass}" == "lcd" ] || [ "${paramDisplayClass}" == "headless" ]; then
if [ "${paramDisplayClass}" == "hdmi" ] || [ "${paramDisplayClass}" == "headless" ]; then

# uninstall old state
uninstall_$displayClass

# install new state
install_$paramDisplayClass
elif [[ "${paramDisplayClass}" =~ ^lcd.* ]]; then

# uninstall old state
uninstall_lcd "${paramDisplayClass}"

# install new state
install_lcd "${paramDisplayClass}"
else
echo "err='unknown parameter'"
exit 1
Expand All @@ -489,4 +530,4 @@ fi

# unknown command
echo "error='unknown command'"
exit 1
exit 1
6 changes: 2 additions & 4 deletions home.admin/config.scripts/blitz.fatpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ if [ "$EUID" -ne 0 ]
fi

# make sure LCD is on (default for fatpack)
/home/admin/config.scripts/blitz.display.sh set-display lcd
echo "# Calling blitz.display.sh set-display "$1" from blitz.fatpack.sh (1)"
/home/admin/config.scripts/blitz.display.sh set-display "$1"

# check if sd card needs expansion before fatpack
source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status)
Expand Down Expand Up @@ -108,6 +109,3 @@ echo "* Adding Code&Compile for WEBUI-APP: BTC RPC EXPLORER"
/home/admin/config.scripts/bonus.btc-rpc-explorer.sh install || exit 1
echo "* Adding Code&Compile for WEBUI-APP: MEMPOOL"
/home/admin/config.scripts/bonus.mempool.sh install || exit 1

# set default display to LCD
sudo /home/admin/config.scripts/blitz.display.sh set-display lcd
2 changes: 1 addition & 1 deletion home.admin/setup.scripts/eventBlockchainSync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ fi

# display info to user
time=$(date '+%H:%M:%S')
dialog --title " Node is Syncing (${time}) " --backtitle "RaspiBlitz ${codeVersion} / ${system_temp_celsius}°C / ${system_temp_fahrenheit}°F / ${hostname}" --infobox "${infoStr}\n ${adminStr}" ${height} ${width}
dialog --title " Node is Syncing (${time}) ${internet_localip}" --backtitle "RaspiBlitz ${codeVersion} / ${system_temp_celsius}°C / ${system_temp_fahrenheit}°F / ${hostname}" --infobox "${infoStr}\n ${adminStr}" ${height} ${width}

0 comments on commit 502acda

Please sign in to comment.