#1265 Display Refactor (#2149)

This commit is contained in:
/rootzoll 2021-04-08 00:02:57 +02:00 committed by GitHub
parent 413867a4b6
commit 5764c51c61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 793 additions and 565 deletions

6
FAQ.md
View File

@ -407,7 +407,7 @@ To build a SD card image from another branch than master, you follow the [Build
For example if you want to make a build from the 'dev' branch you execute the following command:
`wget https://raw.githubusercontent.com/rootzoll/raspiblitz/dev/build_sdcard.sh && sudo bash build_sdcard.sh false rootzoll dev true true true`
`wget --no-cache https://raw.githubusercontent.com/rootzoll/raspiblitz/dev/build_sdcard.sh && sudo bash build_sdcard.sh false rootzoll dev lcd true true`
## How can I build an SD card from my forked GitHub Repo?
@ -417,7 +417,7 @@ If you fork the RaspiBlitz repo (much welcome) and you want to run that code on
* The long way: If you like to install/remove/change services and system configurations you need to build a SD card from your own code. Prepare like in [Build the SD Card Image](README.md#build-the-sd-card-image) from the README but in the end run the command:
`wget https://raw.githubusercontent.com/[GITHUB-USERNAME]/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh false [GITHUB-USERNAME] [BRANCH] true true true`
`wget --no-cache https://raw.githubusercontent.com/[GITHUB-USERNAME]/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh false [GITHUB-USERNAME] [BRANCH] lcd true true`
If you are then working in your forked repo and want to update the scripts on your RaspiBlitz with your latest repo changes, run `/home/admin/XXsyncScripts.sh` - That's OK as long as you don't make changes to the SD card build script - for that you would need to build a fresh SD card again from your repo.
@ -537,7 +537,7 @@ Work notes for the process of producing a new SD card image release:
* In terminal `ssh pi@[IP-OF-RASPIBLITZ]`
* Password is `raspberry`
* Run the following command BUT REPLACE `[BRANCH]` with the branch-string of your latest version
* `wget https://raw.githubusercontent.com/rootzoll/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh true rootzoll [BRANCH] true true true`
* `wget --no-cache https://raw.githubusercontent.com/rootzoll/raspiblitz/[BRANCH]/build_sdcard.sh && sudo bash build_sdcard.sh true rootzoll [BRANCH] lcd true true`
* Monitor/Check outputs for warnings/errors - install LCD
* Login new with `ssh admin@[IP-OF-RASPIBLITZ]` (pw: raspiblitz) and run `./XXprepareRelease.sh`
* Disconnect WiFi/LAN on build laptop (hardware switch off) and shutdown

View File

@ -9,9 +9,9 @@
##########################################################################
echo ""
echo "*****************************************"
echo "****************************************."
echo "* RASPIBLITZ SD CARD IMAGE SETUP v1.7 *"
echo "*****************************************"
echo "****************************************."
echo "For details on optional parameters - see build script source code:"
# 1st optional paramater: FATPACK
@ -55,20 +55,20 @@ if [ ${#githubBranch} -eq 0 ]; then
fi
echo "3) will use GITHUB-BRANCH --> '${githubBranch}'"
# 4rd optional paramater: LCD-DRIVER
# 4rd optional paramater: DISPLAY-CLASS
# ----------------------------------------
# could be 'false' or 'GPIO' (default)
# Use 'false' if you want to build an image that runs without a specialized LCD (like the GPIO).
# Could be 'hdmi', 'headless' or 'lcd'
# On 'false' the standard video output is used (HDMI) by default.
lcdInstalled="$4"
if [ ${#lcdInstalled} -eq 0 ] || [ "${lcdInstalled}" == "true" ]; then
lcdInstalled="GPIO"
# https://github.com/rootzoll/raspiblitz/issues/1265#issuecomment-813369284
displayClass="$4"
if [ ${#displayClass} -eq 0 ] || [ "${displayClass}" == "false" ]; then
displayClass="hdmi"
fi
if [ "${lcdInstalled}" != "false" ] && [ "${lcdInstalled}" != "GPIO" ]; then
echo "ERROR: LCD-DRIVER parameter needs to be either 'false' or 'GPIO'"
if [ "${displayClass}" != "hdmi" ] && [ "${displayClass}" != "lcd" ] && [ "${displayClass}" != "headless" ]; then
echo "ERROR: DISPLAY-CLASS parameter needs to be 'lcd', 'hdmi' or 'headless'"
exit 1
else
echo "4) will use LCD-DRIVER --> '${lcdInstalled}'"
echo "4) will use DISPLAY-CLASS --> '${displayClass}'"
fi
# 5rd optional paramater: TWEAK-BOOTDRIVE
@ -353,7 +353,10 @@ echo "*** CONFIG ***"
echo "root:raspiblitz" | sudo chpasswd
echo "pi:raspiblitz" | sudo chpasswd
if [ "${lcdInstalled}" != "false" ]; then
# if not headless - make sure pi user is doing auto login to run display
if [ "${displayClass}" != "headless" ]; then
# activate auto-login of pi user
if [ "${baseimage}" = "raspbian" ]||[ "${baseimage}" = "raspios_arm64" ]||\
[ "${baseimage}" = "debian_rpi64" ]; then
# set Raspi to boot up automatically with user pi (for the LCD)
@ -362,20 +365,58 @@ if [ "${lcdInstalled}" != "false" ]; then
sudo bash -c "echo '[Service]' >> /etc/systemd/system/getty@tty1.service.d/autologin.conf"
sudo bash -c "echo 'ExecStart=' >> /etc/systemd/system/getty@tty1.service.d/autologin.conf"
sudo bash -c "echo 'ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux' >> /etc/systemd/system/getty@tty1.service.d/autologin.conf"
fi
if [ "${baseimage}" = "dietpi" ]; then
elif [ "${baseimage}" = "dietpi" ]; then
# set DietPi to boot up automatically with user pi (for the LCD)
# requires AUTO_SETUP_AUTOSTART_TARGET_INDEX=7 in the dietpi.txt
# /DietPi/dietpi/dietpi-autostart overwrites /etc/systemd/system/getty@tty1.service.d/dietpi-autologin.conf on reboot
sudo sed -i 's/agetty --autologin root %I $TERM/agetty --autologin pi --noclear %I 38400 linux/' /DietPi/dietpi/dietpi-autostart
fi
if [ "${baseimage}" = "ubuntu" ] || [ "${baseimage}" = "armbian" ]; then
elif [ "${baseimage}" = "ubuntu" ] || [ "${baseimage}" = "armbian" ]; then
sudo bash -c "echo '[Service]' >> /lib/systemd/system/getty@.service"
sudo bash -c "echo 'ExecStart=' >> /lib/systemd/system/getty@.service"
sudo bash -c "echo 'ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux' >> /lib/systemd/system/getty@.service"
else
echo "FAIL: Autostart pi user not available for baseimage(${baseimage}) - please choose 'headless' on DISPLAY-CLASS"
exit 1
fi
# activate auto-start of 00infoLCD.sh script on pi user login
if [ "${baseimage}" = "raspbian" ]||[ "${baseimage}" = "raspios_arm64" ]||\
[ "${baseimage}" = "debian_rpi64" ]||[ "${baseimage}" = "armbian" ]||\
[ "${baseimage}" = "ubuntu" ]; then
homeFile=/home/pi/.bashrc
autostartDone=$(grep -c "automatic start the LCD" $homeFile)
if [ ${autostartDone} -eq 0 ]; then
# bash autostart for pi
# run as exec to dont allow easy physical access by keyboard
# see https://github.com/rootzoll/raspiblitz/issues/54
sudo bash -c 'echo "# automatic start the LCD info loop" >> /home/pi/.bashrc'
sudo bash -c 'echo "SCRIPT=/home/admin/00infoLCD.sh" >> /home/pi/.bashrc'
sudo bash -c 'echo "# replace shell with script => logout when exiting script" >> /home/pi/.bashrc'
sudo bash -c 'echo "exec \$SCRIPT" >> /home/pi/.bashrc'
echo "autostart LCD added to $homeFile"
else
echo "autostart LCD already in $homeFile"
fi
elif [ "${baseimage}" = "dietpi" ]; then
homeFile=/home/dietpi/.bashrc
autostartDone=$(grep -c "automatic start the LCD" $homeFile)
if [ ${autostartDone} -eq 0 ]; then
# bash autostart for dietpi
sudo bash -c 'echo "# automatic start the LCD info loop" >> /home/dietpi/.bashrc'
sudo bash -c 'echo "SCRIPT=/home/admin/00infoLCD.sh" >> /home/dietpi/.bashrc'
sudo bash -c 'echo "# replace shell with script => logout when exiting script" >> /home/dietpi/.bashrc'
sudo bash -c 'echo "exec \$SCRIPT" >> /home/dietpi/.bashrc'
echo "autostart LCD added to $homeFile"
else
echo "autostart LCD already in $homeFile"
fi
else
echo "FAIL: Script Autostart not available for baseimage(${baseimage}) - please choose 'headless' on DISPLAY-CLASS"
exit 1
fi
else
echo "# running headless ... no auto-login of pi user for display needed"
fi
# change log rotates
@ -529,8 +570,9 @@ echo '%sudo ALL=(ALL) NOPASSWD:ALL' | sudo EDITOR='tee -a' visudo
# WRITE BASIC raspiblitz.info to sdcard
echo "baseimage=${baseimage}" > /home/admin/raspiblitz.info
echo "cpu=${cpu}" >> /home/admin/raspiblitz.info
echo "displayClass=${displayClass}" >> /home/admin/raspiblitz.info
sudo mv ./raspiblitz.info /home/admin/raspiblitz.info
sudo chmod 777 /home/admin/raspiblitz.info
sudo chmod 755 /home/admin/raspiblitz.info
echo ""
echo "*** ADDING SERVICE USER bitcoin"
@ -599,10 +641,9 @@ fi
# add /sbin to path for all
sudo bash -c "echo 'PATH=\$PATH:/sbin' >> /etc/profile"
# script auto-start for admin user
homeFile=/home/admin/.bashrc
autostart="automatically start main menu"
autostartDone=$(grep -c "$autostart" $homeFile)
autostartDone=$(grep -c "automatically start main menu" $homeFile)
if [ ${autostartDone} -eq 0 ]; then
# bash autostart for admin
sudo bash -c "echo '# shortcut commands' >> /home/admin/.bashrc"
@ -685,7 +726,7 @@ sudo apt install -y --no-install-recommends python3-systemd fail2ban
echo "Activating CACHE RAM DISK ... "
sudo /home/admin/config.scripts/blitz.cache.sh on
# *** Wifi & Bluetooth ***
# *** Wifi, Bluetooth & other configs ***
if [ "${baseimage}" = "raspbian" ]||[ "${baseimage}" = "raspios_arm64" ]||\
[ "${baseimage}" = "debian_rpi64" ]; then
@ -719,16 +760,22 @@ if [ "${baseimage}" = "raspbian" ]||[ "${baseimage}" = "raspios_arm64" ]||\
# remove bluetooth packages
sudo apt remove -y --purge pi-bluetooth bluez bluez-firmware
echo
# disable audio
echo "*** DISABLE AUDIO (snd_bcm2835) ***"
sudo sed -i "s/^dtparam=audio=on/# dtparam=audio=on/g" /boot/config.txt
echo
# disable DRM VC4 V3D
echo "*** DISABLE DRM VC4 V3D driver ***"
dtoverlay=vc4-fkms-v3d
sudo sed -i "s/^dtoverlay=vc4-fkms-v3d/# dtoverlay=vc4-fkms-v3d/g" /boot/config.txt
echo
# I2C fix (make sure dtparam=i2c_arm is not on)
# see: https://github.com/rootzoll/raspiblitz/issues/1058#issuecomment-739517713
sudo sed -i "s/^dtparam=i2c_arm=.*//g" /boot/config.txt
fi
# *** FATPACK *** (can be activated by parameter - see details at start of script)
@ -1026,164 +1073,26 @@ sudo chown -R admin /home/admin
echo "- OK install of LND done"
echo ""
echo "*** DISPLAY OPTIONS ***"
# (do last - because makes a reboot)
# based on https://www.elegoo.com/tutorial/Elegoo%203.5%20inch%20Touch%20Screen%20User%20Manual%20V1.00.2017.10.09.zip
if [ "${lcdInstalled}" != "false" ]; then
# lcd preparations based on os
if [ "${baseimage}" = "raspbian" ]||[ "${baseimage}" = "raspios_arm64" ]||\
[ "${baseimage}" = "debian_rpi64" ]||[ "${baseimage}" = "armbian" ]||\
[ "${baseimage}" = "ubuntu" ]; then
homeFile=/home/pi/.bashrc
autostart="automatic start the LCD"
autostartDone=$(grep -c "$autostart" $homeFile)
if [ ${autostartDone} -eq 0 ]; then
# bash autostart for pi
# run as exec to dont allow easy physical access by keyboard
# see https://github.com/rootzoll/raspiblitz/issues/54
sudo bash -c 'echo "# automatic start the LCD info loop" >> /home/pi/.bashrc'
sudo bash -c 'echo "SCRIPT=/home/admin/00infoLCD.sh" >> /home/pi/.bashrc'
sudo bash -c 'echo "# replace shell with script => logout when exiting script" >> /home/pi/.bashrc'
sudo bash -c 'echo "exec \$SCRIPT" >> /home/pi/.bashrc'
echo "autostart LCD added to $homeFile"
else
echo "autostart LCD already in $homeFile"
fi
fi
if [ "${baseimage}" = "dietpi" ]; then
homeFile=/home/dietpi/.bashrc
startLCD="automatic start the LCD"
autostartDone=$(grep -c "$startLCD" $homeFile)
if [ ${autostartDone} -eq 0 ]; then
# bash autostart for dietpi
sudo bash -c 'echo "# automatic start the LCD info loop" >> /home/dietpi/.bashrc'
sudo bash -c 'echo "SCRIPT=/home/admin/00infoLCD.sh" >> /home/dietpi/.bashrc'
sudo bash -c 'echo "# replace shell with script => logout when exiting script" >> /home/dietpi/.bashrc'
sudo bash -c 'echo "exec \$SCRIPT" >> /home/dietpi/.bashrc'
echo "autostart LCD added to $homeFile"
else
echo "autostart LCD already in $homeFile"
fi
fi
echo ""
if [ "${lcdInstalled}" == "GPIO" ]; then
if [ "${baseimage}" = "raspbian" ] || [ "${baseimage}" = "dietpi" ]; then
echo "*** 32bit LCD DRIVER ***"
echo "--> Downloading LCD Driver from Github"
cd /home/admin/
sudo -u admin git clone https://github.com/MrYacha/LCD-show.git
sudo -u admin chmod -R 755 LCD-show
sudo -u admin chown -R admin:admin LCD-show
cd LCD-show/
sudo -u admin git reset --hard 53dd0bf || exit 1
# install xinput calibrator package
echo "--> install xinput calibrator package"
sudo apt install -y libxi6
sudo dpkg -i xinput-calibrator_0.7.5-1_armhf.deb
if [ "${baseimage}" = "dietpi" ]; then
echo "--> dietpi preparations"
sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo mkdir /etc/X11/xorg.conf.d
sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/
sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/tft35a.dtbo
sudo cp -rf ./usr/99-calibration.conf-35 /etc/X11/xorg.conf.d/99-calibration.conf
sudo cp -rf ./usr/99-fbturbo.conf /usr/share/X11/xorg.conf.d/
sudo cp ./usr/cmdline.txt /DietPi/
sudo cp ./usr/inittab /etc/
sudo cp ./boot/config-35.txt /DietPi/config.txt
# make LCD screen rotation correct
sudo sed -i "s/dtoverlay=tft35a/dtoverlay=tft35a:rotate=270/" /DietPi/config.txt
fi
elif [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian_rpi64" ]; then
echo "*** 64bit LCD DRIVER ***"
echo "--> Downloading LCD Driver from Github"
cd /home/admin/
sudo -u admin git clone 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
cd /home/admin/wavesharelcd-64bit-rpi
sudo -u admin git reset --hard 5a206a7 || exit 1
# from https://github.com/tux1c/wavesharelcd-64bit-rpi/blob/master/install.sh
# prepare X11
rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
mkdir -p /etc/X11/xorg.conf.d
cp -rf ./99-calibration.conf /etc/X11/xorg.conf.d/99-calibration.conf
# cp -rf ./99-fbturbo.conf /etc/X11/xorg.conf.d/99-fbturbo.conf # there is no such file
# load module on boot
cp ./waveshare35a.dtbo /boot/overlays/
echo "hdmi_force_hotplug=1" >> /boot/config.txt
echo "dtparam=i2c_arm=on" >> /boot/config.txt
# don't enable SPI and UART ports by default
# echo "dtparam=spi=on" >> /boot/config.txt
# echo "enable_uart=1" >> /boot/config.txt
echo "dtoverlay=waveshare35a:rotate=90" >> /boot/config.txt
cp ./cmdline.txt /boot/
# 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
# TODO manual touchscreen calibration option
# https://github.com/tux1c/wavesharelcd-64bit-rpi#adapting-guide-to-other-lcds
fi
else
echo "FAIL: Unknown LCD-DRIVER: ${lcdInstalled}"
exit 1
fi
else
echo "- LCD options are deactivated"
fi
# *** RASPIBLITZ IMAGE READY ***
echo ""
echo "**********************************************"
echo "SD CARD BUILD DONE"
echo "**********************************************"
echo ""
echo "*** raspiblitz.info ***"
sudo cat /home/admin/raspiblitz.info
if [ "${lcdInstalled}" != "false" ]; then
echo "Your SD Card Image for RaspiBlitz is almost ready."
if [ "${baseimage}" = "raspbian" ]; then
echo "Last step is to install LCD drivers. This will reboot your Pi when done."
echo ""
fi
else
echo "Your SD Card Image for RaspiBlitz is ready."
fi
echo "Take the chance & look thru the output above if you can spot any error."
# *** RASPIBLITZ IMAGE READY INFO ***
echo ""
echo "**********************************************"
echo "BASIC SD CARD BUILD DONE"
echo "**********************************************"
echo ""
echo "Your SD Card Image for RaspiBlitz is ready (might still do display config)."
echo "Take the chance & look thru the output above if you can spot any errors or warnings."
echo ""
if [ "${lcdInstalled}" != "false" ]; then
echo "After final reboot - your SD Card Image is ready."
echo ""
fi
echo "IMPORTANT IF WANT TO MAKE A RELEASE IMAGE FROM THIS BUILD:"
echo "login once after reboot without external HDD/SSD and run 'XXprepareRelease.sh'"
echo "REMEMBER for login now use --> user:admin password:raspiblitz"
echo "1. login fresh --> user:admin password:raspiblitz"
echo "2. run --> ./XXprepareRelease.sh"
echo ""
if [ "${lcdInstalled}" == "GPIO" ]; then
# activate LCD and trigger reboot
# dont do this on dietpi to allow for automatic build
if [ "${baseimage}" = "raspbian" ]; then
echo "Installing 32-bit LCD drivers ..."
sudo chmod +x -R /home/admin/LCD-show
cd /home/admin/LCD-show/
sudo apt-mark hold raspberrypi-bootloader
sudo ./LCD35-show
elif [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian_rpi64" ]; then
echo "Installing 64-bit LCD drivers ..."
sudo chmod +x -R /home/admin/wavesharelcd-64bit-rpi
cd /home/admin/wavesharelcd-64bit-rpi
sudo apt-mark hold raspberrypi-bootloader
sudo ./install.sh
else
echo "Use 'sudo reboot' to restart manually."
fi
# (do last - because might trigger reboot)
if [ "${displayClass}" != "hdmi" ]; then
echo "*** ADDITIONAL DISPLAY OPTIONS ***"
echo "- calling: blitz.display.sh set-display ${displayClass}"
sudo blitz.display.sh set-display ${displayClass}
fi

View File

@ -78,17 +78,6 @@ chain=""
while :
do
# save some CPU / log clutter on a "headless" installation (no LCD attached)
# by running the LCD stuff each 5 minutes that otherwise will be run every 5 seconds
#
# just insert a line "headless=on" into your "/mnt/hdd/raspiblitz.conf" file
#
isHeadless=$(cat "${configFile}" 2>/dev/null | grep -Ec "headless=1|headless=on")
if [ ${isHeadless} -gt 0 ]; then
echo "*** headless=on sleeping 60 seconds ***" | systemd-cat
sleep 60
fi
###########################
# CHECK BASIC DATA
###########################

View File

@ -18,7 +18,7 @@ if [ "${error}" != "" ]; then
fi
# check if HDD is connected
if [ ${isMounted} -eq 0 ] && [ ${#hddCandidate} -eq 0 ]; then
if [ "${isMounted}" == "0" ] && [ ${#hddCandidate} -eq 0 ]; then
echo "***********************************************************"
echo "WARNING: NO HDD FOUND -> Shutdown, connect HDD and restart."
echo "***********************************************************"

View File

@ -315,7 +315,7 @@ if [ ${check} -eq 1 ]; then choice="1"; fi
if [ "${lcdrotate}" != "${choice}" ]; then
echo "LCD Rotate Setting changed .."
anychange=1
sudo /home/admin/config.scripts/blitz.lcd.sh rotate ${choice}
sudo /home/admin/config.scripts/blitz.display.sh rotate ${choice}
needsReboot=1
else
echo "LCD Rotate Setting unchanged."

View File

@ -100,7 +100,8 @@ else
echo "network=${network}" >> /home/admin/raspiblitz.conf
echo "chain=${chain}" >> /home/admin/raspiblitz.conf
echo "hostname=${hostname}" >> /home/admin/raspiblitz.conf
echo "lcd2hdmi=${lcd2hdmi}" >> /home/admin/raspiblitz.conf
echo "displayClass=${displayClass}" >> /home/admin/raspiblitz.conf
echo "displayType=${displayType}" >> /home/admin/raspiblitz.conf
echo "lcdrotate=1" >> /home/admin/raspiblitz.conf
sudo mv /home/admin/raspiblitz.conf $configFile

View File

@ -149,7 +149,7 @@ fi
CHOICE=$(whiptail --clear --title "Choose Mobile Wallet" --menu "" 14 50 8 "${OPTIONS[@]}" 2>&1 >/dev/tty)
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
clear
echo "creating install info ..."
@ -177,29 +177,29 @@ case $CHOICE in
;;
ZAP_IOS)
appstoreLink="https://apps.apple.com/us/app/zap-bitcoin-lightning-wallet/id1406311960"
#/home/admin/config.scripts/blitz.lcd.sh qr ${appstoreLink}
#/home/admin/config.scripts/blitz.display.sh qr ${appstoreLink}
#whiptail --title "Install Testflight and Zap on your iOS device" \
# --yes-button "continue" \
# --no-button "link as QR code" \
# --yesno "Search for 'Zap Bitcoin' in Apple Appstore for basic version\nOr join public beta test for latest features:\n${appstoreLink}\n\nJoin testing and follow ALL instructions.\n\nWhen installed and started -> continue" 11 65
# if [ $? -eq 1 ]; then
# /home/admin/config.scripts/blitz.lcd.sh qr-console ${appstoreLink}
# /home/admin/config.scripts/blitz.display.sh qr-console ${appstoreLink}
#fi
/home/admin/config.scripts/blitz.lcd.sh image /home/admin/raspiblitz/pictures/app_zap.png
/home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zap.png
whiptail --title "Install Fully Noded on your iOS device" \
--yes-button "Continue" \
--no-button "StoreLink" \
--yesno "Open the Apple App Store on your mobile phone.\n\nSearch for --> 'Zap Bitcoin'\n\nCheck that logo is like on LCD & author: Zap Technologies LLC\nWhen app is installed and started --> Continue." 12 65
if [ $? -eq 1 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr ${appstoreLink}
/home/admin/config.scripts/blitz.display.sh qr ${appstoreLink}
whiptail --title " App Store Link " --msgbox "\
To install app open the following link:\n
${appstoreLink}\n
Or scan the qr code on the LCD with your mobile phone.
" 11 70
fi
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
checkIP2TOR LND-GRPC-API
see https://github.com/rootzoll/raspiblitz/issues/1001#issuecomment-634580257
if [ ${#ip2tor} -eq 0 ]; then
@ -210,20 +210,20 @@ Or scan the qr code on the LCD with your mobile phone.
;;
ZAP_ANDROID)
appstoreLink="https://play.google.com/store/apps/details?id=zapsolutions.zap"
/home/admin/config.scripts/blitz.lcd.sh image /home/admin/raspiblitz/pictures/app_zap.png
/home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zap.png
whiptail --title "Install Zap on your Android Phone" \
--yes-button "Continue" \
--no-button "StoreLink" \
--yesno "Open the Android Play Store on your mobile phone.\n\nSearch for --> 'zap bitcoin app'\n\nCheck that logo is like on LCD and author is: Zap\nWhen app is installed and started --> Continue." 12 65
if [ $? -eq 1 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr ${appstoreLink}
/home/admin/config.scripts/blitz.display.sh qr ${appstoreLink}
whiptail --title " App Store Link " --msgbox "\
To install app open the following link:\n
${appstoreLink}\n
Or scan the qr code on the LCD with your mobile phone.
" 11 70
fi
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
checkIP2TOR LND-GRPC-API
if [ ${#ip2tor} -eq 0 ]; then
choose_IP_or_TOR
@ -250,64 +250,64 @@ Please go to MAINMENU > SERVICES and activate KEYSEND first.
--no-button "Link as QR code" \
--yesno "Download & install the SendMany APK (armeabi-v7) from GitHub:\n\n${appstoreLink}\n\nEasiest way to scan QR code on LCD and download/install.\n\nWhen installed and started -> continue." 13 65
if [ $? -eq 1 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr ${appstoreLink}
/home/admin/config.scripts/blitz.lcd.sh qr-console ${appstoreLink}
/home/admin/config.scripts/blitz.display.sh qr ${appstoreLink}
/home/admin/config.scripts/blitz.display.sh qr-console ${appstoreLink}
fi
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
checkIP2TOR LND-GRPC-API
/home/admin/config.scripts/bonus.lndconnect.sh sendmany-android ${connect}
exit 1;
;;
ZEUS_IOS)
appstoreLink="https://testflight.apple.com/join/gpVFzEHN"
/home/admin/config.scripts/blitz.lcd.sh image /home/admin/raspiblitz/pictures/app_zeus.png
/home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zeus.png
whiptail --title "Install Testflight and Zeus on your iOS device" \
--yes-button "Continue" \
--no-button "Link as QR Code" \
--yesno "At the moment this app is in public beta testing.\nFirst open Apple Apstore, search & install 'TestFlight' app.\n\nThen open the following link on your mobile:\n${appstoreLink}\n\nUse 'Open In TestFlight' option of your mobile browser.\nWhen Zeus is installed and started --> Continue." 14 65
if [ $? -eq 1 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr ${appstoreLink}
/home/admin/config.scripts/blitz.lcd.sh qr-console ${appstoreLink}
/home/admin/config.scripts/blitz.display.sh qr ${appstoreLink}
/home/admin/config.scripts/blitz.display.sh qr-console ${appstoreLink}
fi
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/bonus.lndconnect.sh zeus-ios tor
exit 1;
;;
ZEUS_ANDROID)
appstoreLink="https://play.google.com/store/apps/details?id=app.zeusln.zeus"
/home/admin/config.scripts/blitz.lcd.sh image /home/admin/raspiblitz/pictures/app_zeus.png
/home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_zeus.png
whiptail --title "Install Zeus on your Android Phone" \
--yes-button "Continue" \
--no-button "StoreLink" \
--yesno "Open the Android Play Store on your mobile phone.\n\nSearch for --> 'zeus bitcoin app'\n\nCheck that logo is like on LCD and author is: Evan Kaloudis\nWhen app is installed and started --> Continue." 12 65
if [ $? -eq 1 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr ${appstoreLink}
/home/admin/config.scripts/blitz.display.sh qr ${appstoreLink}
whiptail --title " App Store Link " --msgbox "\
To install app open the following link:\n
${appstoreLink}\n
Or scan the qr code on the LCD with your mobile phone.
" 11 70
fi
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/bonus.lndconnect.sh zeus-android tor
exit 1;
;;
FULLY_NODED)
appstoreLink="https://apps.apple.com/us/app/fully-noded/id1436425586"
/home/admin/config.scripts/blitz.lcd.sh image /home/admin/raspiblitz/pictures/app_fullynoded.png
/home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/app_fullynoded.png
whiptail --title "Install Fully Noded on your iOS device" \
--yes-button "Continue" \
--no-button "StoreLink" \
--yesno "Open the Apple App Store on your mobile phone.\n\nSearch for --> 'fully noded'\n\nCheck that logo is like on LCD and author is: Denton LLC\nWhen app is installed and started --> Continue." 12 65
if [ $? -eq 1 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr ${appstoreLink}
/home/admin/config.scripts/blitz.display.sh qr ${appstoreLink}
whiptail --title " App Store Link " --msgbox "\
To install app open the following link:\n
${appstoreLink}\n
Or scan the qr code on the LCD with your mobile phone.
" 11 70
fi
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/bonus.fullynoded.sh
exit 1;
;;

View File

@ -68,7 +68,7 @@ else
rhash=$(echo "$result" | grep r_hash | cut -d '"' -f4)
payReq=$(echo "$result" | grep payment_request | cut -d '"' -f4)
/home/admin/config.scripts/blitz.lcd.sh qr "${payReq}"
/home/admin/config.scripts/blitz.display.sh qr "${payReq}"
if [ $(sudo dpkg-query -l | grep "ii qrencode" | wc -l) = 0 ]; then
sudo apt-get install qrencode -y > /dev/null
@ -99,8 +99,8 @@ else
echo $result
echo
echo "Returning to menu - OK Invoice payed."
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.lcd.sh image /home/admin/raspiblitz/pictures/ok.png
/home/admin/config.scripts/blitz.display.sh hide
/home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/ok.png
sleep 2
break
fi
@ -119,7 +119,7 @@ else
done
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
fi
echo "Press ENTER to return to main menu."

View File

@ -55,7 +55,7 @@ if [ "$chain" = "test" ]; then
fi
echo "generating QR code ... please wait"
/home/admin/config.scripts/blitz.lcd.sh qr "$network:${address}"
/home/admin/config.scripts/blitz.display.sh qr "$network:${address}"
# dialog with instructions while QR code is shown on LCD
whiptail --backtitle "Fund your on chain wallet" \
@ -66,11 +66,11 @@ whiptail --backtitle "Fund your on chain wallet" \
# display QR code
if [ $? -eq 1 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr-console "$network:${address}"
/home/admin/config.scripts/blitz.display.sh qr-console "$network:${address}"
fi
# clean up
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
# follow up info
whiptail --backtitle "Fund your on chain wallet" \

View File

@ -37,6 +37,9 @@ fi
echo "CHECK IF SD CARD NEEDS EXPANSION" >> ${logFile}
source ${infoFile}
# remember the DisplayClass from info file - before its gets overwritten by raspiblitz.conf to detect change
infoFileDisplayClass="${displayClass}"
minimumSizeByte=8192000000
rootPartition=$(sudo mount | grep " / " | cut -d " " -f 1 | cut -d "/" -f 3)
rootPartitionBytes=$(lsblk -b -o NAME,SIZE | grep "${rootPartition}" | tr -s ' ' | cut -d " " -f 2)
@ -70,6 +73,8 @@ if [ ${#rootPartition} -gt 0 ]; then
if [ -x ${resizeRaspbian} ]; then
echo "RUNNING EXPAND RASPBERRYPI: ${resizeRaspbian}" >> ${logFile}
sudo $resizeRaspbian --expand-rootfs
echo "going into reboot" >> ${logFile}
sudo cp ${logFile} ${logFile}.fsexpand.recover
sudo shutdown -r now
exit 0
else
@ -80,6 +85,8 @@ if [ ${#rootPartition} -gt 0 ]; then
if [ -x ${resizeArmbian} ]; then
echo "RUNNING EXPAND ARMBIAN: ${resizeArmbian}" >> ${logFile}
sudo $resizeArmbian start
echo "going into reboot" >> ${logFile}
sudo cp ${logFile} ${logFile}.fsexpand.recover
sudo shutdown -r now
exit 0
else
@ -100,18 +107,58 @@ fi
sudo chmod 777 ${configFile}
source ${configFile}
# check if the system was configured for HDMI and needs switch
# keep as one of the first so that user can see video output
##########################
# DISPLAY SETTINGS
##########################
# check if the raspiblitz config has a different display mode than the build image
echo "### DISPLAY SETTINGS ###" >> ${logFile}
# OLD: when nothing is set in raspiblitz.conf (<1.7)
existsDisplayClass=$(sudo cat ${configFile} | grep -c "displayClass=")
if [ "${existsDisplayClass}" == "0" ]; then
displayClass="lcd"
fi
# OLD: lcd2hdmi (deprecated)
if [ "${lcd2hdmi}" == "on" ]; then
echo "RaspiBlitz has config to run with HDMI video outout." >> ${logFile}
# check that raspiblitz.info shows that confing script was not run yet
switchScriptNotRunYet=$(sudo cat /home/admin/raspiblitz.info | grep -c "lcd2hdmi=off")
if [ ${switchScriptNotRunYet} -eq 1 ]; then
echo "--> Switching to HDMI video output & rebooting" >> ${logFile}
sudo /home/admin/config.scripts/blitz.lcd.sh hdmi on
echo "Convert lcd2hdmi=on to displayClass='hdmi'" >> ${logFile}
sudo sed -i "s/^lcd2hdmi=.*//g" ${configFile}
echo "displayClass=hdmi" >> ${configFile}
displayClass="hdmi"
elif [ "${lcd2hdmi}" != "" ]; then
echo "Remove old lcd2hdmi pramater from config" >> ${logFile}
sudo sed -i "s/^lcd2hdmi=.*//g" ${configFile}
displayClass="lcd"
fi
# OLD: headless (deprecated)
if [ "${headless}" == "on" ]; then
echo "Convert headless=on to displayClass='headless'" >> ${logFile}
sudo sed -i "s/^headless=.*//g" ${configFile}
echo "displayClass=headless" >> ${configFile}
displayClass="headless"
elif [ "${headless}" != "" ]; then
echo "Remove old headless pramater from config" >> ${logFile}
sudo sed -i "s/^headless=.*//g" ${configFile}
displayClass="lcd"
fi
# NEW: decide by displayClass
echo "raspiblitz.info(${infoFileDisplayClass}) raspiblitz.conf(${displayClass})" >> ${logFile}
if [ "${infoFileDisplayClass}" != "" ] && [ "${displayClass}" != "" ]; then
if [ "${infoFileDisplayClass}" != "${displayClass}" ]; then
echo "Need to update displayClass from (${infoFileDisplayClass}) to (${displayClass})'" >> ${logFile}
sudo /home/admin/config.scripts/blitz.display.sh set-display ${displayClass} >> ${logFile}
echo "going into reboot" >> ${logFile}
sudo cp ${logFile} ${logFile}.display.recover
sudo shutdown -r now
exit 0
else
echo "OK RaspiBlitz was already switched to HDMI output." >> ${logFile}
echo "Display Setting is correct ... no need for change" >> ${logFile}
fi
else
echo "WARN values in raspiblitz info and/or conf file seem broken" >> ${logFile}
fi
##########################
@ -415,7 +462,7 @@ if [ "${#lcdrotate}" -eq 0 ]; then
fi
echo "Provisioning LCD rotate - run config script" >> ${logFile}
sudo sed -i "s/^message=.*/message='LCD Rotate'/g" ${infoFile}
sudo /home/admin/config.scripts/blitz.lcd.sh rotate ${lcdrotate} >> ${logFile} 2>&1
sudo /home/admin/config.scripts/blitz.display.sh rotate ${lcdrotate} >> ${logFile} 2>&1
# TOUCHSCREEN
if [ "${#touchscreen}" -gt 0 ]; then

View File

@ -69,11 +69,16 @@ network=""
chain=""
setupStep=0
fsexpanded=0
lcd2hdmi="off"
# see https://github.com/rootzoll/raspiblitz/issues/1265#issuecomment-813369284
displayClass="lcd"
displayType=""
# try to load old values if available (overwrites defaults)
source ${infoFile} 2>/dev/null
# try to load config values if available (config overwrites info)
source ${configFile} 2>/dev/null
# resetting info file
echo "Resetting the InfoFile: ${infoFile}"
echo "state=starting" > $infoFile
@ -83,7 +88,8 @@ echo "cpu=${cpu}" >> $infoFile
echo "network=${network}" >> $infoFile
echo "chain=${chain}" >> $infoFile
echo "fsexpanded=${fsexpanded}" >> $infoFile
echo "lcd2hdmi=${lcd2hdmi}" >> $infoFile
echo "displayClass=${displayClass}" >> $infoFile
echo "displayType=${displayType}" >> $infoFile
echo "setupStep=${setupStep}" >> $infoFile
if [ "${setupStep}" != "100" ]; then
echo "hostname=${hostname}" >> $infoFile
@ -141,14 +147,7 @@ fi
# see https://github.com/rootzoll/raspiblitz/issues/647
# see https://github.com/rootzoll/raspiblitz/pull/1580
randnum=$(shuf -i 0-7 -n 1)
lcdExists=$(sudo ls /dev/fb1 2>/dev/null | grep -c "/dev/fb1")
if [ ${lcdExists} -eq 1 ] ; then
# LCD
sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/raspiblitz/pictures/startlogo${randnum}.png
else
# HDMI
sudo fbi -a -T 1 -d /dev/fb0 --noverbose /home/admin/raspiblitz/pictures/startlogo${randnum}.png
fi
/home/admin/config.scripts/blitz.display.sh image /home/admin/raspiblitz/pictures/startlogo${randnum}.png
sleep 5
sudo killall -3 fbi
@ -207,18 +206,10 @@ if [ ${forceHDMIoutput} -eq 1 ]; then
sudo rm /boot/hdmi*
# switch to HDMI what will trigger reboot
echo "Switching HDMI ON ... (reboot) " >> /home/admin/raspiblitz.recover.log
sudo /home/admin/config.scripts/blitz.lcd.sh hdmi on
sudo /home/admin/config.scripts/blitz.display.sh set-display hdmi
exit 0
fi
################################
# UPDATE LCD DRIVERS IF NEEEDED
################################
if [ "${lcd2hdmi}" != "on" ]; then
sudo /home/admin/config.scripts/blitz.lcd.sh check-repair >> $logFile
fi
################################
# SSH SERVER CERTS RESET
# if a file called 'ssh.reset' gets

View File

@ -76,13 +76,19 @@ function github() {
# command: hdmi
function hdmi() {
echo "# SWITCHING VIDEO OUTPUT TO --> HDMI"
sudo /home/admin/config.scripts/blitz.lcd.sh hdmi on
sudo /home/admin/config.scripts/blitz.display.sh set-display hdmi
}
# command: lcd
function lcd() {
echo "# SWITCHING VIDEO OUTPUT TO --> LCD"
sudo /home/admin/config.scripts/blitz.lcd.sh hdmi off
sudo /home/admin/config.scripts/blitz.display.sh set-display lcd
}
# command: headless
function headless() {
echo "# SWITCHING VIDEO OUTPUT TO --> HEADLESS"
sudo /home/admin/config.scripts/blitz.display.sh set-display headless
}
# command: manage

View File

@ -0,0 +1,543 @@
#!/bin/bash
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "# make changes to the LCD screen"
echo "# blitz.display.sh rotate [on|off]"
echo "# blitz.display.sh image [path]"
echo "# blitz.display.sh qr [datastring]"
echo "# blitz.display.sh qr-console [datastring]"
echo "# blitz.display.sh hide"
echo "# blitz.display.sh hdmi [on|off] ---> DEPRECATED use set-display"
echo "# blitz.display.sh test-lcd-connect"
echo "# blitz.display.sh set-display [hdmi|lcd|headless]"
exit 1
fi
# load config
source /home/admin/raspiblitz.info 2>/dev/null
source /mnt/hdd/raspiblitz.conf 2>/dev/null
# Make sure needed packages are installed
if [ $(sudo dpkg-query -l | grep "ii fbi" | wc -l) = 0 ]; then
sudo apt-get install fbi -y > /dev/null
fi
if [ $(sudo dpkg-query -l | grep "ii qrencode" | wc -l) = 0 ]; then
sudo apt-get install qrencode -y > /dev/null
fi
# 1. Parameter: lcd command
command=$1
# check if LCD (/dev/fb1) or HDMI (/dev/fb0)
# see https://github.com/rootzoll/raspiblitz/pull/1580
# but basically this just says if the driver for GPIO LCD is installed - not if connected
lcdExists=$(sudo ls /dev/fb1 2>/dev/null | grep -c "/dev/fb1")
##################
# ROTATE
# see issue: https://github.com/rootzoll/raspiblitz/issues/681
###################
if [ "${command}" == "rotate" ]; then
# TURN ROTATE ON (the new default)
if [ "$2" = "1" ] || [ "$2" = "on" ]; then
# add default 'lcdrotate' raspiblitz.conf if needed
if [ ${#lcdrotate} -eq 0 ]; then
echo "lcdrotate=0" >> /mnt/hdd/raspiblitz.conf
fi
# change rotation config
echo "# Turn ON: LCD ROTATE"
sudo sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=90/g" /boot/config.txt
sudo rm /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null
# update raspiblitz conf file
sudo sed -i "s/^lcdrotate=.*/lcdrotate=1/g" /mnt/hdd/raspiblitz.conf
echo "# OK - a restart is needed: sudo shutdown -r now"
# TURN ROTATE OFF
elif [ "$2" = "0" ] || [ "$2" = "off" ]; then
# change rotation config
echo "#Turn OFF: LCD ROTATE"
sudo sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=270/g" /boot/config.txt
# if touchscreen is on
if [ "${touchscreen}" = "1" ]; then
echo "# also rotate touchscreen ..."
cat << EOF | sudo tee /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
EOF
fi
# update raspiblitz conf file
sudo sed -i "s/^lcdrotate=.*/lcdrotate=0/g" /mnt/hdd/raspiblitz.conf
echo "OK - a restart is needed: sudo shutdown -r now"
else
echo "error='missing second parameter - see help'"
exit 1
fi
exit 0
fi
###################
# IMAGE
###################
if [ "${command}" == "image" ]; then
imagePath=$2
if [ ${#imagePath} -eq 0 ]; then
echo "error='missing second parameter - see help'"
exit 1
else
# test the image path - if file exists
if [ -f "$imagePath" ]; then
echo "# OK - file exists: ${imagePath}"
else
echo "error='file does not exist'"
exit 1
fi
fi
# see https://github.com/rootzoll/raspiblitz/pull/1580
if [ ${lcdExists} -eq 1 ] ; then
# LCD
sudo fbi -a -T 1 -d /dev/fb1 --noverbose ${imagePath} 2> /dev/null
else
# HDMI
sudo fbi -a -T 1 -d /dev/fb0 --noverbose ${imagePath} 2> /dev/null
fi
exit 0
fi
###################
# QR CODE
###################
if [ "${command}" == "qr" ]; then
datastring=$2
if [ ${#datastring} -eq 0 ]; then
echo "error='missing second parameter - see help'"
exit 1
fi
qrencode -l L -o /home/admin/qr.png "${datastring}" > /dev/null
# see https://github.com/rootzoll/raspiblitz/pull/1580
if [ ${lcdExists} -eq 1 ] ; then
# LCD
sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/qr.png 2> /dev/null
else
# HDMI
sudo fbi -a -T 1 -d /dev/fb0 --noverbose /home/admin/qr.png 2> /dev/null
fi
exit 0
fi
###################
# QR CODE KONSOLE
# fallback if no LCD is available
###################
if [ "${command}" == "qr-console" ]; then
datastring=$2
if [ ${#datastring} -eq 0 ]; then
echo "error='missing second parameter - see help'"
exit 1
fi
whiptail --title "Get ready" --backtitle "QR-Code in Terminal Window" --msgbox "Make this terminal window as large as possible - fullscreen would be best. \n\nThe QR-Code might be too large for your display. In that case, shrink the letters by pressing the keys Ctrl and Minus (or Cmd and Minus if you are on a Mac) \n\nPRESS ENTER when you are ready to see the QR-code." 15 60
clear
qrencode -t ANSI256 ${datastring}
echo "(To shrink QR code: macOS press CMD- / LINUX press CTRL-) Press ENTER when finished."
read key
clear
exit 0
fi
###################
# HIDE
###################
if [ "${command}" == "hide" ]; then
sudo killall -3 fbi
shred -u /home/admin/qr.png 2> /dev/null
exit 0
fi
###################
# TEST LCD CONNECT
# only tested on RaspiOS 64-bit with RaspberryPi 4
# https://github.com/rootzoll/raspiblitz/issues/1265#issuecomment-813660030
###################
if [ "${command}" == "test-lcd-connect" ]; then
echo "# IMPORTANT --> just gives correct value first time called after boot"
source <(sudo python /home/admin/config.scripts/blitz.gpio.py in 17)
if [ "${pinValue}" == "1" ]; then
echo "gpioLcdConnected=1"
elif [ "${pinValue}" == "0" ]; then
echo "gpioLcdConnected=0"
else
echo "# FAIL: only works on raspiOS 64-bit & RaspberryPi 4"
echo "# test directly with --> sudo python /home/admin/config.scripts/blitz.gpio.py in 17"
echo "err='detection not possible'"
exit 1
fi
exit 0
fi
###############################
# HDMI (deprecated - redirect)
###############################
if [ "${command}" == "hdmi" ]; then
secondParameter=$2
if [ "${secondParameter}" == "on" ]; then
sudo /home/admin/config.scripts/blitz.display.sh set-display hdmi
elif [ "${secondParameter}" == "off" ]; then
sudo /home/admin/config.scripts/blitz.display.sh set-display lcd
else
echo "error='unkown second parameter'"
exit 1
fi
exit 0
fi
#######################################
# DISPLAY TYPED INSTALLS & UN-INSTALLS
# HDMI is the default - every added
# displayClass needs a install fuction
# and a uninstall function back to HDMI
#######################################
function install_hdmi() {
echo "# nothing to install - hdmi is the default/clean mode"
}
function uninstall_hdmi() {
echo "# nothing to uninstall - hdmi is the default/clean mode"
}
function install_lcd() {
if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian_rpi64" ]; then
echo "# INSTALL 64bit LCD DRIVER"
# hold bootloader
sudo apt-mark hold raspberrypi-bootloader
# Downloading LCD Driver from Github
cd /home/admin/
sudo -u admin git clone 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
cd /home/admin/wavesharelcd-64bit-rpi
sudo -u admin git reset --hard 5a206a7 || exit 1
# customized from https://github.com/tux1c/wavesharelcd-64bit-rpi/blob/master/install.sh
# prepare X11
sudo mkdir -p /etc/X11/xorg.conf.d
sudo mv /etc/X11/xorg.conf.d/40-libinput.conf /home/admin/wavesharelcd-64bit-rpi/40-libinput.conf 2>/dev/null
sudo 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
sudo cp ./waveshare35a.dtbo /boot/overlays/
# modify /boot/config.txt
sudo sed -i "s/^hdmi_force_hotplug=.*//g" /boot/config.txt
echo "hdmi_force_hotplug=1" >> /boot/config.txt
sudo sed -i "s/^dtparam=i2c_arm=.*//g" /boot/config.txt
# echo "dtparam=i2c_arm=on" >> /boot/config.txt --> this is to be called I2C errors - see: https://github.com/rootzoll/raspiblitz/issues/1058#issuecomment-739517713
# don't enable SPI and UART ports by default
# echo "dtparam=spi=on" >> /boot/config.txt
# echo "enable_uart=1" >> /boot/config.txt
sudo sed -i "s/^dtoverlay=.*//g" /boot/config.txt
echo "dtoverlay=waveshare35a:rotate=90" >> /boot/config.txt
# modify cmdline.txt
modification="dwc_otg.lpm_enable=0 quiet fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo"
containsModification=$(sudo grep -c "${modification}" /boot/cmdline.txt)
if [ ${containsModification} -eq 0 ]; then
echo "# adding modification to /boot/cmdline.txt"
cmdlineContent=$(sudo cat /boot/cmdline.txt)
echo "${cmdlineContent} ${modification}" > /boot/cmdline.txt
else
echo "# /boot/cmdline.txt already contains modification"
fi
containsModification=$(sudo grep -c "${modification}" /boot/cmdline.txt)
if [ ${containsModification} -eq 0 ]; then
echo "# FAIL: was not able to mofify /boot/cmdline.txt"
echo "err='ended unclear state'"
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
# TODO manual touchscreen calibration option
# https://github.com/tux1c/wavesharelcd-64bit-rpi#adapting-guide-to-other-lcds
# set font that fits the LCD screen
# https://github.com/rootzoll/raspiblitz/issues/244#issuecomment-476713706
# there can be a different font for different types of LCDs with using the displayType parameter in the future
sudo setfont /usr/share/consolefonts/Uni3-TerminusBold16.psf.gz
echo "# OK install of LCD done ... reboot needed"
else
echo "err='baseimage not supported'"
exit 1
fi
}
function uninstall_lcd() {
if [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian_rpi64" ]; then
echo "# UNINSTALL 64bit LCD DRIVER"
# hold bootloader
sudo apt-mark hold raspberrypi-bootloader
# make sure xinput-calibrator is installed
sudo apt-get install -y xinput-calibrator
# remove modifications of config.txt
sudo sed -i "s/^hdmi_force_hotplug=.*//g" /boot/config.txt
sudo sed -i "s/^dtoverlay=.*//g" /boot/config.txt
echo "dtoverlay=pi3-disable-bt" >> /boot/config.txt
echo "dtoverlay=disable-bt" >> /boot/config.txt
# remove modification of cmdline.txt
sudo sed -i "s/ dwc_otg.lpm_enable=0 quiet fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo//g" /boot/cmdline.txt
# un-prepare X11
sudo mv /home/admin/wavesharelcd-64bit-rpi/40-libinput.conf /etc/X11/xorg.conf.d/40-libinput.conf 2>/dev/null
sudo rm -rf /etc/X11/xorg.conf.d/99-calibration.conf
# remove github code of LCD drivers
sudo rm -r /home/admin/wavesharelcd-64bit-rpi
echo "# OK uninstall LCD done ... reboot needed"
else
echo "err='baseimage not supported'"
exit 1
fi
}
# not being used - can be deleted after mid 2021
function install_lcd_legacy() {
if [ "${baseimage}" = "raspbian" ] || [ "${baseimage}" = "dietpi" ]; then
echo "*** 32bit LCD DRIVER ***"
echo "--> Downloading LCD Driver from Github"
cd /home/admin/
sudo -u admin git clone https://github.com/MrYacha/LCD-show.git
sudo -u admin chmod -R 755 LCD-show
sudo -u admin chown -R admin:admin LCD-show
cd LCD-show/
sudo -u admin git reset --hard 53dd0bf || exit 1
# install xinput calibrator package
echo "--> install xinput calibrator package"
sudo apt install -y libxi6
sudo dpkg -i xinput-calibrator_0.7.5-1_armhf.deb
if [ "${baseimage}" = "dietpi" ]; then
echo "--> dietpi preparations"
sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo mkdir /etc/X11/xorg.conf.d
sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/
sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/tft35a.dtbo
sudo cp -rf ./usr/99-calibration.conf-35 /etc/X11/xorg.conf.d/99-calibration.conf
sudo cp -rf ./usr/99-fbturbo.conf /usr/share/X11/xorg.conf.d/
sudo cp ./usr/cmdline.txt /DietPi/
sudo cp ./usr/inittab /etc/
sudo cp ./boot/config-35.txt /DietPi/config.txt
# make LCD screen rotation correct
sudo sed -i "s/dtoverlay=tft35a/dtoverlay=tft35a:rotate=270/" /DietPi/config.txt
fi
elif [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian_rpi64" ]; then
echo "*** 64bit LCD DRIVER ***"
echo "--> Downloading LCD Driver from Github"
cd /home/admin/
sudo -u admin git clone 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
cd /home/admin/wavesharelcd-64bit-rpi
sudo -u admin git reset --hard 5a206a7 || exit 1
# from https://github.com/tux1c/wavesharelcd-64bit-rpi/blob/master/install.sh
# prepare X11
sudo rm -rf /etc/X11/xorg.conf.d/40-libinput.conf
sudo mkdir -p /etc/X11/xorg.conf.d
sudo 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
sudo cp ./waveshare35a.dtbo /boot/overlays/
# modify /boot/config.txt
sudo sed -i "s/^hdmi_force_hotplug=.*//g" /boot/config.txt
echo "hdmi_force_hotplug=1" >> /boot/config.txt
sudo sed -i "s/^dtparam=i2c_arm=.*//g" /boot/config.txt
echo "dtparam=i2c_arm=on" >> /boot/config.txt
# don't enable SPI and UART ports by default
# echo "dtparam=spi=on" >> /boot/config.txt
# echo "enable_uart=1" >> /boot/config.txt
sudo sed -i "s/^dtoverlay=.*//g" /boot/config.txt
echo "dtoverlay=waveshare35a:rotate=90" >> /boot/config.txt
# use modified cmdline.txt
sudo cp ./cmdline.txt /boot/
# 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
# TODO manual touchscreen calibration option
# https://github.com/tux1c/wavesharelcd-64bit-rpi#adapting-guide-to-other-lcds
fi
# activate LCD and trigger reboot
# dont do this on dietpi to allow for automatic build
if [ "${baseimage}" = "raspbian" ]; then
echo "Installing 32-bit LCD drivers ..."
sudo chmod +x -R /home/admin/LCD-show
cd /home/admin/LCD-show/
sudo apt-mark hold raspberrypi-bootloader
sudo ./LCD35-show
elif [ "${baseimage}" = "raspios_arm64" ] || [ "${baseimage}" = "debian_rpi64" ]; then
echo "Installing 64-bit LCD drivers ..."
sudo chmod +x -R /home/admin/wavesharelcd-64bit-rpi
cd /home/admin/wavesharelcd-64bit-rpi
sudo apt-mark hold raspberrypi-bootloader
sudo ./install.sh
else
echo "Use 'sudo reboot' to restart manually."
fi
}
function install_headless() {
if [ "${baseimage}" = "raspbian" ]||[ "${baseimage}" = "raspios_arm64" ]|| [ "${baseimage}" = "debian_rpi64" ]; then
modificationExists=$(sudo cat /etc/systemd/system/getty@tty1.service.d/autologin.conf | grep -c "autologin pi")
if [ "${modificationExists}" == "1" ]; then
echo "# deactivating auto-login of pi user"
# set Raspi to deactivate auto-login (will delete /etc/systemd/system/getty@tty1.service.d/autologin.conf)
sudo raspi-config nonint do_boot_behaviour B1
else
echo "# auto-login of pi user is already deactivated"
fi
else
echo "err='baseimage not supported'"
exit 1
fi
}
function uninstall_headless() {
if [ "${baseimage}" = "raspbian" ]||[ "${baseimage}" = "raspios_arm64" ]|| [ "${baseimage}" = "debian_rpi64" ]; then
modificationExists=$(sudo cat /etc/systemd/system/getty@tty1.service.d/autologin.conf | grep -c "autologin pi")
if [ "${modificationExists}" == "0" ]; then
echo "# activating auto-login of pi user again"
# set Raspi to boot up automatically with user pi (for the LCD)
# https://www.raspberrypi.org/forums/viewtopic.php?t=21632
sudo raspi-config nonint do_boot_behaviour B2
sudo bash -c "echo '[Service]' >> /etc/systemd/system/getty@tty1.service.d/autologin.conf"
sudo bash -c "echo 'ExecStart=' >> /etc/systemd/system/getty@tty1.service.d/autologin.conf"
sudo bash -c "echo 'ExecStart=-/sbin/agetty --autologin pi --noclear %I 38400 linux' >> /etc/systemd/system/getty@tty1.service.d/autologin.conf"
else
echo "# auto-login of pi user already active"
fi
else
echo "err='baseimage not supported'"
exit 1
fi
}
function prepareDisplayClassEntryRaspiblitzConf() {
# check if file exists / hdd is mounted
if [ -f "/mnt/hdd/raspiblitz.conf" ]; then
echo "file does exists"
entryExists=$(grep -c "displayClass=" /mnt/hdd/raspiblitz.conf)
if [ ${entryExists} -eq 0 ]; then
echo "displayClass=${displayClass}" >> /mnt/hdd/raspiblitz.conf
fi
else
echo "# /mnt/hdd/raspiblitz.conf does not exists (yet) - change is just part of raspiblitz.info"
fi
}
###################
# SET DISPLAY TYPE
###################
if [ "${command}" == "set-display" ]; then
paramDisplayClass=$2
paramDisplayType=$3
echo "# blitz.display.sh set-display ${paramDisplayClass} ${paramDisplayType}"
# check if started with sudo
if [ "$EUID" -ne 0 ]; then
echo "error='missing sudo'"
exit 1
fi
if [ "${paramDisplayClass}" == "" ]; then
echo "err='missing parameter'"
exit 1
elif [ "${paramDisplayClass}" == "${displayClass}" ]; then
# normally dont make any changes here - but it can be the case that this called by recover/update process
# where raspiblitz.info (base image) raspiblitz.conf (user config) have different values - check fo this case:
confAndInfoValueIsSame=$(sudo cat /home/admin/raspiblitz.info | grep -c "displayClass=${paramDisplayClass}}")
if [ "${confAndInfoValueIsSame}" == "0" ]; then
echo "# raspiblitz.info is different from raspiblitz.conf --> enforcing ${displayClass} for both"
source /home/admin/raspiblitz.info
# continue with the raspiblitz.info value of displayClass as actual state (not the overwritten one from raspiblitz.conf)
else
echo "# raspiblitz.info (AND raspiblitz.conf) already running ${displayClass} - no need for change"
exit 1
fi
fi
if [ "${paramDisplayClass}" == "hdmi" ] || [ "${paramDisplayClass}" == "lcd" ] || [ "${paramDisplayClass}" == "headless" ]; then
# uninstall old state
uninstall_$displayClass
# install new state
install_$paramDisplayClass
else
echo "err='unknown parameter'"
exit 1
fi
# mark new display class in configs
prepareDisplayClassEntryRaspiblitzConf
sudo sed -i "s/^displayClass=.*/displayClass=${paramDisplayClass}/g" /home/admin/raspiblitz.info
sudo sed -i "s/^displayClass=.*/displayClass=${paramDisplayClass}/g" /mnt/hdd/raspiblitz.conf 2>/dev/null
exit 0
fi
# unknown command
echo "error='unkown command'"
exit 1

View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import RPi.GPIO as GPIO
if len(sys.argv) <= 2 or sys.argv[1] in ["-h", "--help", "help"]:
print ("# IMPORTANT: call with SUDO")
print ("# read inputs on raspberryPi GPIO pins")
print ("# blitz.gpio.py in [pinnumber]")
print ("err='missing parameters'")
sys.exit(1)
if sys.argv[2].isdigit() and int(sys.argv[2])>0 and int(sys.argv[2])<=40:
GPIO.setmode(GPIO.BCM)
GPIO.setup(int(sys.argv[2]),GPIO.IN)
print ("pinValue", end="=")
print (GPIO.input(int(sys.argv[2])))
GPIO.cleanup()
else:
print ("err='not a valid pin number between 1 and 40'")
sys.exit(1)

View File

@ -1,284 +0,0 @@
#!/bin/bash
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "# make changes to the LCD screen"
echo "# blitz.lcd.sh check-repair"
echo "# blitz.lcd.sh rotate [on|off]"
echo "# blitz.lcd.sh image [path]"
echo "# blitz.lcd.sh qr [datastring]"
echo "# blitz.lcd.sh qr-console [datastring]"
echo "# blitz.lcd.sh hide"
echo "# blitz.lcd.sh hdmi [on|off]"
exit 1
fi
# load config
source /home/admin/raspiblitz.info 2>/dev/null
source /mnt/hdd/raspiblitz.conf 2>/dev/null
# Make sure needed packages are installed
if [ $(sudo dpkg-query -l | grep "ii fbi" | wc -l) = 0 ]; then
sudo apt-get install fbi -y > /dev/null
fi
if [ $(sudo dpkg-query -l | grep "ii qrencode" | wc -l) = 0 ]; then
sudo apt-get install qrencode -y > /dev/null
fi
# 1. Parameter: lcd command
command=$1
# check if its updated kernel version of v1.6 base image
oldKernel=$(uname -srm | cut -d ' ' -f2 | cut -d '-' -f1 | grep -c '4.19.118')
oldDrivers=$(sudo cat /home/admin/LCD-show/.git/config 2>/dev/null | grep -c 'github.com/goodtft/LCD')
# check if LCD (/dev/fb1) or HDMI (/dev/fb0)
# see https://github.com/rootzoll/raspiblitz/pull/1580
lcdExists=$(sudo ls /dev/fb1 2>/dev/null | grep -c "/dev/fb1")
###################
# CHECK-REPAIR
# make sure that LCD drivers match linux kernel
# see issue: https://github.com/rootzoll/raspiblitz/pull/1490
###################
if [ "${command}" == "check-repair" ]; then
echo "# blitz.lcd.sh check-repair"
if [ ${oldKernel} -eq 1 ]; then
echo "# --> old kernel detected - no need to update LCD drivers."
else
echo "# --> new kernel detected - checking if LCD driver needs update ..."
if [ ${oldDrivers} -eq 1 ]; then
echo "# --> old LCD driver detected - starting update ..."
sudo rm -rf /home/admin/LCD-show
cd /home/admin
sudo -u admin git clone https://github.com/MrYacha/LCD-show.git
sudo -u admin chmod -R 755 LCD-show
sudo -u admin chown -R admin:admin LCD-show
cd /home/admin/LCD-show
sudo -u admin git reset --hard b012c487669afd3e997fc63fcc097d45a5a6a34e
echo "# --> correcting rotate setting"
if [ "${lcdrotate}" == "on" ]; then
sudo sed -i "s/^dtoverlay=.*/dtoverlay=tft35a:rotate=90/g" /boot/config.txt
else
sudo sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=270/g" /boot/config.txt
fi
echo "# --> restart to acrivate new driver"
chmod +x ./LCD35-show
sudo ./LCD35-show
sudo shutdown -r now
else
echo "# --> new LCD driver detected - no need to update LCD drivers."
fi
exit
fi
###################
# ROTATE
# see issue: https://github.com/rootzoll/raspiblitz/issues/681
###################
elif [ "${command}" == "rotate" ]; then
# TURN ROTATE ON (the new default)
if [ "$2" = "1" ] || [ "$2" = "on" ]; then
echo "# Turn ON: LCD ROTATE"
# add default 'lcdrotate' raspiblitz.conf if needed
if [ ${#lcdrotate} -eq 0 ]; then
echo "lcdrotate=0" >> /mnt/hdd/raspiblitz.conf
fi
if [ ${oldDrivers} -eq 1 ]; then
sudo sed -i "s/^dtoverlay=.*/dtoverlay=tft35a:rotate=90/g" /boot/config.txt
# if touchscreen is on
if [ "${touchscreen}" = "1" ]; then
echo "Also rotate touchscreen ..."
cat << EOF | sudo tee /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
EOF
fi
else
sudo sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=90/g" /boot/config.txt
# delete possible touchscreen rotate
sudo rm /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null
fi
sudo sed -i "s/^lcdrotate=.*/lcdrotate=1/g" /mnt/hdd/raspiblitz.conf
echo "# OK - a restart is needed: sudo shutdown -r now"
# TURN ROTATE OFF
elif [ "$2" = "0" ] || [ "$2" = "off" ]; then
echo "#Turn OFF: LCD ROTATE"
if [ ${oldDrivers} -eq 1 ]; then
sudo sed -i "s/^dtoverlay=.*/dtoverlay=tft35a:rotate=270/g" /boot/config.txt
# delete possible touchscreen rotate
sudo rm /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null
else
sudo sed -i "s/^dtoverlay=.*/dtoverlay=waveshare35a:rotate=270/g" /boot/config.txt
# if touchscreen is on
if [ "${touchscreen}" = "1" ]; then
echo "Also rotate touchscreen ..."
cat << EOF | sudo tee /etc/X11/xorg.conf.d/40-libinput.conf >/dev/null
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
EOF
fi
fi
sudo sed -i "s/^lcdrotate=.*/lcdrotate=0/g" /mnt/hdd/raspiblitz.conf
echo "OK - a restart is needed: sudo shutdown -r now"
else
echo "error='missing second parameter - see help'"
exit 1
fi
exit 0
fi
###################
# IMAGE
###################
if [ "${command}" == "image" ]; then
imagePath=$2
if [ ${#imagePath} -eq 0 ]; then
echo "error='missing second parameter - see help'"
exit 1
else
# test the image path - if file exists
if [ -f "$imagePath" ]; then
echo "# OK - file exists: ${imagePath}"
else
echo "error='file does not exist'"
exit 1
fi
fi
# see https://github.com/rootzoll/raspiblitz/pull/1580
if [ ${lcdExists} -eq 1 ] ; then
# LCD
sudo fbi -a -T 1 -d /dev/fb1 --noverbose ${imagePath} 2> /dev/null
else
# HDMI
sudo fbi -a -T 1 -d /dev/fb0 --noverbose ${imagePath} 2> /dev/null
fi
exit 0
fi
###################
# QR CODE
###################
if [ "${command}" == "qr" ]; then
datastring=$2
if [ ${#datastring} -eq 0 ]; then
echo "error='missing second parameter - see help'"
exit 1
fi
qrencode -l L -o /home/admin/qr.png "${datastring}" > /dev/null
# see https://github.com/rootzoll/raspiblitz/pull/1580
if [ ${lcdExists} -eq 1 ] ; then
# LCD
sudo fbi -a -T 1 -d /dev/fb1 --noverbose /home/admin/qr.png 2> /dev/null
else
# HDMI
sudo fbi -a -T 1 -d /dev/fb0 --noverbose /home/admin/qr.png 2> /dev/null
fi
exit 0
fi
###################
# QR CODE KONSOLE
# fallback if no LCD is available
###################
if [ "${command}" == "qr-console" ]; then
datastring=$2
if [ ${#datastring} -eq 0 ]; then
echo "error='missing second parameter - see help'"
exit 1
fi
whiptail --title "Get ready" --backtitle "QR-Code in Terminal Window" --msgbox "Make this terminal window as large as possible - fullscreen would be best. \n\nThe QR-Code might be too large for your display. In that case, shrink the letters by pressing the keys Ctrl and Minus (or Cmd and Minus if you are on a Mac) \n\nPRESS ENTER when you are ready to see the QR-code." 15 60
clear
qrencode -t ANSI256 ${datastring}
echo "(To shrink QR code: macOS press CMD- / LINUX press CTRL-) Press ENTER when finished."
read key
clear
exit 0
fi
###################
# HIDE
###################
if [ "${command}" == "hide" ]; then
sudo killall -3 fbi
shred -u /home/admin/qr.png 2> /dev/null
exit 0
fi
###################
# HDMI
# see https://github.com/rootzoll/raspiblitz/issues/767
# see https://www.waveshare.com/wiki/3.5inch_RPi_LCD_%28A%29
###################
if [ "${command}" == "hdmi" ]; then
# make sure that the config entry exists
if [ $(cat /mnt/hdd/raspiblitz.conf 2>/dev/null| grep -c 'lcd2hdmi=') -eq 0 ]; then
echo "lcd2hdmi=off" >> /mnt/hdd/raspiblitz.conf 2>/dev/null
fi
secondParameter=$2
if [ "${secondParameter}" == "on" ]; then
sudo sed -i 's/^lcd2hdmi=.*/lcd2hdmi=on/g' /home/admin/raspiblitz.info 2>/dev/null
sudo sed -i 's/^lcd2hdmi=.*/lcd2hdmi=on/g' /mnt/hdd/raspiblitz.conf 2>/dev/null
cd /home/admin/LCD-show
./LCD-hdmi
elif [ "${secondParameter}" == "off" ]; then
sudo sed -i 's/^lcd2hdmi=.*/lcd2hdmi=off/g' /home/admin/raspiblitz.info 2>/dev/null
sudo sed -i 's/^lcd2hdmi=.*/lcd2hdmi=off/g' /mnt/hdd/raspiblitz.conf 2>/dev/null
cd /home/admin/LCD-show
./LCD35-show
else
echo "error='unkown second parameter'"
exit 1
fi
exit 0
fi
# unknown command
echo "error='unkown command'"
exit 1

View File

@ -89,7 +89,7 @@ migrate_raspiblitz_conf () {
echo "network=bitcoin" >> /home/admin/raspiblitz.conf
echo "chain=main" >> /home/admin/raspiblitz.conf
echo "hostname=${nodename}" >> /home/admin/raspiblitz.conf
echo "lcd2hdmi=on" >> /home/admin/raspiblitz.conf
echo "displayClass=hdmi" >> /home/admin/raspiblitz.conf
echo "lcdrotate=1" >> /home/admin/raspiblitz.conf
echo "runBehindTor=on" >> /home/admin/raspiblitz.conf
sudo mv /home/admin/raspiblitz.conf /mnt/hdd/raspiblitz.conf
@ -169,12 +169,16 @@ fi
########################
# MIGRATION from myNode
# see manual steps: https://btc21.de/bitcoin/raspiblitz-migration/
########################
if [ "$1" = "migration-mynode" ]; then
source <(sudo /home/admin/config.scripts/blitz.datadrive.sh status)
echo "IMPORTANT TODO -> take care about lnd wallet password - see: https://btc21.de/bitcoin/raspiblitz-migration/"
exit 1
# can olny migrate unmonted data disks
if [ "${isMounted}" == "1" ]; then
echo "err='cannot migrate mounted drive'"

View File

@ -155,8 +155,8 @@ if [ "$1" = "calibrate" ]; then
# check that touchscreen is on
if [ "${touchscreen}" == "1" ]; then
echo "# calibrating touchscreen ..."
echo "error='not installed'"
else
echo "error='not installed'"
exit 1
fi

View File

@ -38,7 +38,7 @@ This can take multiple hours.
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
/home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title " BTC-RPC-Explorer " --msgbox "Open in your local web browser & accept self-signed cert:
https://${localip}:3021\n
SHA1 Thumb/Fingerprint:
@ -47,7 +47,7 @@ Login is 'admin' with your Password B\n
Hidden Service address for TOR Browser (QR see LCD):
${toraddress}
" 16 67
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
else
# IP + Domain

View File

@ -122,7 +122,7 @@ port forwarding on router needs to be active & may change port"
SHA1 ${sslFingerprintIP}"
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
/home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
text="${text}\n
TOR Browser Hidden Service address (see the QR onLCD):
${toraddress}"
@ -149,7 +149,7 @@ MAINMENU > LNDCREDS > EXPORT > BTCPay Server"
whiptail --title " BTCPay Server " --msgbox "${text}" 17 69
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
echo "# please wait ..."
exit 0
fi

View File

@ -54,7 +54,7 @@ if [ "$1" = "menu" ]; then
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
/home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title " Cryptoadvance Specter " --msgbox "Open in your local web browser & accept self-signed cert:
https://${localip}:25441
@ -67,7 +67,7 @@ Hidden Service address for TOR Browser (QR see LCD):
https://${toraddress}
Unfortunately the camera is currently not usable via Tor, though.
" 18 74
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
else
# IP + Domain

View File

@ -200,7 +200,7 @@ Check 'sudo nginx -t' for a detailed error message.
echo
echo "To connect through TOR open the Tor Browser and start with the options:"
echo "electrum --oneserver --server ${TORaddress}:50002:s --proxy socks5:127.0.0.1:9150"
/home/admin/config.scripts/blitz.lcd.sh qr "${TORaddress}"
/home/admin/config.scripts/blitz.display.sh qr "${TORaddress}"
fi
echo
echo "For more details check the RaspiBlitz README on ElectRS:"
@ -208,7 +208,7 @@ Check 'sudo nginx -t' for a detailed error message.
echo
echo "Press ENTER to get back to main menu."
read key
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
;;
STATUS)
sudo /home/admin/config.scripts/bonus.electrs.sh status

View File

@ -18,11 +18,11 @@ hiddenService=$(sudo cat /mnt/hdd/tor/bitcoin8332/hostname)
quickConnect="btcstandup://$RPC_USER:$PASSWORD_B@$hiddenService:8332/?label=$hostname"
echo ""
echo "scan the QR Code with Fully Noded to connect to your node:"
/home/admin/config.scripts/blitz.lcd.sh qr "${quickConnect}"
/home/admin/config.scripts/blitz.display.sh qr "${quickConnect}"
qrencode -t ANSI256 $quickConnect
echo "Press ENTER to return to the menu"
read key
# clean up
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
clear

View File

@ -35,7 +35,7 @@ if [ "$1" = "menu" ]; then
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# Info with TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
/home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title " Lightning Terminal " --msgbox "Open in your local web browser & accept self-signed cert:
https://${localip}:8443\n
SHA1 Thumb/Fingerprint:
@ -46,7 +46,7 @@ https://${toraddress}\n
For the command line switch to 'lit' user with: 'sudo su - lit'
use the commands: 'lncli', 'lit-loop', 'lit-pool' and 'lit-frcli'.
" 19 74
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
else
# Info without TOR
whiptail --title " Lightning Terminal " --msgbox "Open in your local web browser & accept self-signed cert:

View File

@ -45,7 +45,7 @@ port forwarding on router needs to be active & may change port"
SHA1 ${sslFingerprintIP}"
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
/home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
text="${text}\n
TOR Browser Hidden Service address (QR see LCD):
${toraddress}"
@ -68,7 +68,7 @@ consider adding a IP2TOR Bridge (MAINMENU > SUBSCRIBE)."
whiptail --title " LNbits " --msgbox "${text}" 15 69
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
echo "please wait ..."
exit 0
fi

View File

@ -189,7 +189,7 @@ fi
lndconnect="lndconnect://${host}:${port}${macaroonParameter}${certParameter}"
# display qr code image on LCD
/home/admin/config.scripts/blitz.lcd.sh qr "${lndconnect}"
/home/admin/config.scripts/blitz.display.sh qr "${lndconnect}"
# show pairing info dialog
msg=""
@ -216,7 +216,7 @@ if [ $? -eq 1 ]; then
fi
# clean up
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
echo "------------------------------"
echo "If the connection was not working:"

View File

@ -39,7 +39,7 @@ This can take multiple hours.
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
/home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title " Mempool " --msgbox "Open in your local web browser & accept self-signed cert:
https://${localip}:4081\n
SHA1 Thumb/Fingerprint:
@ -47,7 +47,7 @@ ${fingerprint}\n
Hidden Service address for TOR Browser (QR see LCD):
${toraddress}
" 16 67
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
else
# IP + Domain

View File

@ -28,7 +28,7 @@ if [ "$1" = "menu" ]; then
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# Info with TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
/home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title " Ride The Lightning (RTL) " --msgbox "Open in your local web browser & accept self-signed cert:
https://${localip}:3001\n
SHA1 Thumb/Fingerprint:
@ -36,7 +36,7 @@ ${fingerprint}\n
Use your Password B to login.\n
Hidden Service address for TOR Browser (QRcode on LCD):\n${toraddress}
" 16 67
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
else
# Info without TOR
whiptail --title " Ride The Lightning (RTL) " --msgbox "Open in your local web browser & accept self-signed cert:

View File

@ -133,7 +133,7 @@ ${publicURL}"
fi
# show qr code on LCD & console
/home/admin/config.scripts/blitz.lcd.sh qr "${connectionCode}"
/home/admin/config.scripts/blitz.display.sh qr "${connectionCode}"
whiptail --title " Connect App with Sphinx Relay " \
--yes-button "Done" \
--no-button "Show QR Code" \
@ -149,7 +149,7 @@ ${extraPairInfo}" 16 70
read key
fi
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
exit 0
fi

View File

@ -29,7 +29,7 @@ if [ "$1" = "menu" ]; then
if [ "${runBehindTor}" = "on" ] && [ ${#toraddress} -gt 0 ]; then
# Info with TOR
/home/admin/config.scripts/blitz.lcd.sh qr "${toraddress}"
/home/admin/config.scripts/blitz.display.sh qr "${toraddress}"
whiptail --title " ThunderHub " --msgbox "Open in your local web browser & accept self-signed cert:
https://${localip}:3011\n
SHA1 Thumb/Fingerprint:
@ -37,7 +37,7 @@ ${fingerprint}\n
Use your Password B to login.\n
Hidden Service address for TOR Browser (see LCD for QR):\n${toraddress}
" 16 67
/home/admin/config.scripts/blitz.lcd.sh hide
/home/admin/config.scripts/blitz.display.sh hide
else
# Info without TOR
whiptail --title " ThunderHub " --msgbox "Open in your local web browser & accept self-signed cert: