Hi everyone!
I am running moode on a Zero 2w all tucked inside the Argon Pod Case & Display, I am wondering if anyone else here managed to get the Pod Display to work.
So far, Argon Pod Display installer Script works for the initial setup, but all it displays is the tty1 console messages.
Messing around Configure->Peripherals->Local Display didn't take me very far
Anyone have any ideas to make this 2.8inch touch display more useful ?
Argon's Pod Display Installation Script:
I am running moode on a Zero 2w all tucked inside the Argon Pod Case & Display, I am wondering if anyone else here managed to get the Pod Display to work.
So far, Argon Pod Display installer Script works for the initial setup, but all it displays is the tty1 console messages.
Messing around Configure->Peripherals->Local Display didn't take me very far
Anyone have any ideas to make this 2.8inch touch display more useful ?
Argon's Pod Display Installation Script:
Code:
#!/bin/bash
echo "******************"
echo " ArgonPOD Setup "
echo "******************"
#if [ "$EUID" -ne 0 ]; then
# echo "Please run as root"
# exit
#fi
CHECKGPIOMODE="libgpiod" # libgpiod or rpigpio
# Helper variables
ARGONDOWNLOADSERVER=https://download.argon40.com
INSTALLATIONFOLDER=/etc/argonpod
# Files
tmpfile=$INSTALLATIONFOLDER/tmpfile.bak
configscript=$INSTALLATIONFOLDER/argonpod-config
systembackupfolder=$INSTALLATIONFOLDER/system_backup
# Targetted System Files
if [ -e /boot/firmware/config.txt ] ; then
FIRMWARE=/firmware
else
FIRMWARE=
fi
bootconfigfile=/boot${FIRMWARE}/config.txt
bootcmdlinefile=/boot${FIRMWARE}/cmdline.txt
calibrationfile=/etc/X11/xorg.conf.d/99-calibration.conf
evdevfile=/usr/share/X11/xorg.conf.d/45-evdev.conf
fbturbofile=/usr/share/X11/xorg.conf.d/99-fbturbo.conf
setupmode="Setup"
if [ ! -d "$INSTALLATIONFOLDER" ]
then
tftdevicename=tft9341
tftoverlayfile=/boot/overlays/${tftdevicename}-overlay.dtb
tftoverlayfiledtbo=/boot/overlays/${tftdevicename}.dtbo
sudo mkdir -p $systembackupfolder
sudo chmod -R 755 $INSTALLATIONFOLDER
sudo touch $tmpfile
sudo chmod 666 $tmpfile
# Backup files if necessary
if [ -f "$tftoverlayfile" ]
then
sudo cp $tftoverlayfile $systembackupfolder/
fi
if [ -f "$tftoverlayfiledtbo" ]
then
sudo cp $tftoverlayfiledtbo $systembackupfolder/
fi
if [ -f "$calibrationfile" ]
then
sudo cp $calibrationfile $systembackupfolder/
fi
if [ -f "$evdevfile" ]
then
sudo cp $evdevfile $systembackupfolder/
fi
if [ -f "$fbturbofile" ]
then
sudo cp $fbturbofile $systembackupfolder/
fi
sudo cp $bootconfigfile $systembackupfolder/
sudo cp $bootcmdlinefile $systembackupfolder/
# Download/Create files and folders
if [ ! -d /etc/X11/xorg.conf.d ]; then
sudo mkdir -p /etc/X11/xorg.conf.d
fi
if [ ! -d /usr/share/X11/xorg.conf.d ]; then
sudo mkdir -p /usr/share/X11/xorg.conf.d
fi
sudo wget $ARGONDOWNLOADSERVER/pod/${tftdevicename}-overlay.dtb -O $tmpfile --quiet
sudo cp $tmpfile $tftoverlayfile
sudo cp $tmpfile $tftoverlayfiledtbo
sudo chmod 755 $tftoverlayfile
sudo chmod 755 $tftoverlayfiledtbo
# Disable DRM VC4 V3D driver
grep -v "dtoverlay=vc4-kms-v3d" $bootconfigfile > $tmpfile
grep -v 'dtoverlay=gpio-ir,gpio_pin=23' $tmpfile > $tmpfile
# Update/Add configuration / files
echo "hdmi_force_hotplug=1" >> $tmpfile
echo "dtparam=i2c_arm=on" >> $tmpfile
echo "dtparam=spi=on" >> $tmpfile
echo "enable_uart=1" >> $tmpfile
echo "dtoverlay=${tftdevicename}:rotate=270" >> $tmpfile
echo "hdmi_group=2" >> $tmpfile
echo "hdmi_mode=1" >> $tmpfile
echo "hdmi_mode=87" >> $tmpfile
echo "hdmi_cvt 320 240 60 6 0 0 0" >> $tmpfile
echo "hdmi_drive=2" >> $tmpfile
echo "dtoverlay=gpio-ir,gpio_pin=23" >> $tmpfile
sudo cp $tmpfile $bootconfigfile
# 270-degree orientation touch Setting
echo 'Section "InputClass"' > $tmpfile
echo ' Identifier "calibration"' >> $tmpfile
echo ' MatchProduct "ADS7846 Touchscreen"' >> $tmpfile
echo ' Option "Calibration" "115 3700 3865 155"' >> $tmpfile
echo ' Option "SwapAxes" "1"' >> $tmpfile
echo 'EndSection' >> $tmpfile
sudo cp $tmpfile $calibrationfile
sudo chmod 644 $calibrationfile
echo 'Section "Device"' > $tmpfile
echo ' Identifier "Allwinner A10/A13/A20 FBDEV"' >> $tmpfile
echo ' Driver "fbturbo"' >> $tmpfile
echo ' Option "fbdev" "/dev/fb1"' >> $tmpfile
echo ' Option "SwapbuffersWait" "true"' >> $tmpfile
echo 'EndSection' >> $tmpfile
sudo cp $tmpfile $fbturbofile
sudo chmod 644 $fbturbofile
# xserver input
SYSTEMYEAR=`uname -v`
SYSTEMYEAR=${SYSTEMYEAR##* }
if [ $SYSTEMYEAR -ge 2017 ]
then
sudo apt-get install xserver-xorg-input-evdev 2> $tmpfile
grep -q "error:" $tmpfile && exit
sudo cp /usr/share/X11/xorg.conf.d/10-evdev.conf $evdevfile
fi
else
setupmode="Update"
echo "Updating files"
sudo touch $tmpfile
sudo chmod 666 $tmpfile
fi
grep -q -F 'fbcon' $bootcmdlinefile
if [ $? -ne 0 ]; then
sudo cp $bootcmdlinefile $systembackupfolder/
TMPCMDLINE=$(cat $bootcmdlinefile)
echo "$TMPCMDLINE fbcon=map:10 fbcon=font:ProFont6x11 " | sudo tee $bootcmdlinefile 1> /dev/null
fi
# Argon POD Config File
buttonconfigfile=/etc/argonpod.conf
if [ ! -f $buttonconfigfile ]; then
sudo touch $buttonconfigfile
sudo chmod 666 $buttonconfigfile
echo "#" > $buttonconfigfile
echo "# Argon POD Configuration" >> $buttonconfigfile
echo "#" >> $buttonconfigfile
fi
# Support scripts
versioninfoscript=$INSTALLATIONFOLDER/versioninfo.sh
rotatescript=$INSTALLATIONFOLDER/rotate.sh
buttonsetupscript=$INSTALLATIONFOLDER/buttonsetup.sh
fbcpinstallscript=$INSTALLATIONFOLDER/fbcpinstall.sh
resolutionscript=$INSTALLATIONFOLDER/resolution.sh
uninstallscript=$INSTALLATIONFOLDER/uninstall.sh
daemonpodscript=$INSTALLATIONFOLDER/argonpodd.py
daemonpodservice=/lib/systemd/system/argonpodd.service
shutdownscript=/lib/systemd/system-shutdown/argonpod-shutdown.sh
sudo wget $ARGONDOWNLOADSERVER/pod/versioninfo.sh -O $versioninfoscript --quiet
sudo wget $ARGONDOWNLOADSERVER/pod/rotate.sh -O $rotatescript --quiet
sudo wget $ARGONDOWNLOADSERVER/pod/buttonsetup.sh -O $buttonsetupscript --quiet
sudo wget $ARGONDOWNLOADSERVER/pod/fbcpinstall.sh -O $fbcpinstallscript --quiet
sudo wget $ARGONDOWNLOADSERVER/pod/resolution.sh -O $resolutionscript --quiet
sudo wget $ARGONDOWNLOADSERVER/pod/uninstall.sh -O $uninstallscript --quiet
sudo chmod 755 $INSTALLATIONFOLDER/*.sh
# Packages and main Daemon
gpiopkg="python3-libgpiod"
if [ "$CHECKGPIOMODE" = "rpigpio" ]
then
if [ "$CHECKPLATFORM" = "Raspbian" ]
then
gpiopkg="raspi-gpio python3-rpi.gpio"
else
gpiopkg="python3-rpi.gpio"
fi
sudo wget $ARGONDOWNLOADSERVER/pod/argonpodd.py -O $daemonpodscript --quiet
else
sudo wget $ARGONDOWNLOADSERVER/pod/argonpodd-libgpiod.py -O $daemonpodscript --quiet
fi
sudo apt-get install -y $gpiopkg
# Daemon
sudo wget $ARGONDOWNLOADSERVER/pod/argonpodd.service -O $daemonpodservice --quiet
sudo chmod 644 $daemonpodservice
# Shutdown Script
# Argon Shutdown script
sudo wget $ARGONDOWNLOADSERVER/pod/shutdown.sh -O $shutdownscript --quiet
sudo chmod 755 $shutdownscript
# Config script
echo '#!/bin/bash' > $tmpfile
echo 'echo "----------------------------"' >> $tmpfile
echo 'echo "ArgonPod Configuration Tool"' >> $tmpfile
echo "$versioninfoscript simple" >> $tmpfile
echo 'echo "----------------------------"' >> $tmpfile
echo 'get_number () {' >> $tmpfile
echo ' read curnumber' >> $tmpfile
echo ' if [ -z "$curnumber" ]' >> $tmpfile
echo ' then' >> $tmpfile
echo ' echo "-2"' >> $tmpfile
echo ' return' >> $tmpfile
echo ' elif [[ $curnumber =~ ^[+-]?[0-9]+$ ]]' >> $tmpfile
echo ' then' >> $tmpfile
echo ' if [ $curnumber -lt 0 ]' >> $tmpfile
echo ' then' >> $tmpfile
echo ' echo "-1"' >> $tmpfile
echo ' return' >> $tmpfile
echo ' elif [ $curnumber -gt 100 ]' >> $tmpfile
echo ' then' >> $tmpfile
echo ' echo "-1"' >> $tmpfile
echo ' return' >> $tmpfile
echo ' fi ' >> $tmpfile
echo ' echo $curnumber' >> $tmpfile
echo ' return' >> $tmpfile
echo ' fi' >> $tmpfile
echo ' echo "-1"' >> $tmpfile
echo ' return' >> $tmpfile
echo '}' >> $tmpfile
echo '' >> $tmpfile
echo 'mainloopflag=1' >> $tmpfile
echo 'while [ $mainloopflag -eq 1 ]' >> $tmpfile
echo 'do' >> $tmpfile
echo ' echo' >> $tmpfile
echo ' echo "Choose Option:"' >> $tmpfile
echo ' echo " 1. Rotate Screen"' >> $tmpfile
echo ' echo " 2. Configure Buttons"' >> $tmpfile
echo ' echo " 3. Install Framebuffer Copy (FBCP) Driver"' >> $tmpfile
echo ' echo " 4. Set Resolution (Requires FBCP)"' >> $tmpfile
uninstalloption="5"
echo " echo \" $uninstalloption. Uninstall\"" >> $tmpfile
echo ' echo ""' >> $tmpfile
echo ' echo " 0. Exit"' >> $tmpfile
echo " echo -n \"Enter Number (0-$uninstalloption):\"" >> $tmpfile
echo ' newmode=$( get_number )' >> $tmpfile
echo ' if [ $newmode -eq 0 ]' >> $tmpfile
echo ' then' >> $tmpfile
echo ' echo "Thank you."' >> $tmpfile
echo ' mainloopflag=0' >> $tmpfile
echo ' elif [ $newmode -eq 1 ]' >> $tmpfile
echo ' then' >> $tmpfile
echo " $rotatescript" >> $tmpfile
echo ' mainloopflag=0' >> $tmpfile
echo ' elif [ $newmode -eq 2 ]' >> $tmpfile
echo ' then' >> $tmpfile
echo " $buttonsetupscript" >> $tmpfile
echo ' mainloopflag=0' >> $tmpfile
echo ' elif [ $newmode -eq 3 ]' >> $tmpfile
echo ' then' >> $tmpfile
echo " $fbcpinstallscript" >> $tmpfile
echo ' mainloopflag=0' >> $tmpfile
echo ' elif [ $newmode -eq 4 ]' >> $tmpfile
echo ' then' >> $tmpfile
echo " $resolutionscript" >> $tmpfile
echo ' mainloopflag=0' >> $tmpfile
echo " elif [ \$newmode -eq $uninstalloption ]" >> $tmpfile
echo ' then' >> $tmpfile
echo " $uninstallscript" >> $tmpfile
echo ' mainloopflag=0' >> $tmpfile
echo ' fi' >> $tmpfile
echo 'done' >> $tmpfile
sudo cp $tmpfile $configscript
sudo chmod 755 $configscript
# Add to system path
configcmd="$(basename -- $configscript)"
if [ "$setupmode" = "Setup" ]
then
if [ -f "/usr/bin/$configcmd" ]
then
sudo rm /usr/bin/$configcmd
fi
sudo ln -s $configscript /usr/bin/$configcmd
# Enable and Start Service(s)
sudo systemctl daemon-reload
sudo systemctl enable argonpodd.service
sudo systemctl start argonpodd.service
else
sudo systemctl restart argonpodd.service
fi
if [ -f $tmpfile ]
then
sudo rm $tmpfile
fi
echo "*********************"
echo " $setupmode Completed "
echo "*********************"
$versioninfoscript
echo
if [ "$setupmode" = "Setup" ]
then
echo "Changes should take effect after reboot"
fi
echo "Use '$configcmd' to configure device"
echo