From eaf7123ea5f0271f1316cf0566bd9f6df975278c Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Sat, 1 Feb 2025 01:14:42 -0700 Subject: [PATCH 01/13] VARA - Initial support for WINE and VARA --- overlay/etc/adduser.conf | 2 +- overlay/etc/skel/.bash_profile | 7 +++- overlay/etc/skel/add-ons/wine/.gitignore | 2 + .../skel/add-ons/wine/01-install-wine-deps.sh | 27 ++++++++++++ .../skel/add-ons/wine/02-install-vara-hf.sh | 41 +++++++++++++++++++ .../skel/add-ons/wine/03-install-vara-fm.sh | 41 +++++++++++++++++++ .../add-ons/wine/04-install-vara-terminal.sh | 29 +++++++++++++ .../etc/skel/add-ons/wine/05-run-regedit.sh | 17 ++++++++ .../add-ons/wine/06-backup-wine-install.sh | 32 +++++++++++++++ overlay/etc/skel/add-ons/wine/README.md | 30 ++++++++++++++ .../etc/skel/add-ons/wine/common-checks.sh | 34 +++++++++++++++ overlay/opt/emcomm-tools/bin/et-common | 17 ++++++++ overlay/opt/emcomm-tools/bin/et-user-backup | 3 +- overlay/opt/emcomm-tools/bin/et-vara-fm | 21 ++++++++++ overlay/opt/emcomm-tools/bin/et-vara-hf | 21 ++++++++++ overlay/opt/emcomm-tools/bin/et-vara-terminal | 21 ++++++++++ scripts/install-qttermtcp.sh | 18 +++++++- scripts/install-wine.sh | 31 ++++++++++++++ scripts/install.sh | 4 +- scripts/wine.txt | 27 ++++++++++++ 20 files changed, 419 insertions(+), 6 deletions(-) create mode 100644 overlay/etc/skel/add-ons/wine/.gitignore create mode 100755 overlay/etc/skel/add-ons/wine/01-install-wine-deps.sh create mode 100755 overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh create mode 100755 overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh create mode 100755 overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh create mode 100755 overlay/etc/skel/add-ons/wine/05-run-regedit.sh create mode 100755 overlay/etc/skel/add-ons/wine/06-backup-wine-install.sh create mode 100644 overlay/etc/skel/add-ons/wine/README.md create mode 100755 overlay/etc/skel/add-ons/wine/common-checks.sh create mode 100755 overlay/opt/emcomm-tools/bin/et-common create mode 100755 overlay/opt/emcomm-tools/bin/et-vara-fm create mode 100755 overlay/opt/emcomm-tools/bin/et-vara-hf create mode 100755 overlay/opt/emcomm-tools/bin/et-vara-terminal create mode 100755 scripts/install-wine.sh create mode 100644 scripts/wine.txt diff --git a/overlay/etc/adduser.conf b/overlay/etc/adduser.conf index b1fb999..f86a478 100644 --- a/overlay/etc/adduser.conf +++ b/overlay/etc/adduser.conf @@ -79,7 +79,7 @@ USERS_GID=1981 # new users to other groups. # This is the list of groups that new non-system users will be added to # Default: -EXTRA_GROUPS="bluetooth dialout cdrom floppy audio video plugdev users" +EXTRA_GROUPS="bluetooth dialout cdrom floppy audio video plugdev tty users" # If ADD_EXTRA_GROUPS is set to something non-zero, the EXTRA_GROUPS # option above will be default behavior for adding new, non-system users diff --git a/overlay/etc/skel/.bash_profile b/overlay/etc/skel/.bash_profile index a8f6e2e..f18a020 100644 --- a/overlay/etc/skel/.bash_profile +++ b/overlay/etc/skel/.bash_profile @@ -1,6 +1,6 @@ # Author : Gaston Gonzalez # Date : 23 April 2024 -# Updated : 25 December 2024 +# Updated : 1 February 2025 # Description : bash profile # All user accounts should be in the 'et-data' group to allow data sharing with @@ -29,3 +29,8 @@ echo -e "${NC}" export ET_USER_CONFIG=${HOME}/.config/emcomm-tools/user.json export ET_LOG_DIR=${HOME}/.local/share/emcomm-tools + +# Export environment variables to support WINE installs for VARA +export WINARCH="win32" +export WINEPREFIX="$HOME/.wine32" +export WINEDEBUG=-all diff --git a/overlay/etc/skel/add-ons/wine/.gitignore b/overlay/etc/skel/add-ons/wine/.gitignore new file mode 100644 index 0000000..ec94583 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/.gitignore @@ -0,0 +1,2 @@ +*.exe +*.zip diff --git a/overlay/etc/skel/add-ons/wine/01-install-wine-deps.sh b/overlay/etc/skel/add-ons/wine/01-install-wine-deps.sh new file mode 100755 index 0000000..c522fd6 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/01-install-wine-deps.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Install wine dependencies to support VARA install +set -e + +source ./common-checks.sh + +if [[ ! -e ${WINEPREFIX} ]]; then + winetricks \ + --unattended \ + --force \ + winxp \ + sound=alsa \ + dotnet35sp1 \ + vb6run + + if [[ $? -ne 0 ]]; then + show-err-dialog "Failed to instaill WINE dependencies." + exit 1 + fi +else + echo -e "${WINEPREFIX} already exists. Skipping WINE dependency installation.\n" +fi + +echo -e "${YELLOW}Run ${WHITE}./02-install-vara-hf.sh${YELLOW} to install VARA HF.${NC}" diff --git a/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh b/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh new file mode 100755 index 0000000..e7c19e2 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Install VARA HF +set -e + +source ./common-checks.sh + +VERSION="4.8.9" +DOWNLOAD_FILE="vara-hf-${VERSION}.zip" +URL="https://downloads.winlink.org/VARA%20Products/VARA%20HF%20v${VERSION}%20setup.zip" +VARA_HOME="${HOME}/.wine32/drive_c/VARA" + +et-log "Installing VARA HF..." + +if [ ! -e ${DOWNLOAD_FILE} ]; then + et-log "Downloading VARA HF ${version} from ${URL}" + curl -s -f -L -o ${DOWNLOAD_FILE} "${URL}" +fi + +if [ $? -ne 0 ]; then + et-log "Error downloading VARA HF ${VERSION}." + exit 1 +fi + +unzip -o ${DOWNLOAD_FILE} + +wine 'VARA setup (Run as Administrator).exe' + +if [ ! -e "${VARA_HOME}/nt4pdhdll.exe" ]; then + et-log "Install missing DLL..." + + CWD=$(pwd) + + cd ${VARA_HOME} + curl -s -f -L -O \ + http://download.microsoft.com/download/winntsrv40/update/5.0.2195.2668/nt4/en-us/nt4pdhdll.exe && unzip nt4pdhdll.exe + cd ${CWD} +fi diff --git a/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh b/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh new file mode 100755 index 0000000..bd1f788 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Install VARA HF +set -e + +source ./common-checks.sh + +VERSION="4.3.8" +DOWNLOAD_FILE="vara-fm-${VERSION}.zip" +URL="https://downloads.winlink.org/VARA%20Products/VARA%20FM%20v${VERSION}%20setup.zip" +VARA_HOME="${HOME}/.wine32/drive_c/VARA" + +et-log "Installing VARA FM..." + +if [ ! -e ${DOWNLOAD_FILE} ]; then + et-log "Downloading VARA FM ${version} from ${URL}" + curl -s -f -L -o ${DOWNLOAD_FILE} "${URL}" +fi + +if [ $? -ne 0 ]; then + et-log "Error downloading VARA FM ${VERSION}." + exit 1 +fi + +unzip -o ${DOWNLOAD_FILE} + +wine 'VARA FM setup (Run as Administrator).exe' + +if [ ! -e "${VARA_HOME}/nt4pdhdll.exe" ]; then + et-log "Install missing DLL..." + + CWD=$(pwd) + + cd ${VARA_HOME} + curl -s -f -L -O \ + http://download.microsoft.com/download/winntsrv40/update/5.0.2195.2668/nt4/en-us/nt4pdhdll.exe && unzip nt4pdhdll.exe + cd ${CWD} +fi diff --git a/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh b/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh new file mode 100755 index 0000000..7fff827 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Install VARA Terminal +set -e + +source ./common-checks.sh + +VERSION="1.2.2" +DOWNLOAD_FILE="vara-terminal-${VERSION}.zip" +URL="https://downloads.winlink.org/VARA%20Products/VARA%20Terminal%20V${VERSION}%20setup.zip" + +et-log "Installing VARA Terminal..." + +if [ ! -e ${DOWNLOAD_FILE} ]; then + et-log "Downloading VARA Terminal ${version} from ${URL}" + curl -s -f -L -o ${DOWNLOAD_FILE} "${URL}" +fi + +if [ $? -ne 0 ]; then + et-log "Error downloading VARA Terminal ${VERSION}." + exit 1 +fi + +unzip -o ${DOWNLOAD_FILE} + +wine 'VARA Terminal setup (Run as Administrator).exe' diff --git a/overlay/etc/skel/add-ons/wine/05-run-regedit.sh b/overlay/etc/skel/add-ons/wine/05-run-regedit.sh new file mode 100755 index 0000000..bf93c18 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/05-run-regedit.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Run regedit +set -e + +source ./common-checks.sh + +echo -e "${YELLOW}" +echo -e "1. Expand HKEY_LOCAL_MACHINE > Software > Wine > Ports" +echo -e "2. In the main pain, right-click and select 'New' > 'String Value'" +echo -e "3. Set the name to ${WHITE}COM10${YELLOW} and the value to ${WHITE}/dev/et-cat${YELLOW}" +echo -e "4. Close the Registry Editor application" +echo -e "${NC}" + +wine regedit diff --git a/overlay/etc/skel/add-ons/wine/06-backup-wine-install.sh b/overlay/etc/skel/add-ons/wine/06-backup-wine-install.sh new file mode 100755 index 0000000..277f78a --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/06-backup-wine-install.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 1 February 2025 +# Purpose : Backup the ~/.wine32 directory for use in ETC image inclusion. + +TODAY=$(date +"%Y%m%d") +BACKUP_FILE="${HOME}/etc-wine-backup-${HOSTNAME}-${TODAY}.tar.gz" + +source /opt/emcomm-tools/bin/et-common + +if [ -e "${BACKUP_FILE}" ]; then + echo -e -n "${RED}A backup file for today exists. Can ${WHITE}${BACKUP_FILE} ${RED}be overwritten? (y/n) ${NC}" + read response + [[ $response != [yY] ]] && echo "Skipping backup and exiting." && exit 1 +fi + +# All paths are relative to $HOME. +BACKUP_DIRS=( + ".wine32" +) + +tar -czf ${BACKUP_FILE} \ + --transform 's|^.*\.local|.local|' \ + -C "${HOME}" "${BACKUP_DIRS[@]}" + +[ $? -ne 0 ] && et-log "Error creating backup" && exit 1 + +# Test that we can read if after we create it. +TAR_OUT=$(tar -tzf ${BACKUP_FILE}) +[ $? -ne 0 ] && et-log "Can't read backup file: ${BACKUP_FILE}. Error creating backup." && exit 1 + +echo -e "${GREEN}Backup created: ${WHITE}${BACKUP_FILE}\n" diff --git a/overlay/etc/skel/add-ons/wine/README.md b/overlay/etc/skel/add-ons/wine/README.md new file mode 100644 index 0000000..ed92bd3 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/README.md @@ -0,0 +1,30 @@ +# Installing Windows Applications + +The following instructions only need to be run once. They should be run +in this directory as your normal user (do not use 'sudo'). + +1. Install the WINE dependencies. + + ./01-install-wine-deps.sh + +2. Install VARA HF. Accept the default settings and do not launch the program. + + ./02-install-vara-hf.sh + +3. Install VARA FM. Accept the default settings and do not launch the program. + + ./03-install-vara-fm.sh + +4. Install VARA Terminal. Install VARA FM. Accept the default settings and do not launch the program. + + ./04-install-vara-terminal.sh + +5. Run the registery editor. Follow the instructions in the terminal. + + ./05-run-regedit.sh + +6. If you want to include your WINE installation in a future EmComm Tools + Community image build, run the following to make a backup of your WINE + installation now. + + ./06-backup-wine-install.sh diff --git a/overlay/etc/skel/add-ons/wine/common-checks.sh b/overlay/etc/skel/add-ons/wine/common-checks.sh new file mode 100755 index 0000000..35580e2 --- /dev/null +++ b/overlay/etc/skel/add-ons/wine/common-checks.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 1 February 2025 +# Purpose : Performs various checks to ensure that changes can be made +# to a user's local WINE installation. + +source /opt/emcomm-tools/bin/et-common + +WINE_OUT=$(which winetricks) +if [[ $? -ne 0 ]]; then + echo -e "${RED}Wine is not installed. As root, first run: ${WHITE}/root/emcomm-tools-os-community/scripts/install-wine.sh${NC}" + exit 1 +fi + +if [[ "${EUID}" -eq 0 ]]; then + echo -e "${RED}This script must not be run as root. Run it as your normal user.${NC}" + exit 1 +fi + +if [[ -z "${WINARCH}" ]]; then + echo -e "The WINARCH environment variable is not set. Setting it for you." + export WINARCH="win32" +fi + +if [[ -z "${WINEPREFIX}" ]]; then + echo -e "The WINEPREFIX environment variable is not set. Setting it for you." + export WINEPREFIX="${HOME}/.wine32" +fi + +if [[ -z "${DISPLAY}" && -z "${WAYLAND_DISPLAY}" ]]; then + echo -e "${RED}No graphical environment detected. Run this command from a desktop session.${NC}" + echo -e "${RED}This can't be run from within Cubic.${NC}" + exit 1 +fi diff --git a/overlay/opt/emcomm-tools/bin/et-common b/overlay/opt/emcomm-tools/bin/et-common new file mode 100755 index 0000000..b6b1539 --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-common @@ -0,0 +1,17 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 1 February 2025 +# Purpose : Common environment variables and functions + +export ESC="\x1B" +export RED="${ESC}[1;31m" +export BLUE="${ESC}[1;34m" +export GREEN="${ESC}[1;32m" +export WHITE="${ESC}[97m" +export YELLOW="${ESC}[1;33m" +export NC="${ESC}[0m" + +show-err-dialog() { + local message="$1" + dialog --title "Notification" --msgbox "$message" 8 60 +} diff --git a/overlay/opt/emcomm-tools/bin/et-user-backup b/overlay/opt/emcomm-tools/bin/et-user-backup index f086a60..116b262 100755 --- a/overlay/opt/emcomm-tools/bin/et-user-backup +++ b/overlay/opt/emcomm-tools/bin/et-user-backup @@ -1,7 +1,7 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 14 January 2025 -# Updated : 16 January 2025 +# Updated : 1 February 2025 # Purpose : Back up select files from the user's home directory. # # The backups are limited to the following: @@ -31,7 +31,6 @@ BACKUP_DIRS=( ".config/emcomm-tools" ".local/share/emcomm-tools" ".local/share/pat" - ".ssh" ) tar -czf ${BACKUP_FILE} \ diff --git a/overlay/opt/emcomm-tools/bin/et-vara-fm b/overlay/opt/emcomm-tools/bin/et-vara-fm new file mode 100755 index 0000000..a0873e0 --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-vara-fm @@ -0,0 +1,21 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Run VARA FM + +source /opt/emcomm-tools/bin/et-common + +EXE="${HOME}/.wine32/drive_c/VARA FM/VARAFM.exe" + +if [[ -e ${EXE} ]]; then + wine ~/.wine32/drive_c/VARA\ FM/VARAFM.exe +else + echo -e "${RED}" + echo -e "${EXE} does not exist." + echo -e "You might NOT have installed the windows subsystem (WINE)." + echo -e "Navigate to ${WHITE}${HOME}/add-ons/wine${RED} and follow the" + echo -e "instructions in the ${WHITE}README.md${RED} file." + echo -e "${NC}" + exit 1 +fi diff --git a/overlay/opt/emcomm-tools/bin/et-vara-hf b/overlay/opt/emcomm-tools/bin/et-vara-hf new file mode 100755 index 0000000..acc4032 --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-vara-hf @@ -0,0 +1,21 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Run VARA HF + +source /opt/emcomm-tools/bin/et-common + +EXE="${HOME}/.wine32/drive_c/VARA/VARA.exe" + +if [[ -e ${EXE} ]]; then + wine ${EXE} +else + echo -e "${RED}" + echo -e "${EXE} does not exist." + echo -e "You might NOT have installed the windows subsystem (WINE)." + echo -e "Navigate to ${WHITE}${HOME}/add-ons/wine${RED} and follow the" + echo -e "instructions in the ${WHITE}README.md${RED} file." + echo -e "${NC}" + exit 1 +fi diff --git a/overlay/opt/emcomm-tools/bin/et-vara-terminal b/overlay/opt/emcomm-tools/bin/et-vara-terminal new file mode 100755 index 0000000..ec66338 --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-vara-terminal @@ -0,0 +1,21 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Run VARA Terminal + +source /opt/emcomm-tools/bin/et-common + +EXE="${HOME}/.wine32/drive_c/VARA/VARA Terminal.exe" + +if [[ -e ${EXE} ]]; then + wine ~/.wine32/drive_c/VARA/VARA\ Terminal.exe & +else + echo -e "${RED}" + echo -e "${EXE} does not exist." + echo -e "You might NOT have installed the windows subsystem (WINE)." + echo -e "Navigate to ${WHITE}${HOME}/add-ons/wine${RED} and follow the" + echo -e "instructions in the ${WHITE}README.md${RED} file." + echo -e "${NC}" + exit 1 +fi diff --git a/scripts/install-qttermtcp.sh b/scripts/install-qttermtcp.sh index 369a952..a6558e6 100755 --- a/scripts/install-qttermtcp.sh +++ b/scripts/install-qttermtcp.sh @@ -1,7 +1,7 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 17 December 2024 -# Updated : 31 December 2024 +# Updated : 28 January 2025 # Purpose : Install QtTermTCP set -e trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG @@ -17,6 +17,22 @@ INSTALL_DIR="/opt/${APP}-${VERSION}" INSTALL_BIN_DIR="${INSTALL_DIR}/bin" LINK_PATH="/opt/${APP}" +et-log "Enabling i386 architecture support.." +dpkg --add-architecture i386 +apt update + +et-log "Installing QtTermTCP 32-bit build dependencies..." +apt install \ + qtbase5-dev:i386 \ + qtbase5-dev-tools:i386 \ + qt5-qmake:i386 \ + qtchooser:i386 \ + qtmultimedia5-dev:i386 \ + libqt5serialport5-dev:i386 \ + libfftw3-dev:i386 \ + qttools5-dev-tools:i386 \ + -y + et-log "Installing QtTermTCP build dependencies..." apt install \ qtbase5-dev \ diff --git a/scripts/install-wine.sh b/scripts/install-wine.sh new file mode 100755 index 0000000..ab28515 --- /dev/null +++ b/scripts/install-wine.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 20 January 2025 +# Updated : 1 February 2025 +# Purpose : Install WINE to support VARA + +WIN32_DIR="${HOME}/.win32" + +et-log "Installing WINE..." + +# Check for an existing i386 architecture +ARCH_OUT=$(dpkg --print-foreign-architectures | grep i386) +[ $? -ne 0 ] && dpkg --add-architecture i386 + +#if [ ! -e "/etc/apt/keyrings/winehq-archive.key" ]; then +# et-log "Adding apt keys for official wine repo" +# mkdir -pm755 /etc/apt/keyrings +# wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +# wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -sc)/winehq-$(lsb_release -sc).sources +# apt update +# apt install --install-recommends winehq-stable +#fi + +apt install \ + wine \ + winetricks \ + exe-thumbnailer \ + -y + +dialog --textbox wine.txt 15 74 +tput sgr 0 && clear diff --git a/scripts/install.sh b/scripts/install.sh index 4c8c440..11c2da8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 31 December 2024 +# Updated : 20 January 2025 # Purpose : Main installer for EmComm Tools OS Community . ./env.sh @@ -57,3 +57,5 @@ exitIfNotRoot # Add user-specific data ./download-osm-maps.sh ./download-wikipedia.sh + +./install-wine.sh diff --git a/scripts/wine.txt b/scripts/wine.txt new file mode 100644 index 0000000..6b99c80 --- /dev/null +++ b/scripts/wine.txt @@ -0,0 +1,27 @@ +The base WINE applications have been installed to support a future +installation of Windows programs such as VARA HF, VARA FM, and VARA +Terminal. However, these applications can't be installed within this +session of Cubic. They must be installed on a running version of +EmComm Tools Community via a desktop session. + +If you previously made a backup copy of your WINE installation using +the "$HOME/add-ons/wine/06-backup-wine-install.sh" script and would +like to bake it into this ISO image, perform the following: + +1. Change into the skeleton directory now with: + + cd /etc/skel + +2. Copy your etc-wine-backup-*.tar.gz file using Cubic to this + directory. + +3. Restore the backup into this directory with: + + tar -xzf etc-wine-backup-*.tar.gz + +4. Confirm that you see a `.wine32` directory here. + +5. Delete the compressed backup file to reduce the size of the + final image. + + rm etc-wine-backup-*.tar.gz From 4f46a72b87abb157fea5296b0125eecc0c4551b9 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Sat, 1 Feb 2025 01:44:43 -0700 Subject: [PATCH 02/13] VARA - Added DLL patch to VARA FM install. Updated WINE scripts with instructions on next script to run. Updated README in add-ons/wine. --- .../etc/skel/add-ons/wine/02-install-vara-hf.sh | 2 ++ .../etc/skel/add-ons/wine/03-install-vara-fm.sh | 8 +++++--- .../add-ons/wine/04-install-vara-terminal.sh | 2 ++ overlay/etc/skel/add-ons/wine/README.md | 16 ++++++++++++---- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh b/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh index e7c19e2..7592ddc 100755 --- a/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh +++ b/overlay/etc/skel/add-ons/wine/02-install-vara-hf.sh @@ -39,3 +39,5 @@ if [ ! -e "${VARA_HOME}/nt4pdhdll.exe" ]; then http://download.microsoft.com/download/winntsrv40/update/5.0.2195.2668/nt4/en-us/nt4pdhdll.exe && unzip nt4pdhdll.exe cd ${CWD} fi + +echo -e "${YELLOW}Run ${WHITE}./03-install-vara-fm.sh${YELLOW} to install VARA FM.${NC}" diff --git a/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh b/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh index bd1f788..1a3223a 100755 --- a/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh +++ b/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh @@ -3,7 +3,7 @@ # Author : Gaston Gonzalez # Date : 20 January 2025 # Updated : 1 February 2025 -# Purpose : Install VARA HF +# Purpose : Install VARA FM set -e source ./common-checks.sh @@ -11,7 +11,7 @@ source ./common-checks.sh VERSION="4.3.8" DOWNLOAD_FILE="vara-fm-${VERSION}.zip" URL="https://downloads.winlink.org/VARA%20Products/VARA%20FM%20v${VERSION}%20setup.zip" -VARA_HOME="${HOME}/.wine32/drive_c/VARA" +VARA_HOME="${HOME}/.wine32/drive_c/VARA FM" et-log "Installing VARA FM..." @@ -34,8 +34,10 @@ if [ ! -e "${VARA_HOME}/nt4pdhdll.exe" ]; then CWD=$(pwd) - cd ${VARA_HOME} + cd "${VARA_HOME}" curl -s -f -L -O \ http://download.microsoft.com/download/winntsrv40/update/5.0.2195.2668/nt4/en-us/nt4pdhdll.exe && unzip nt4pdhdll.exe cd ${CWD} fi + +echo -e "${YELLOW}Run ${WHITE}./04-install-vara-terminal.sh${YELLOW} to install VARA Terminal.${NC}" diff --git a/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh b/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh index 7fff827..70987e3 100755 --- a/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh +++ b/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh @@ -27,3 +27,5 @@ fi unzip -o ${DOWNLOAD_FILE} wine 'VARA Terminal setup (Run as Administrator).exe' + +echo -e "${YELLOW}Run ${WHITE}./05-run-regedit.sh${YELLOW}${NC}" diff --git a/overlay/etc/skel/add-ons/wine/README.md b/overlay/etc/skel/add-ons/wine/README.md index ed92bd3..a6d2368 100644 --- a/overlay/etc/skel/add-ons/wine/README.md +++ b/overlay/etc/skel/add-ons/wine/README.md @@ -7,19 +7,24 @@ in this directory as your normal user (do not use 'sudo'). ./01-install-wine-deps.sh -2. Install VARA HF. Accept the default settings and do not launch the program. +2. Install VARA HF. Accept the default settings and uncheck Launch My Program + when prompted during the installation. ./02-install-vara-hf.sh -3. Install VARA FM. Accept the default settings and do not launch the program. +3. Install VARA FM. Accept the default settings and uncheck Launch My Program + when prompted during the installation. ./03-install-vara-fm.sh -4. Install VARA Terminal. Install VARA FM. Accept the default settings and do not launch the program. +3. Install VARA Terminal. Accept the default settings and uncheck Launch My + Program when prompted during the installation. ./04-install-vara-terminal.sh -5. Run the registery editor. Follow the instructions in the terminal. +5. Run the registery editor. Follow the instructions in the terminal. In + this step we will need to map COM port 10 (COM10) to the EmComm Tools + CAT control device (/dev/et-cat). ./05-run-regedit.sh @@ -28,3 +33,6 @@ in this directory as your normal user (do not use 'sudo'). installation now. ./06-backup-wine-install.sh + +It is important that you do not run any off the VARA programs until after +the backup is run in step 6. From 350173ab397ca4822969b410d7780af47751836b Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Mon, 3 Feb 2025 16:48:33 -0700 Subject: [PATCH 03/13] Winlink - In preparation to support VARA FM and HF, I started to refactor the Winlink modes. Added support for Winlink configuration templates. Added supported for native AX.25 packet for devices that use /dev/rfcomm0 and a Bluetooth TNC --- .../et-service-winlink-native-packet.service | 19 +++++ overlay/opt/emcomm-tools/bin/et-kill-all | 3 +- overlay/opt/emcomm-tools/bin/et-mode | 16 +++- overlay/opt/emcomm-tools/bin/et-radio | 10 ++- overlay/opt/emcomm-tools/bin/et-uv-pro | 14 ++-- overlay/opt/emcomm-tools/bin/et-winlink | 53 +++++++++--- .../conf/template.d/winlink/config.ardop.json | 83 +++++++++++++++++++ .../template.d/winlink/config.ax25-agw.json | 83 +++++++++++++++++++ .../winlink/config.ax25-native.json | 78 +++++++++++++++++ 9 files changed, 335 insertions(+), 24 deletions(-) create mode 100644 overlay/etc/skel/.config/systemd/user/et-service-winlink-native-packet.service create mode 100644 overlay/opt/emcomm-tools/conf/template.d/winlink/config.ardop.json create mode 100644 overlay/opt/emcomm-tools/conf/template.d/winlink/config.ax25-agw.json create mode 100644 overlay/opt/emcomm-tools/conf/template.d/winlink/config.ax25-native.json diff --git a/overlay/etc/skel/.config/systemd/user/et-service-winlink-native-packet.service b/overlay/etc/skel/.config/systemd/user/et-service-winlink-native-packet.service new file mode 100644 index 0000000..1241209 --- /dev/null +++ b/overlay/etc/skel/.config/systemd/user/et-service-winlink-native-packet.service @@ -0,0 +1,19 @@ +# Author : Gaston Gonzalez +# Date : 3 February 2025 +# Purpose : User systemd unit file for EmComm Tools Winlink over packet +# +# Usage: +# Check status : systemctl --user status et-service-winlink-native-packet +# Start service : systemctl --user start et-service-winlink-native-packet +# Stop service : systemctl --user stop et-service-winlink-native-packet +# Reload this config : systemctl --user daemon-reload + +[Unit] +Description=EmComm Tools Winlink native AX.25 packet service + +[Service] +ExecStart=/opt/emcomm-tools/bin/et-winlink start-native-packet +Restart=no + +[Install] +WantedBy=multi-user.target diff --git a/overlay/opt/emcomm-tools/bin/et-kill-all b/overlay/opt/emcomm-tools/bin/et-kill-all index 3182c39..cb1c84f 100755 --- a/overlay/opt/emcomm-tools/bin/et-kill-all +++ b/overlay/opt/emcomm-tools/bin/et-kill-all @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 12 November 2024 -# Updated : 13 January 2025 +# Updated : 3 February 2025 # Purpose : Stops all EmComm Tools sound-based services (i.e. modems) and # amatuer radio applications to ensure a clean start for the next mode. @@ -11,6 +11,7 @@ stop_all_services() { systemctl --user stop et-service-winlink-ardop systemctl --user stop et-service-winlink-packet + systemctl --user stop et-service-winlink-native-packet systemctl --user stop et-service-ardop systemctl --user stop et-service-direwolf-300 systemctl --user stop et-service-direwolf-9600 diff --git a/overlay/opt/emcomm-tools/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index b1e5862..2dd35d6 100755 --- a/overlay/opt/emcomm-tools/bin/et-mode +++ b/overlay/opt/emcomm-tools/bin/et-mode @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 6 November 2024 -# Updated : 14 January 2025 +# Updated : 3 February 2025 # Purpose : Configures the system for a specific mode of operation # Use a simple text file to save the state of the last mode selected @@ -87,6 +87,18 @@ select_direwolf_mode () { fi } +select_winlink_mode () { + winlink_mode=() + + BLUETOOTH_TNC_CHECK=$(ps -ef | grep "[r]fcomm connect") + if [[ $? -eq 0 ]]; then + et-log "AX.25 over Bluetooth connected. Configuring Winlink for native AX.25" + start_and_wait_for_service et-service-winlink-native-packet + min http://localhost:8080 + exit 0 + fi +} + # Build list of options options=() options+=("${MODE_ID_NONE}" "No mode selected") @@ -150,11 +162,13 @@ if [ $exit_status -eq 0 ]; then et-log "Packet digipeater now running." ;; ${MODE_ID_WINLINK_ARDOP}) + et-log "Using ${PACKET_MODE} as the modem speed." start_and_wait_for_service et-service-ardop start_and_wait_for_service et-service-winlink-ardop min http://localhost:8080 ;; ${MODE_ID_WINLINK_PACKET}) + select_winlink_mode start_and_wait_for_service et-service-direwolf-simple start_and_wait_for_service et-service-winlink-packet min http://localhost:8080 diff --git a/overlay/opt/emcomm-tools/bin/et-radio b/overlay/opt/emcomm-tools/bin/et-radio index 5231894..5d81e5d 100755 --- a/overlay/opt/emcomm-tools/bin/et-radio +++ b/overlay/opt/emcomm-tools/bin/et-radio @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 11 October 2024 -# Updated : 14 December 2024 +# Updated : 3 February 2025 # Purpose : A script for managaing plug-and-play radios set -e @@ -48,6 +48,13 @@ if [ $exit_status -eq 0 ]; then VENDOR=$(cat ${ACTIVE_RADIO} | jq -r .vendor) MODEL=$(cat ${ACTIVE_RADIO} | jq -r .model) + BLUETOOTH_TNC_CHECK=$(ps -ef | grep "[r]fcomm connect") + if [[ $? -eq 0 ]]; then + et-log "Killing running processes for Bluetooth TNC" + sudo killall kissattach + sudo killall rfcomm + fi + printf "%-20s %-10s %-10s\n" "Radio ID" "Vendor" "Model" printf "%-20s %-10s %-10s\n\n" $ID "$VENDOR" "$MODEL" @@ -55,7 +62,6 @@ if [ $exit_status -eq 0 ]; then cat ${ACTIVE_RADIO} | jq -r '.notes[] | "* \(.)"' echo -e "${NC}" - printf "${GREEN}REQUIRED ACTIONS\n" printf "1. Apply the settings above to your radio.\n" printf "2. Plug in the USB cable for your radio. If it is already\n" diff --git a/overlay/opt/emcomm-tools/bin/et-uv-pro b/overlay/opt/emcomm-tools/bin/et-uv-pro index e54d76c..a883a41 100755 --- a/overlay/opt/emcomm-tools/bin/et-uv-pro +++ b/overlay/opt/emcomm-tools/bin/et-uv-pro @@ -2,14 +2,14 @@ # # Author : Gaston Gonzalez # Date : 1 January 2025 -# Updated : 3 January 2025 +# Updated : 3 February 2025 # Purpose : Utility for accessing the Bluetooth TNC on the BTECH # UV PRO. ACTIVE_RADIO="${ET_HOME}/conf/radios.d/btech-uvpro.bt.json" DEVICE_NAME="UV-PRO" BT_DEVICE="/dev/rfcomm0" -AX25_PORT="pkt1200" +AX25_PORT="wl2k" AX25_CONF_FILE="/etc/ax25/axports" ESC="\x1B" @@ -78,15 +78,15 @@ update_ax25_conf() { GREP_OUT=$(grep ${AX25_PORT} ${AX25_CONF_FILE}) if [ $? -eq 0 ]; then - # Delete all existing pkt1200 entries. Note: we can't use sed here + # Delete all existing AX.25 port entries. Note: we can't use sed here # since we do not have permission to create a temporary file with # inline replacement. ed modifies the file directly. - printf "g/^pkt1200/d\nw\nq\n" | ed ${AX25_CONF_FILE} > /dev/null 2>&1 + printf "g/^${AX25_PORT}/d\nw\nq\n" | ed ${AX25_CONF_FILE} > /dev/null 2>&1 fi info_message "Adding AX25 port for ${CALLSIGN}" - echo "pkt1200 ${CALLSIGN} 1200 255 2 1200 Packet" >> ${AX25_CONF_FILE} + echo "${AX25_PORT} ${CALLSIGN} 1200 255 2 1200 Packet" >> ${AX25_CONF_FILE} } stop_all_services() { @@ -235,8 +235,8 @@ EOF echo -e "${YELLOW}" echo -e "SAMPLE COMMANDS DESCRIPTION " echo -e "------------------------------- --------------------------------" - echo -e "axcall pkt1200 Connect directly to a node " - echo -e "axcall pkt1200 Connect to node via a digipeater" + echo -e "axcall ${AX25_PORT} Connect directly to a node " + echo -e "axcall ${AX25_PORT} Connect to node via a digipeater" echo -e "sudo axlisten -a -tttt -c Monitor inbound and outbound traffic" echo -e "${NC}" diff --git a/overlay/opt/emcomm-tools/bin/et-winlink b/overlay/opt/emcomm-tools/bin/et-winlink index cc3405c..783fe8e 100755 --- a/overlay/opt/emcomm-tools/bin/et-winlink +++ b/overlay/opt/emcomm-tools/bin/et-winlink @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 4 November 2024 -# Updated : 12 December 2024 +# Updated : 3 February 2025 # Purpose : Wrapper script for starting YAAC with PnP support # # Preconditions: @@ -13,14 +13,17 @@ # 1. Callsign, Winlink password, and grid are updated are updated # 2. pat http is started +source /opt/emcomm-tools/bin/et-common + PAT_CONF_FILE=${HOME}/.config/pat/config.json PAT_CONF_FILE_TEMPLATE=/etc/skel/.config/pat/config.json usage() { echo "usage: $(basename $0) " echo " " - echo " start-ardop - Start Pat Winlink in ardop mode" - echo " start-packet - Start Pat Winlink in packet mode" + echo " start-ardop - Start Pat Winlink in ardop mode" + echo " start-packet - Start Pat Winlink in packet mode" + echo " start-native-packet - Start Pat Winlink in native AX.25 packet mode" } if [ $# -ne 1 ]; then @@ -60,7 +63,7 @@ start_packet() { notify_user "Dire Wolf not running. Run: et-direwolf simple-packet" exit 1 fi - + update_config packet CMD="pat http" @@ -69,6 +72,24 @@ start_packet() { ${CMD} } +# Only the BTECH UV PRO is supported in this mode +start_native_packet() { + + BLUETOOTH_TNC_CHECK=$(ps -ef | grep "[r]fcomm connect") + if [[ $? -ne 0 ]]; then + echo -e "${RED}Can't start Pat in native AX.25 packet mode." + echo -e "If you have a UV Pro, first run: ${YELLOW}et-uv-pro connect${NC}" + exit 1 + fi + + update_config native-packet + + CMD="pat http" + et-log "Starting Pat with: ${CMD}" + + ${CMD} +} + update_config () { [ -z "$ET_USER_CONFIG" ] && ET_USER_CONFIG="${HOME}/.config/emcomm-tools/user.json" @@ -82,6 +103,18 @@ update_config () { exit 1 fi + case $1 in + ardop) + PAT_CONF_FILE_TEMPLATE=/opt/emcomm-tools/conf/template.d/winlink/config.ardop.json + ;; + packet) + PAT_CONF_FILE_TEMPLATE=/opt/emcomm-tools/conf/template.d/winlink/config.ax25-agw.json + ;; + native-packet) + PAT_CONF_FILE_TEMPLATE=/opt/emcomm-tools/conf/template.d/winlink/config.ax25-native.json + ;; + esac + et-log "Updating Pat configuration file: ${PAT_CONF_FILE}..." cp -v ${PAT_CONF_FILE_TEMPLATE} ${PAT_CONF_FILE} @@ -89,15 +122,6 @@ update_config () { sed -i "s|{{ET_WINLINK_PASSWD}}|${WINLINK_PASSWD}|g" ${PAT_CONF_FILE} sed -i "s|{{ET_GRID}}|${GRID}|g" ${PAT_CONF_FILE} - # Enable the P2P listener for the current mode selected (ARDOP or AX.25) - case $1 in - ardop) - sed -i "s|{{ET_WINLINK_LISTEN}}|ardop|g" ${PAT_CONF_FILE} - ;; - packet) - sed -i "s|{{ET_WINLINK_LISTEN}}|ax25|g" ${PAT_CONF_FILE} - ;; - esac } case $1 in @@ -107,6 +131,9 @@ case $1 in start-packet) start_packet ;; + start-native-packet) + start_native_packet + ;; *) echo "Invalid command." usage diff --git a/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ardop.json b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ardop.json new file mode 100644 index 0000000..35bfb95 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ardop.json @@ -0,0 +1,83 @@ +{ + "mycall": "{{ET_CALLSIGN}}", + "secure_login_password": "{{ET_WINLINK_PASSWD}}", + "auxiliary_addresses": [], + "locator": "{{ET_GRID}}", + "service_codes": [ + "PUBLIC" + ], + "http_addr": "localhost:8080", + "motd": [ + "Open source Winlink client - getpat.io" + ], + "connect_aliases": { + "telnet": "telnet://{mycall}:CMSTelnet@cms.winlink.org:8772/wl2k" + }, + "listen": [ "ardop" ], + "hamlib_rigs": { + "et-rig": { + "address": "localhost:4532", + "network": "tcp" + } + }, + "ax25": { + "engine": "agwpe", + "beacon": { + "every": 3600, + "message": "Winlink P2P", + "destination": "IDENT" + }, + "agwpe": {"addr": "localhost:8000", "radio_port": 0} + }, + "serial-tnc": { + "path": "/dev/ttyUSB0", + "serial_baud": 9600, + "hbaud": 1200, + "type": "Kenwood" + }, + "ardop": { + "addr": "localhost:8515", + "arq_bandwidth": { + "Forced": false, + "Max": 500 + }, + "rig": "et-rig", + "ptt_ctrl": true, + "beacon_interval": 0, + "cwid_enabled": true + }, + "pactor": { + "path": "/dev/ttyUSB0", + "baudrate": 57600, + "rig": "", + "custom_init_script": "" + }, + "telnet": { + "listen_addr": ":8774", + "password": "" + }, + "varahf": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 2300, + "rig": "", + "ptt_ctrl": false + }, + "varafm": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 0, + "rig": "", + "ptt_ctrl": false + }, + "gpsd": { + "enable_http": false, + "allow_forms": false, + "use_server_time": false, + "addr": "localhost:2947" + }, + "schedule": {}, + "version_reporting_disabled": false +} diff --git a/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ax25-agw.json b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ax25-agw.json new file mode 100644 index 0000000..dc4caa4 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ax25-agw.json @@ -0,0 +1,83 @@ +{ + "mycall": "{{ET_CALLSIGN}}", + "secure_login_password": "{{ET_WINLINK_PASSWD}}", + "auxiliary_addresses": [], + "locator": "{{ET_GRID}}", + "service_codes": [ + "PUBLIC" + ], + "http_addr": "localhost:8080", + "motd": [ + "Open source Winlink client - getpat.io" + ], + "connect_aliases": { + "telnet": "telnet://{mycall}:CMSTelnet@cms.winlink.org:8772/wl2k" + }, + "listen": [ "ax25" ], + "hamlib_rigs": { + "et-rig": { + "address": "localhost:4532", + "network": "tcp" + } + }, + "ax25": { + "engine": "agwpe", + "beacon": { + "every": 3600, + "message": "Winlink P2P", + "destination": "IDENT" + }, + "agwpe": {"addr": "localhost:8000", "radio_port": 0} + }, + "serial-tnc": { + "path": "/dev/ttyUSB0", + "serial_baud": 9600, + "hbaud": 1200, + "type": "Kenwood" + }, + "ardop": { + "addr": "localhost:8515", + "arq_bandwidth": { + "Forced": false, + "Max": 500 + }, + "rig": "et-rig", + "ptt_ctrl": true, + "beacon_interval": 0, + "cwid_enabled": true + }, + "pactor": { + "path": "/dev/ttyUSB0", + "baudrate": 57600, + "rig": "", + "custom_init_script": "" + }, + "telnet": { + "listen_addr": ":8774", + "password": "" + }, + "varahf": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 2300, + "rig": "", + "ptt_ctrl": false + }, + "varafm": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 0, + "rig": "", + "ptt_ctrl": false + }, + "gpsd": { + "enable_http": false, + "allow_forms": false, + "use_server_time": false, + "addr": "localhost:2947" + }, + "schedule": {}, + "version_reporting_disabled": false +} diff --git a/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ax25-native.json b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ax25-native.json new file mode 100644 index 0000000..b39879d --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.ax25-native.json @@ -0,0 +1,78 @@ +{ + "mycall": "{{ET_CALLSIGN}}", + "secure_login_password": "{{ET_WINLINK_PASSWD}}", + "auxiliary_addresses": [], + "locator": "{{ET_GRID}}", + "service_codes": [ + "PUBLIC" + ], + "http_addr": "localhost:8080", + "motd": [ + "Open source Winlink client - getpat.io" + ], + "connect_aliases": { + "telnet": "telnet://{mycall}:CMSTelnet@cms.winlink.org:8772/wl2k" + }, + "listen": [ "ax25" ], + "hamlib_rigs": { + }, + "ax25": { + "engine": "linux", + "beacon": { + "every": 3600, + "message": "Winlink P2P", + "destination": "IDENT" + }, + "ax25_linux": {"port": "wl2k"} + }, + "serial-tnc": { + "path": "/dev/ttyUSB0", + "serial_baud": 9600, + "hbaud": 1200, + "type": "Kenwood" + }, + "ardop": { + "addr": "localhost:8515", + "arq_bandwidth": { + "Forced": false, + "Max": 500 + }, + "ptt_ctrl": true, + "beacon_interval": 0, + "cwid_enabled": true + }, + "pactor": { + "path": "/dev/ttyUSB0", + "baudrate": 57600, + "rig": "", + "custom_init_script": "" + }, + "telnet": { + "listen_addr": ":8774", + "password": "" + }, + "varahf": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 2300, + "rig": "", + "ptt_ctrl": true + }, + "varafm": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 0, + "rig": "", + "ptt_ctrl": false + }, + "gpsd": { + "enable_http": false, + "allow_forms": false, + "use_server_time": false, + "addr": "localhost:2947" + }, + "schedule": {}, + "version_reporting_disabled": false +} From fc6aa41e9fc4157853ec7869ccb76ec39a8c8b5f Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Mon, 3 Feb 2025 17:28:54 -0700 Subject: [PATCH 04/13] QtTermTCP - Upgraded to QtTermTCP 0.0.0.58. The binary is newer than the source code build. This version is needed to support VARA BPQ connections. VARA Terminal under ETC is not performing well. --- scripts/install-qttermtcp-from-source.sh | 78 ++++++++++++++++++++++++ scripts/install-qttermtcp.sh | 32 ++-------- 2 files changed, 83 insertions(+), 27 deletions(-) create mode 100755 scripts/install-qttermtcp-from-source.sh diff --git a/scripts/install-qttermtcp-from-source.sh b/scripts/install-qttermtcp-from-source.sh new file mode 100755 index 0000000..a6558e6 --- /dev/null +++ b/scripts/install-qttermtcp-from-source.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 17 December 2024 +# Updated : 28 January 2025 +# Purpose : Install QtTermTCP +set -e +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR + +. ./env.sh + +APP=qttermtcp +VERSION=latest +DOWNLOAD_FILE=QtTermSource.zip +BIN_FILE=QtTermTCP +INSTALL_DIR="/opt/${APP}-${VERSION}" +INSTALL_BIN_DIR="${INSTALL_DIR}/bin" +LINK_PATH="/opt/${APP}" + +et-log "Enabling i386 architecture support.." +dpkg --add-architecture i386 +apt update + +et-log "Installing QtTermTCP 32-bit build dependencies..." +apt install \ + qtbase5-dev:i386 \ + qtbase5-dev-tools:i386 \ + qt5-qmake:i386 \ + qtchooser:i386 \ + qtmultimedia5-dev:i386 \ + libqt5serialport5-dev:i386 \ + libfftw3-dev:i386 \ + qttools5-dev-tools:i386 \ + -y + +et-log "Installing QtTermTCP build dependencies..." +apt install \ + qtbase5-dev \ + qtbase5-dev-tools \ + qt5-qmake \ + qtchooser \ + qtmultimedia5-dev \ + libqt5serialport5-dev \ + libfftw3-dev \ + qttools5-dev-tools \ + -y + +if [ ! -e ${ET_DIST_DIR}/${DOWNLOAD_FILE} ]; then + + URL=http://www.cantab.net/users/john.wiseman/Downloads/${DOWNLOAD_FILE} + + et-log "Downloading QtTermTCP: ${URL}" + curl -s -L -o ${DOWNLOAD_FILE} --fail ${URL} + + mv -v ${DOWNLOAD_FILE} ${ET_DIST_DIR} +fi + +CWD_DIR=`pwd` + +# Only build once +if [ ! -e "${ET_SRC_DIR}/${APP}/${BIN_FILE}" ]; then + cd ${ET_SRC_DIR} + mkdir -v ${APP} && cd ${APP} + unzip ${ET_DIST_DIR}/${DOWNLOAD_FILE} + + et-log "Building QtTermTCP.." + qmake && make +fi + +[ ! -e ${INSTALL_BIN_DIR} ] && mkdir -v -p ${INSTALL_BIN_DIR} +cp -v "${ET_SRC_DIR}/${APP}/${BIN_FILE}" ${INSTALL_BIN_DIR} + +[ -e ${LINK_PATH} ] && rm ${LINK_PATH} +ln -s ${INSTALL_DIR} ${LINK_PATH} + +stow -v -d /opt ${APP} -t /usr/local + +cd $CWD_DIR diff --git a/scripts/install-qttermtcp.sh b/scripts/install-qttermtcp.sh index a6558e6..25ddeb7 100755 --- a/scripts/install-qttermtcp.sh +++ b/scripts/install-qttermtcp.sh @@ -1,7 +1,6 @@ #!/bin/bash # Author : Gaston Gonzalez -# Date : 17 December 2024 -# Updated : 28 January 2025 +# Date : 3 February 2025 # Purpose : Install QtTermTCP set -e trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG @@ -11,7 +10,7 @@ trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR APP=qttermtcp VERSION=latest -DOWNLOAD_FILE=QtTermSource.zip +DOWNLOAD_FILE=QtTermTCP BIN_FILE=QtTermTCP INSTALL_DIR="/opt/${APP}-${VERSION}" INSTALL_BIN_DIR="${INSTALL_DIR}/bin" @@ -21,7 +20,7 @@ et-log "Enabling i386 architecture support.." dpkg --add-architecture i386 apt update -et-log "Installing QtTermTCP 32-bit build dependencies..." +et-log "Installing QtTermTCP 32-bit build and runtime dependencies..." apt install \ qtbase5-dev:i386 \ qtbase5-dev-tools:i386 \ @@ -33,18 +32,6 @@ apt install \ qttools5-dev-tools:i386 \ -y -et-log "Installing QtTermTCP build dependencies..." -apt install \ - qtbase5-dev \ - qtbase5-dev-tools \ - qt5-qmake \ - qtchooser \ - qtmultimedia5-dev \ - libqt5serialport5-dev \ - libfftw3-dev \ - qttools5-dev-tools \ - -y - if [ ! -e ${ET_DIST_DIR}/${DOWNLOAD_FILE} ]; then URL=http://www.cantab.net/users/john.wiseman/Downloads/${DOWNLOAD_FILE} @@ -52,23 +39,14 @@ if [ ! -e ${ET_DIST_DIR}/${DOWNLOAD_FILE} ]; then et-log "Downloading QtTermTCP: ${URL}" curl -s -L -o ${DOWNLOAD_FILE} --fail ${URL} + chmod 755 ${DOWNLOAD_FILE} mv -v ${DOWNLOAD_FILE} ${ET_DIST_DIR} fi CWD_DIR=`pwd` -# Only build once -if [ ! -e "${ET_SRC_DIR}/${APP}/${BIN_FILE}" ]; then - cd ${ET_SRC_DIR} - mkdir -v ${APP} && cd ${APP} - unzip ${ET_DIST_DIR}/${DOWNLOAD_FILE} - - et-log "Building QtTermTCP.." - qmake && make -fi - [ ! -e ${INSTALL_BIN_DIR} ] && mkdir -v -p ${INSTALL_BIN_DIR} -cp -v "${ET_SRC_DIR}/${APP}/${BIN_FILE}" ${INSTALL_BIN_DIR} +cp -v "${ET_DIST_DIR}/${DOWNLOAD_FILE}" ${INSTALL_BIN_DIR} [ -e ${LINK_PATH} ] && rm ${LINK_PATH} ln -s ${INSTALL_DIR} ${LINK_PATH} From 72e5d974d35d340442ed2bb3352169a41f3cc74b Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Mon, 3 Feb 2025 17:32:16 -0700 Subject: [PATCH 05/13] VARA - Removed VARA Terminal due to stability issues. QtTermTCP will be the preferred method for using a terminal with ETC. --- .../add-ons/wine/04-install-vara-terminal.sh | 31 ------------------- .../{05-run-regedit.sh => 04-run-regedit.sh} | 0 ...e-install.sh => 05-backup-wine-install.sh} | 0 overlay/etc/skel/add-ons/wine/README.md | 15 +++------ 4 files changed, 5 insertions(+), 41 deletions(-) delete mode 100755 overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh rename overlay/etc/skel/add-ons/wine/{05-run-regedit.sh => 04-run-regedit.sh} (100%) rename overlay/etc/skel/add-ons/wine/{06-backup-wine-install.sh => 05-backup-wine-install.sh} (100%) diff --git a/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh b/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh deleted file mode 100755 index 70987e3..0000000 --- a/overlay/etc/skel/add-ons/wine/04-install-vara-terminal.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# Author : Gaston Gonzalez -# Date : 20 January 2025 -# Updated : 1 February 2025 -# Purpose : Install VARA Terminal -set -e - -source ./common-checks.sh - -VERSION="1.2.2" -DOWNLOAD_FILE="vara-terminal-${VERSION}.zip" -URL="https://downloads.winlink.org/VARA%20Products/VARA%20Terminal%20V${VERSION}%20setup.zip" - -et-log "Installing VARA Terminal..." - -if [ ! -e ${DOWNLOAD_FILE} ]; then - et-log "Downloading VARA Terminal ${version} from ${URL}" - curl -s -f -L -o ${DOWNLOAD_FILE} "${URL}" -fi - -if [ $? -ne 0 ]; then - et-log "Error downloading VARA Terminal ${VERSION}." - exit 1 -fi - -unzip -o ${DOWNLOAD_FILE} - -wine 'VARA Terminal setup (Run as Administrator).exe' - -echo -e "${YELLOW}Run ${WHITE}./05-run-regedit.sh${YELLOW}${NC}" diff --git a/overlay/etc/skel/add-ons/wine/05-run-regedit.sh b/overlay/etc/skel/add-ons/wine/04-run-regedit.sh similarity index 100% rename from overlay/etc/skel/add-ons/wine/05-run-regedit.sh rename to overlay/etc/skel/add-ons/wine/04-run-regedit.sh diff --git a/overlay/etc/skel/add-ons/wine/06-backup-wine-install.sh b/overlay/etc/skel/add-ons/wine/05-backup-wine-install.sh similarity index 100% rename from overlay/etc/skel/add-ons/wine/06-backup-wine-install.sh rename to overlay/etc/skel/add-ons/wine/05-backup-wine-install.sh diff --git a/overlay/etc/skel/add-ons/wine/README.md b/overlay/etc/skel/add-ons/wine/README.md index a6d2368..e52844c 100644 --- a/overlay/etc/skel/add-ons/wine/README.md +++ b/overlay/etc/skel/add-ons/wine/README.md @@ -17,22 +17,17 @@ in this directory as your normal user (do not use 'sudo'). ./03-install-vara-fm.sh -3. Install VARA Terminal. Accept the default settings and uncheck Launch My - Program when prompted during the installation. - - ./04-install-vara-terminal.sh - -5. Run the registery editor. Follow the instructions in the terminal. In +4. Run the registery editor. Follow the instructions in the terminal. In this step we will need to map COM port 10 (COM10) to the EmComm Tools CAT control device (/dev/et-cat). - ./05-run-regedit.sh + ./04-run-regedit.sh -6. If you want to include your WINE installation in a future EmComm Tools +5. If you want to include your WINE installation in a future EmComm Tools Community image build, run the following to make a backup of your WINE installation now. - ./06-backup-wine-install.sh + ./05-backup-wine-install.sh It is important that you do not run any off the VARA programs until after -the backup is run in step 6. +the backup is run in step 5. From 57b26735dadde34d0fe02997a23fe6896a815911 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 4 Feb 2025 04:30:55 -0700 Subject: [PATCH 06/13] VARA - Updated script to reflect correct script to run next --- overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh | 2 +- overlay/etc/skel/add-ons/wine/04-run-regedit.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh b/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh index 1a3223a..f2d2598 100755 --- a/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh +++ b/overlay/etc/skel/add-ons/wine/03-install-vara-fm.sh @@ -40,4 +40,4 @@ if [ ! -e "${VARA_HOME}/nt4pdhdll.exe" ]; then cd ${CWD} fi -echo -e "${YELLOW}Run ${WHITE}./04-install-vara-terminal.sh${YELLOW} to install VARA Terminal.${NC}" +echo -e "${YELLOW}Run ${WHITE}./04-run-regedit.sh${YELLOW} to run registry editor.${NC}" diff --git a/overlay/etc/skel/add-ons/wine/04-run-regedit.sh b/overlay/etc/skel/add-ons/wine/04-run-regedit.sh index bf93c18..bfdb1b9 100755 --- a/overlay/etc/skel/add-ons/wine/04-run-regedit.sh +++ b/overlay/etc/skel/add-ons/wine/04-run-regedit.sh @@ -1,7 +1,7 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 20 January 2025 -# Updated : 1 February 2025 +# Updated : 4 February 2025 # Purpose : Run regedit set -e From a0e163bb01bca2f456d1079d0b4965e095a7948e Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 7 Feb 2025 02:30:32 -0700 Subject: [PATCH 07/13] VARA - Added experimental support for VARA over Winlink. Also addeded support for native AX.25 packet for Bluetooth connected TNCs --- overlay/etc/sudoers.d/et-rfcomm | 1 - overlay/opt/emcomm-tools/bin/et-kill-all | 7 +- overlay/opt/emcomm-tools/bin/et-mode | 58 ++++++++++++- overlay/opt/emcomm-tools/bin/et-radio | 6 +- overlay/opt/emcomm-tools/bin/et-system-info | 10 ++- overlay/opt/emcomm-tools/bin/et-winlink | 37 ++++++++- .../template.d/winlink/config.vara-fm.json | 83 +++++++++++++++++++ .../template.d/winlink/config.vara-hf.json | 83 +++++++++++++++++++ 8 files changed, 274 insertions(+), 11 deletions(-) create mode 100644 overlay/opt/emcomm-tools/conf/template.d/winlink/config.vara-fm.json create mode 100644 overlay/opt/emcomm-tools/conf/template.d/winlink/config.vara-hf.json diff --git a/overlay/etc/sudoers.d/et-rfcomm b/overlay/etc/sudoers.d/et-rfcomm index b0704af..1d88dbf 100644 --- a/overlay/etc/sudoers.d/et-rfcomm +++ b/overlay/etc/sudoers.d/et-rfcomm @@ -2,6 +2,5 @@ %bluetooth ALL=(ALL) NOPASSWD: /usr/sbin/kissattach /dev/rfcomm0 * %bluetooth ALL=(ALL) NOPASSWD: /usr/sbin/kissparms * -%bluetooth ALL=(ALL) NOPASSWD: /usr/bin/killall kissattach %bluetooth ALL=(ALL) NOPASSWD: /usr/bin/killall kissattach %bluetooth ALL=(ALL) NOPASSWD: /usr/bin/killall rfcomm diff --git a/overlay/opt/emcomm-tools/bin/et-kill-all b/overlay/opt/emcomm-tools/bin/et-kill-all index cb1c84f..0e57b69 100755 --- a/overlay/opt/emcomm-tools/bin/et-kill-all +++ b/overlay/opt/emcomm-tools/bin/et-kill-all @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 12 November 2024 -# Updated : 3 February 2025 +# Updated : 7 February 2025 # Purpose : Stops all EmComm Tools sound-based services (i.e. modems) and # amatuer radio applications to ensure a clean start for the next mode. @@ -18,6 +18,11 @@ stop_all_services() { systemctl --user stop et-service-direwolf-simple systemctl --user stop et-service-direwolf-aprs-digipeater systemctl --user stop et-service-direwolf-packet-digipeater + + # Stop VARA with a sledge hammer + pkill et-winlink + pkill et-vara + pkill VARA } et-log "Stopping all services" diff --git a/overlay/opt/emcomm-tools/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index 2dd35d6..7fe5581 100755 --- a/overlay/opt/emcomm-tools/bin/et-mode +++ b/overlay/opt/emcomm-tools/bin/et-mode @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 6 November 2024 -# Updated : 3 February 2025 +# Updated : 5 February 2025 # Purpose : Configures the system for a specific mode of operation # Use a simple text file to save the state of the last mode selected @@ -18,6 +18,8 @@ MODE_ID_CHAT_CLIENT="chat-chattervox" MODE_ID_PACKET_DIGIPEATER="packet-digipeater" MODE_ID_WINLINK_ARDOP="winlink-ardop" MODE_ID_WINLINK_PACKET="winlink-packet" +MODE_ID_WINLINK_VARA_HF="winlink-vara-hf" +MODE_ID_WINLINK_VARA_FM="winlink-vara-fm" # Default to 1200 baud PACKET_MODE=simple @@ -66,6 +68,31 @@ start_and_wait_for_service() { exit_on_service_failure ${systemd_unit_name} } +start_and_wait_for_vara() { + local vara_cmd="$1" + local elapsed=0 + + et-log "Starting ${vara_cmd}..." + ${vara_cmd} & + + et-log "Waiting for ${vara_cmd} to become active..." + + while true; do + CHECK_VARA=$(ps -ef | grep "[V]ARA") + if [ $? -eq 0 ]; then + break + fi + + sleep "$INTERVAL" + elapsed=$((elapsed + INTERVAL)) + if [ "$elapsed" -ge "$TIMEOUT" ]; then + et-log "Timeout reached. ${systemd_unit_name} failed to start." + exit 1 + fi + et-log "Waiting for ${vara_cmd} to become active..." + done +} + select_direwolf_mode () { packet_mode=() packet_mode+=("simple" "1200 baud (default for VHF/UHF)") @@ -108,11 +135,20 @@ options+=("${MODE_ID_BBS_CLIENT2}" "BBS Client (QtTermTCP)") options+=("${MODE_ID_CHAT_CLIENT}" "Chat (chattervox)") options+=("${MODE_ID_APRS_DIGIPEATER}" "APRS Digipeater") options+=("${MODE_ID_PACKET_DIGIPEATER}" "Packet Digipeater") -options+=("${MODE_ID_WINLINK_ARDOP}" "Winlink over HF (ARDOP)") options+=("${MODE_ID_WINLINK_PACKET}" "Winlink over VHF/UHF (AX.25 Packet)") +if [ -e "${HOME}/.wine32/drive_c/VARA FM/VARAFM.exe" ]; then + options+=("${MODE_ID_WINLINK_VARA_FM}" "Winlink over VHF/UHF (VARA FM)") +fi + +options+=("${MODE_ID_WINLINK_ARDOP}" "Winlink over HF (ARDOP)") + +if [ -e "${HOME}/.wine32/drive_c/VARA/VARA.exe" ]; then + options+=("${MODE_ID_WINLINK_VARA_HF}" "Winlink over HF (VARA HF)") +fi + # Prompt user for option and save exit status -SELECTED_MODE=$(dialog --clear --menu "Select a mode:" 16 65 10 "${options[@]}" 3>&1 1>&2 2>&3) +SELECTED_MODE=$(dialog --clear --menu "Select a mode:" 18 65 10 "${options[@]}" 3>&1 1>&2 2>&3) exit_status=$? tput sgr 0 && clear @@ -173,6 +209,22 @@ if [ $exit_status -eq 0 ]; then start_and_wait_for_service et-service-winlink-packet min http://localhost:8080 ;; + ${MODE_ID_WINLINK_VARA_FM}) + dialog --title "User Action Required" --msgbox "VARA FM is not a plug and play mode. You must configure VARA manually." 10 50 + tput sgr 0 && clear + start_and_wait_for_vara et-vara-fm + et-winlink start-vara-fm & + sleep 1 + min http://localhost:8080 2>/dev/null + ;; + ${MODE_ID_WINLINK_VARA_HF}) + dialog --title "User Action Required" --msgbox "VARA HF is not a plug and play mode. You must configure VARA manually." 10 50 + tput sgr 0 && clear + start_and_wait_for_vara et-vara-hf + et-winlink start-vara-hf & + sleep 1 + min http://localhost:8080 + ;; *) et-log "Mode ${SELECTED_MODE} not yet supported" exit 1 diff --git a/overlay/opt/emcomm-tools/bin/et-radio b/overlay/opt/emcomm-tools/bin/et-radio index 5d81e5d..f93119b 100755 --- a/overlay/opt/emcomm-tools/bin/et-radio +++ b/overlay/opt/emcomm-tools/bin/et-radio @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 11 October 2024 -# Updated : 3 February 2025 +# Updated : 5 February 2025 # Purpose : A script for managaing plug-and-play radios set -e @@ -51,8 +51,8 @@ if [ $exit_status -eq 0 ]; then BLUETOOTH_TNC_CHECK=$(ps -ef | grep "[r]fcomm connect") if [[ $? -eq 0 ]]; then et-log "Killing running processes for Bluetooth TNC" - sudo killall kissattach - sudo killall rfcomm + sudo /usr/bin/killall kissattach + sudo /usr/bin/killall rfcomm fi printf "%-20s %-10s %-10s\n" "Radio ID" "Vendor" "Model" diff --git a/overlay/opt/emcomm-tools/bin/et-system-info b/overlay/opt/emcomm-tools/bin/et-system-info index 4a915ec..529de30 100755 --- a/overlay/opt/emcomm-tools/bin/et-system-info +++ b/overlay/opt/emcomm-tools/bin/et-system-info @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 6 October 2024 -# Updated : 17 December 2024 +# Updated : 7 February 2025 # Purpose : Utility script for dumping system information function usage() { @@ -183,6 +183,8 @@ case $1 in MODE_ID_APRS_CLIENT="aprs-client" MODE_ID_WINLINK_ARDOP="winlink-ardop" MODE_ID_WINLINK_PACKET="winlink-packet" + MODE_ID_WINLINK_VARA_HF="winlink-vara-hf" + MODE_ID_WINLINK_VARA_FM="winlink-vara-fm" if [ ! -e /dev/et-audio ]; then echo "Run 'et-mode' to set" @@ -218,6 +220,12 @@ case $1 in ${MODE_ID_WINLINK_PACKET}) echo "Winlink Packet" ;; + ${MODE_ID_WINLINK_VARA_FM}) + echo "Winlink VARA FM" + ;; + ${MODE_ID_WINLINK_VARA_HF}) + echo "Winlink VARA HF" + ;; *) echo "Unknown" ;; diff --git a/overlay/opt/emcomm-tools/bin/et-winlink b/overlay/opt/emcomm-tools/bin/et-winlink index 783fe8e..1089a8b 100755 --- a/overlay/opt/emcomm-tools/bin/et-winlink +++ b/overlay/opt/emcomm-tools/bin/et-winlink @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 4 November 2024 -# Updated : 3 February 2025 +# Updated : 4 February 2025 # Purpose : Wrapper script for starting YAAC with PnP support # # Preconditions: @@ -24,6 +24,8 @@ usage() { echo " start-ardop - Start Pat Winlink in ardop mode" echo " start-packet - Start Pat Winlink in packet mode" echo " start-native-packet - Start Pat Winlink in native AX.25 packet mode" + echo " start-vara-fm - Start Pat Winlink in VARA FM mode" + echo " start-vara-hf - Start Pat Winlink in VARA HF mode" } if [ $# -ne 1 ]; then @@ -90,6 +92,26 @@ start_native_packet() { ${CMD} } +start_vara_fm() { + + update_config vara-fm + + CMD="pat http" + et-log "Starting Pat with: ${CMD}" + + ${CMD} +} + +start_vara_hf() { + + update_config vara-hf + + CMD="pat http" + et-log "Starting Pat with: ${CMD}" + + ${CMD} +} + update_config () { [ -z "$ET_USER_CONFIG" ] && ET_USER_CONFIG="${HOME}/.config/emcomm-tools/user.json" @@ -113,6 +135,12 @@ update_config () { native-packet) PAT_CONF_FILE_TEMPLATE=/opt/emcomm-tools/conf/template.d/winlink/config.ax25-native.json ;; + vara-fm) + PAT_CONF_FILE_TEMPLATE=/opt/emcomm-tools/conf/template.d/winlink/config.vara-fm.json + ;; + vara-hf) + PAT_CONF_FILE_TEMPLATE=/opt/emcomm-tools/conf/template.d/winlink/config.vara-hf.json + ;; esac et-log "Updating Pat configuration file: ${PAT_CONF_FILE}..." @@ -121,7 +149,6 @@ update_config () { sed -i "s|{{ET_CALLSIGN}}|${CALLSIGN}|g" ${PAT_CONF_FILE} sed -i "s|{{ET_WINLINK_PASSWD}}|${WINLINK_PASSWD}|g" ${PAT_CONF_FILE} sed -i "s|{{ET_GRID}}|${GRID}|g" ${PAT_CONF_FILE} - } case $1 in @@ -134,6 +161,12 @@ case $1 in start-native-packet) start_native_packet ;; + start-vara-fm) + start_vara_fm + ;; + start-vara-hf) + start_vara_hf + ;; *) echo "Invalid command." usage diff --git a/overlay/opt/emcomm-tools/conf/template.d/winlink/config.vara-fm.json b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.vara-fm.json new file mode 100644 index 0000000..0f9930a --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.vara-fm.json @@ -0,0 +1,83 @@ +{ + "mycall": "{{ET_CALLSIGN}}", + "secure_login_password": "{{ET_WINLINK_PASSWD}}", + "auxiliary_addresses": [], + "locator": "{{ET_GRID}}", + "service_codes": [ + "PUBLIC" + ], + "http_addr": "localhost:8080", + "motd": [ + "Open source Winlink client - getpat.io" + ], + "connect_aliases": { + "telnet": "telnet://{mycall}:CMSTelnet@cms.winlink.org:8772/wl2k" + }, + "listen": [], + "hamlib_rigs": { + "et-rig": { + "address": "localhost:4532", + "network": "tcp" + } + }, + "ax25": { + "engine": "agwpe", + "beacon": { + "every": 3600, + "message": "Winlink P2P", + "destination": "IDENT" + }, + "agwpe": {"addr": "localhost:8000", "radio_port": 0} + }, + "serial-tnc": { + "path": "/dev/ttyUSB0", + "serial_baud": 9600, + "hbaud": 1200, + "type": "Kenwood" + }, + "ardop": { + "addr": "localhost:8515", + "arq_bandwidth": { + "Forced": false, + "Max": 500 + }, + "rig": "et-rig", + "ptt_ctrl": true, + "beacon_interval": 0, + "cwid_enabled": true + }, + "pactor": { + "path": "/dev/ttyUSB0", + "baudrate": 57600, + "rig": "", + "custom_init_script": "" + }, + "telnet": { + "listen_addr": ":8774", + "password": "" + }, + "varahf": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 2300, + "rig": "et-rig", + "ptt_ctrl": true + }, + "varafm": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 0, + "rig": "et-rig", + "ptt_ctrl": true + }, + "gpsd": { + "enable_http": false, + "allow_forms": false, + "use_server_time": false, + "addr": "localhost:2947" + }, + "schedule": {}, + "version_reporting_disabled": false +} diff --git a/overlay/opt/emcomm-tools/conf/template.d/winlink/config.vara-hf.json b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.vara-hf.json new file mode 100644 index 0000000..0f9930a --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/winlink/config.vara-hf.json @@ -0,0 +1,83 @@ +{ + "mycall": "{{ET_CALLSIGN}}", + "secure_login_password": "{{ET_WINLINK_PASSWD}}", + "auxiliary_addresses": [], + "locator": "{{ET_GRID}}", + "service_codes": [ + "PUBLIC" + ], + "http_addr": "localhost:8080", + "motd": [ + "Open source Winlink client - getpat.io" + ], + "connect_aliases": { + "telnet": "telnet://{mycall}:CMSTelnet@cms.winlink.org:8772/wl2k" + }, + "listen": [], + "hamlib_rigs": { + "et-rig": { + "address": "localhost:4532", + "network": "tcp" + } + }, + "ax25": { + "engine": "agwpe", + "beacon": { + "every": 3600, + "message": "Winlink P2P", + "destination": "IDENT" + }, + "agwpe": {"addr": "localhost:8000", "radio_port": 0} + }, + "serial-tnc": { + "path": "/dev/ttyUSB0", + "serial_baud": 9600, + "hbaud": 1200, + "type": "Kenwood" + }, + "ardop": { + "addr": "localhost:8515", + "arq_bandwidth": { + "Forced": false, + "Max": 500 + }, + "rig": "et-rig", + "ptt_ctrl": true, + "beacon_interval": 0, + "cwid_enabled": true + }, + "pactor": { + "path": "/dev/ttyUSB0", + "baudrate": 57600, + "rig": "", + "custom_init_script": "" + }, + "telnet": { + "listen_addr": ":8774", + "password": "" + }, + "varahf": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 2300, + "rig": "et-rig", + "ptt_ctrl": true + }, + "varafm": { + "host": "localhost", + "cmdPort": 8300, + "dataPort": 8301, + "bandwidth": 0, + "rig": "et-rig", + "ptt_ctrl": true + }, + "gpsd": { + "enable_http": false, + "allow_forms": false, + "use_server_time": false, + "addr": "localhost:2947" + }, + "schedule": {}, + "version_reporting_disabled": false +} From 7fa85229d7bdc31424504353dcf48903e8e9ae59 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 7 Feb 2025 02:32:51 -0700 Subject: [PATCH 08/13] VARA - Removing VARA Terminal wrapper due to instability with VARA Terminal. QtTermTCP will be the defacto standard for connecting to a BBS over VARA --- overlay/opt/emcomm-tools/bin/et-vara-terminal | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100755 overlay/opt/emcomm-tools/bin/et-vara-terminal diff --git a/overlay/opt/emcomm-tools/bin/et-vara-terminal b/overlay/opt/emcomm-tools/bin/et-vara-terminal deleted file mode 100755 index ec66338..0000000 --- a/overlay/opt/emcomm-tools/bin/et-vara-terminal +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# Author : Gaston Gonzalez -# Date : 20 January 2025 -# Updated : 1 February 2025 -# Purpose : Run VARA Terminal - -source /opt/emcomm-tools/bin/et-common - -EXE="${HOME}/.wine32/drive_c/VARA/VARA Terminal.exe" - -if [[ -e ${EXE} ]]; then - wine ~/.wine32/drive_c/VARA/VARA\ Terminal.exe & -else - echo -e "${RED}" - echo -e "${EXE} does not exist." - echo -e "You might NOT have installed the windows subsystem (WINE)." - echo -e "Navigate to ${WHITE}${HOME}/add-ons/wine${RED} and follow the" - echo -e "instructions in the ${WHITE}README.md${RED} file." - echo -e "${NC}" - exit 1 -fi From f89e91fb30d217147e88d83be765b0e3e395658d Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 7 Feb 2025 05:28:56 -0700 Subject: [PATCH 09/13] R4.13 Fixes - Updated WINE docs --- overlay/etc/skel/add-ons/wine/README.md | 2 +- scripts/wine.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/overlay/etc/skel/add-ons/wine/README.md b/overlay/etc/skel/add-ons/wine/README.md index e52844c..44fc311 100644 --- a/overlay/etc/skel/add-ons/wine/README.md +++ b/overlay/etc/skel/add-ons/wine/README.md @@ -29,5 +29,5 @@ in this directory as your normal user (do not use 'sudo'). ./05-backup-wine-install.sh -It is important that you do not run any off the VARA programs until after +It is important that you do not run any of the VARA programs until after the backup is run in step 5. diff --git a/scripts/wine.txt b/scripts/wine.txt index 6b99c80..644ade7 100644 --- a/scripts/wine.txt +++ b/scripts/wine.txt @@ -5,7 +5,7 @@ session of Cubic. They must be installed on a running version of EmComm Tools Community via a desktop session. If you previously made a backup copy of your WINE installation using -the "$HOME/add-ons/wine/06-backup-wine-install.sh" script and would +the "$HOME/add-ons/wine/05-backup-wine-install.sh" script and would like to bake it into this ISO image, perform the following: 1. Change into the skeleton directory now with: From ca700b5bed120493b0120184defbc4743d03ed30 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 7 Feb 2025 05:45:17 -0700 Subject: [PATCH 10/13] R4.13 Fixes - Fixed startup issue for BTECH UV Pro when Winlink packet is used via et-mode --- overlay/opt/emcomm-tools/bin/et-kill-all | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/overlay/opt/emcomm-tools/bin/et-kill-all b/overlay/opt/emcomm-tools/bin/et-kill-all index 0e57b69..b08e594 100755 --- a/overlay/opt/emcomm-tools/bin/et-kill-all +++ b/overlay/opt/emcomm-tools/bin/et-kill-all @@ -6,6 +6,15 @@ # Purpose : Stops all EmComm Tools sound-based services (i.e. modems) and # amatuer radio applications to ensure a clean start for the next mode. +stop_pat() { + PS_OUT=$(ps -ef | grep "[p]at http") + + if [[ $? -eq 0 ]]; then + PAT_PID=$(ps -ef | grep "[p]at http" | awk '{print $2}') + kill -9 ${PAT_PID} + fi +} + # 1. Attempt to stop all EmComm Tools services regardless if they are running. # 2. Stop the applications first, then the modems. stop_all_services() { @@ -23,6 +32,8 @@ stop_all_services() { pkill et-winlink pkill et-vara pkill VARA + + stop_pat } et-log "Stopping all services" From 1f5a566c59469f75081cd2a21673b588873c9d1d Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Sat, 8 Feb 2025 03:33:38 -0700 Subject: [PATCH 11/13] VARA - Enabled sane audio defaults when using VARA --- overlay/opt/emcomm-tools/bin/et-mode | 4 ++-- overlay/opt/emcomm-tools/bin/et-vara-fm | 25 +++++++++++++++++++++---- overlay/opt/emcomm-tools/bin/et-vara-hf | 25 +++++++++++++++++++++---- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/overlay/opt/emcomm-tools/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index 7fe5581..bf4c8d3 100755 --- a/overlay/opt/emcomm-tools/bin/et-mode +++ b/overlay/opt/emcomm-tools/bin/et-mode @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 6 November 2024 -# Updated : 5 February 2025 +# Updated : 7 February 2025 # Purpose : Configures the system for a specific mode of operation # Use a simple text file to save the state of the last mode selected @@ -223,7 +223,7 @@ if [ $exit_status -eq 0 ]; then start_and_wait_for_vara et-vara-hf et-winlink start-vara-hf & sleep 1 - min http://localhost:8080 + min http://localhost:8080 2>/dev/null ;; *) et-log "Mode ${SELECTED_MODE} not yet supported" diff --git a/overlay/opt/emcomm-tools/bin/et-vara-fm b/overlay/opt/emcomm-tools/bin/et-vara-fm index a0873e0..5d8a737 100755 --- a/overlay/opt/emcomm-tools/bin/et-vara-fm +++ b/overlay/opt/emcomm-tools/bin/et-vara-fm @@ -1,16 +1,14 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 20 January 2025 -# Updated : 1 February 2025 +# Updated : 7 February 2025 # Purpose : Run VARA FM source /opt/emcomm-tools/bin/et-common EXE="${HOME}/.wine32/drive_c/VARA FM/VARAFM.exe" -if [[ -e ${EXE} ]]; then - wine ~/.wine32/drive_c/VARA\ FM/VARAFM.exe -else +if [[ ! -e ${EXE} ]]; then echo -e "${RED}" echo -e "${EXE} does not exist." echo -e "You might NOT have installed the windows subsystem (WINE)." @@ -19,3 +17,22 @@ else echo -e "${NC}" exit 1 fi + +# 1. Check if the symlink was created by the udev rules +if [[ -e /dev/et-audio ]]; then + + # 2. Check that this device was properly tagged with the ET_AUDIO env variable with a udev rule + APLAY_OUT=$(arecord -l | grep ET_AUDIO) + if [[ $? -eq 0 ]]; then + # Configure ALSA settings for sound card + /opt/emcomm-tools/bin/et-audio update-config + else + echo -e "${RED}No ET_AUDIO device detected.${NC}" + exit 1 + fi +else + echo -e "${RED}No ET_AUDIO device plugged in.${NC}" + exit 1 +fi + +wine ~/.wine32/drive_c/VARA\ FM/VARAFM.exe diff --git a/overlay/opt/emcomm-tools/bin/et-vara-hf b/overlay/opt/emcomm-tools/bin/et-vara-hf index acc4032..bf762a3 100755 --- a/overlay/opt/emcomm-tools/bin/et-vara-hf +++ b/overlay/opt/emcomm-tools/bin/et-vara-hf @@ -1,16 +1,14 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 20 January 2025 -# Updated : 1 February 2025 +# Updated : 7 February 2025 # Purpose : Run VARA HF source /opt/emcomm-tools/bin/et-common EXE="${HOME}/.wine32/drive_c/VARA/VARA.exe" -if [[ -e ${EXE} ]]; then - wine ${EXE} -else +if [[ ! -e ${EXE} ]]; then echo -e "${RED}" echo -e "${EXE} does not exist." echo -e "You might NOT have installed the windows subsystem (WINE)." @@ -19,3 +17,22 @@ else echo -e "${NC}" exit 1 fi + +# 1. Check if the symlink was created by the udev rules +if [[ -e /dev/et-audio ]]; then + + # 2. Check that this device was properly tagged with the ET_AUDIO env variable with a udev rule + APLAY_OUT=$(arecord -l | grep ET_AUDIO) + if [[ $? -eq 0 ]]; then + # Configure ALSA settings for sound card + /opt/emcomm-tools/bin/et-audio update-config + else + echo -e "${RED}No ET_AUDIO device detected.${NC}" + exit 1 + fi +else + echo -e "${RED}No ET_AUDIO device plugged in.${NC}" + exit 1 +fi + +wine ${EXE} From a4b3e1f7f56be8cdad0ca22cf0557e63f3b96416 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Sat, 8 Feb 2025 04:45:23 -0700 Subject: [PATCH 12/13] VARA - Added VARA support to QtTermTCP mode via et-mode --- overlay/etc/skel/.config/QtTermTCP.ini | 8 +++ overlay/opt/emcomm-tools/bin/et-mode | 64 +++++++++++++++++------ overlay/opt/emcomm-tools/bin/et-qttermtcp | 4 +- 3 files changed, 58 insertions(+), 18 deletions(-) diff --git a/overlay/etc/skel/.config/QtTermTCP.ini b/overlay/etc/skel/.config/QtTermTCP.ini index ff0a50d..6732810 100644 --- a/overlay/etc/skel/.config/QtTermTCP.ini +++ b/overlay/etc/skel/.config/QtTermTCP.ini @@ -6,6 +6,14 @@ AGWPaclen=80 AGWPort=8000 AGWTermCall=N0CALL AGWToCalls=TTPBBS, +PTT=HAMLIB +PTTBAUD=0 +PTTMode=17 +PTTOnString=127.0.0.1 TermMode=0 +VARAEnable=1 +VARAFM=1 +VARAHF=0 +VARATermCall=N0CALL YAPPPath= singlemodeFormat=1 diff --git a/overlay/opt/emcomm-tools/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index bf4c8d3..21c3b35 100755 --- a/overlay/opt/emcomm-tools/bin/et-mode +++ b/overlay/opt/emcomm-tools/bin/et-mode @@ -2,12 +2,14 @@ # # Author : Gaston Gonzalez # Date : 6 November 2024 -# Updated : 7 February 2025 +# Updated : 8 February 2025 # Purpose : Configures the system for a specific mode of operation # Use a simple text file to save the state of the last mode selected MODE_STATUS_FILE="${HOME}/.config/emcomm-tools/et-mode" +QTTERMTCP_CONF_FILE="${HOME}/.config/QtTermTCP.ini" + # List of supported modes of operation MODE_ID_NONE="none" MODE_ID_APRS_DIGIPEATER="aprs-digipeater" @@ -21,8 +23,8 @@ MODE_ID_WINLINK_PACKET="winlink-packet" MODE_ID_WINLINK_VARA_HF="winlink-vara-hf" MODE_ID_WINLINK_VARA_FM="winlink-vara-fm" -# Default to 1200 baud -PACKET_MODE=simple +# Default to 1200 baud packet for terminal sessions +TERM_MODE=1200 # Attempt to stop all EmComm Tools services regardless if they are running. stop_all_services() { @@ -93,16 +95,24 @@ start_and_wait_for_vara() { done } -select_direwolf_mode () { - packet_mode=() - packet_mode+=("simple" "1200 baud (default for VHF/UHF)") - packet_mode+=("9600" "9600 baud (VHF/UHF)") - packet_mode+=("300" "300 baud (HF)") +select_term_mode () { + term_mode=() + term_mode+=("1200" "1200 baud (default for VHF/UHF)") + term_mode+=("9600" "9600 baud (VHF/UHF)") + term_mode+=("300" "300 baud (HF)") - PACKET_MODE=$(dialog --clear --menu "Select a modem" 10 60 10 "${packet_mode[@]}" 3>&1 1>&2 2>&3) + if [ -e "${HOME}/.wine32/drive_c/VARA FM/VARAFM.exe" ]; then + term_mode+=("vara-fm" "VARA FM") + fi + + if [ -e "${HOME}/.wine32/drive_c/VARA/VARA.exe" ]; then + term_mode+=("vara-hf" "VARA HF") + fi + + TERM_MODE=$(dialog --clear --menu "Select a modem" 13 60 10 "${term_mode[@]}" 3>&1 1>&2 2>&3) exit_status=$? - if [ "${PACKET_MODE}" == "9600" ]; then + if [ "${TERM_MODE}" == "9600" ]; then dialog --title "Note on 9600 Baud" --msgbox "9600 baud is only supported on limited radios and typically requires a special cable.\n\nDon't forget to set the packet settings to 9600 on the radio." 0 0 fi @@ -172,18 +182,38 @@ if [ $exit_status -eq 0 ]; then et-yaac start ;; ${MODE_ID_BBS_CLIENT}) - select_direwolf_mode - et-log "Using ${PACKET_MODE} as the modem speed." + select_term_mode + et-log "Using ${TERM_MODE} as the modem speed." - start_and_wait_for_service et-service-direwolf-${PACKET_MODE} + start_and_wait_for_service et-service-direwolf-${TERM_MODE} et-log "Starting Paracon." et-paracon start ;; ${MODE_ID_BBS_CLIENT2}) - select_direwolf_mode - et-log "Using ${PACKET_MODE} as the modem speed." + select_term_mode + et-log "Using ${TERM_MODE} as the modem." - start_and_wait_for_service et-service-direwolf-${PACKET_MODE} + case "${TERM_MODE}" in + "1200") + start_and_wait_for_service et-service-direwolf-simple + ;; + "9600") + start_and_wait_for_service et-service-direwolf-9600 + ;; + "300") + start_and_wait_for_service et-service-direwolf-300 + ;; + "vara-fm") + sed -i "s|^VARAFM=.*|VARAFM=1|g" ${QTTERMTCP_CONF_FILE} + sed -i "s|^VARAHF=.*|VARAHF=0|g" ${QTTERMTCP_CONF_FILE} + start_and_wait_for_vara et-vara-fm + ;; + "vara-hf") + sed -i "s|^VARAFM=.*|VARAFM=0|g" ${QTTERMTCP_CONF_FILE} + sed -i "s|^VARAHF=.*|VARAHF=1|g" ${QTTERMTCP_CONF_FILE} + start_and_wait_for_vara et-vara-hf + ;; + esac et-log "Starting QtTermTCP." et-qttermtcp start @@ -198,7 +228,7 @@ if [ $exit_status -eq 0 ]; then et-log "Packet digipeater now running." ;; ${MODE_ID_WINLINK_ARDOP}) - et-log "Using ${PACKET_MODE} as the modem speed." + et-log "Using ARDOP as the modem." start_and_wait_for_service et-service-ardop start_and_wait_for_service et-service-winlink-ardop min http://localhost:8080 diff --git a/overlay/opt/emcomm-tools/bin/et-qttermtcp b/overlay/opt/emcomm-tools/bin/et-qttermtcp index 6dc9c87..218c34f 100755 --- a/overlay/opt/emcomm-tools/bin/et-qttermtcp +++ b/overlay/opt/emcomm-tools/bin/et-qttermtcp @@ -2,6 +2,7 @@ # # Author : Gaston Gonzalez # Date : 17 December 2024 +# Updated : 8 February 2025 # Purpose : Wrapper script for starting JS8Call with PnP support # # Preconditions @@ -57,7 +58,8 @@ update-config () { exit 1 fi - sed -i "s|^AGWTermCall.*|AGWTermCall=${CALLSIGN}|" ${CONF_FILE} + sed -i "s|^AGWTermCall.*|AGWTermCall=${CALLSIGN}|g" ${CONF_FILE} + sed -i "s|^VARATermCall.*|VARATermCall=${CALLSIGN}|g" ${CONF_FILE} sed -i "s|^YAPPPath.*|YAPPPath=${HOME}/Downloads|" ${CONF_FILE} et-log "Updated QtTermTCP configuration with user callsign '${CALLSIGN}'" From 97428d47be10fd4413e7a920d46ed13786578e5d Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Sun, 9 Feb 2025 09:36:49 -0700 Subject: [PATCH 13/13] VARA - Only all QtTermTCP to use VARA modems for terminal. Paracon does not support them as there is no AGE interface --- overlay/opt/emcomm-tools/bin/et-mode | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/overlay/opt/emcomm-tools/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index 21c3b35..3ec7c28 100755 --- a/overlay/opt/emcomm-tools/bin/et-mode +++ b/overlay/opt/emcomm-tools/bin/et-mode @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 6 November 2024 -# Updated : 8 February 2025 +# Updated : 9 February 2025 # Purpose : Configures the system for a specific mode of operation # Use a simple text file to save the state of the last mode selected @@ -101,12 +101,15 @@ select_term_mode () { term_mode+=("9600" "9600 baud (VHF/UHF)") term_mode+=("300" "300 baud (HF)") - if [ -e "${HOME}/.wine32/drive_c/VARA FM/VARAFM.exe" ]; then - term_mode+=("vara-fm" "VARA FM") - fi + # Only allow VARA terminal modes when using QtTermTCP + if [[ "${SELECTED_MODE}" == "${MODE_ID_BBS_CLIENT2}" ]]; then + if [ -e "${HOME}/.wine32/drive_c/VARA FM/VARAFM.exe" ]; then + term_mode+=("vara-fm" "VARA FM") + fi - if [ -e "${HOME}/.wine32/drive_c/VARA/VARA.exe" ]; then - term_mode+=("vara-hf" "VARA HF") + if [ -e "${HOME}/.wine32/drive_c/VARA/VARA.exe" ]; then + term_mode+=("vara-hf" "VARA HF") + fi fi TERM_MODE=$(dialog --clear --menu "Select a modem" 13 60 10 "${term_mode[@]}" 3>&1 1>&2 2>&3)