mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
Merging feature/winlink
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"callsign": "N0CALL",
|
||||
"grid": "DM33"
|
||||
"grid": "DM33",
|
||||
"winlinkPasswd": "NOPASS"
|
||||
}
|
||||
|
||||
@@ -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": "",
|
||||
"ptt_ctrl": false,
|
||||
"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
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -2,6 +2,7 @@
|
||||
#
|
||||
# Author : Gaston Gonzalez
|
||||
# Date : 25 October 2024
|
||||
# Updated: 4 November 2024
|
||||
# Purpose: Set user-specific settings for EmComm Tools.
|
||||
|
||||
[ -z "$ET_USER_CONFIG" ] && ET_USER_CONFIG="${HOME}/.config/emcomm-tools/user.json"
|
||||
@@ -12,18 +13,22 @@ fi
|
||||
|
||||
CUR_CALLSIGN=$(cat ${ET_USER_CONFIG} | jq -r .callsign)
|
||||
CUR_GRID=$(cat ${ET_USER_CONFIG} | jq -r .grid)
|
||||
CUR_WINLINK_PASSWD=$(cat ${ET_USER_CONFIG} | jq -r .winlinkPasswd)
|
||||
|
||||
while true; do
|
||||
read -e -p "Enter your callsign (current: ${CUR_CALLSIGN}): " callsign
|
||||
read -e -p "Enter your maidenhead grid square (current: ${CUR_GRID}): " grid
|
||||
read -e -p "Enter your Winlink password: " winlink_passwd
|
||||
|
||||
callsign=${callsign:-"$CUR_CALLSIGN"}
|
||||
grid=${grid:-"$CUR_GRID"}
|
||||
winlink_passwd=${winlink_passwd:-"$CUR_WINLINK_PASSWD"}
|
||||
|
||||
echo
|
||||
echo "Is the following correct?:"
|
||||
echo "Callsign: $callsign"
|
||||
echo "Grid Square: $grid"
|
||||
echo "Winlink Password: *******"
|
||||
read -p "(y/n): " confirm
|
||||
|
||||
if [[ "$confirm" =~ ^[Yy]$ ]]; then
|
||||
@@ -31,12 +36,12 @@ while true; do
|
||||
cat <<EOF > "${ET_USER_CONFIG}"
|
||||
{
|
||||
"callsign": "${callsign}",
|
||||
"grid": "${grid}"
|
||||
"grid": "${grid}",
|
||||
"winlinkPasswd": "${winlink_passwd}"
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "User settings updated..."
|
||||
cat ${ET_USER_CONFIG} | jq .
|
||||
break
|
||||
elif [[ "$confirm" =~ ^[Nn]$ ]]; then
|
||||
echo "Let's try again."
|
||||
|
||||
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Author : Gaston Gonzalez
|
||||
# Date : 4 November 2024
|
||||
# Purpose : Wrapper script for starting YAAC with PnP support
|
||||
#
|
||||
# Preconditions:
|
||||
# 1. Supported radio and audio interface are connected and properly detected
|
||||
# 2. Appropriate modem is started (Dire Wolf or ARDOP).
|
||||
#
|
||||
# Postconditions:
|
||||
# 1. Callsign and Winlink password are updated
|
||||
# 2. pat http is started
|
||||
set -e
|
||||
|
||||
PAT_CONF_FILE=${HOME}/.config/pat/config.json
|
||||
PAT_CONF_FILE_TEMPLATE=/etc/skel/.config/pat/config.json
|
||||
|
||||
usage() {
|
||||
echo "usage: $(basename $0) <command>"
|
||||
echo " <command>"
|
||||
echo " start-packet - Start Pat Winlink in packet mode"
|
||||
echo " update-config - Update configuration for selected mode"
|
||||
}
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
notify_user() {
|
||||
notify-send \
|
||||
-t 5000 \
|
||||
--app-name="EmComm Tools" \
|
||||
"$1"
|
||||
}
|
||||
|
||||
start_packet() {
|
||||
update_config
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
RIGCTLD_OUT=$(ps -ef | grep [d]irewolf)
|
||||
if [ $? -ne 0 ]; then
|
||||
et-log "Can't start Pat in packet mode. Dire Wolf not running."
|
||||
notify_user "Can't start Pat. Dire Wolf not running."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CMD="pat http"
|
||||
et-log "Starting Pat with: ${CMD}"
|
||||
|
||||
${CMD}
|
||||
|
||||
else
|
||||
et-log "Error updating configuration. Can't start Pat"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
update_config () {
|
||||
|
||||
[ -z "$ET_USER_CONFIG" ] && ET_USER_CONFIG="${HOME}/.config/emcomm-tools/user.json"
|
||||
|
||||
CALLSIGN=$(cat ${ET_USER_CONFIG} | jq -r .callsign)
|
||||
GRID=$(cat ${ET_USER_CONFIG} | jq -r .grid)
|
||||
WINLINK_PASSWD=$(cat ${ET_USER_CONFIG} | jq -r .winlinkPasswd)
|
||||
|
||||
if [ "${CALLSIGN}" = "N0CALL" ]; then
|
||||
notify_user "Can't start Pat. No callsign set. Run: et-user."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
et-log "Updating Pat configuration file: ${PAT_CONF_FILE}..."
|
||||
cp -v ${PAT_CONF_FILE_TEMPLATE} ${PAT_CONF_FILE}
|
||||
|
||||
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
|
||||
start-packet)
|
||||
start_packet
|
||||
;;
|
||||
update-config)
|
||||
update_config
|
||||
;;
|
||||
*)
|
||||
echo "Invalid command."
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -10,8 +10,8 @@
|
||||
# 2. Dire Wolf is started
|
||||
#
|
||||
# Postconditions:
|
||||
# 1. YAAC is started
|
||||
# 2. Callsign is updated in YAAC
|
||||
# 1. Callsign is updated in YAAC
|
||||
# 2. YAAC is started
|
||||
|
||||
YAAC_CONF_DIR=${HOME}/.java/.userPrefs/org/ka2ddo/yaac
|
||||
YAAC_CONF_FILE_PORTS=${YAAC_CONF_DIR}/Ports/prefs.xml
|
||||
|
||||
@@ -8,8 +8,7 @@ ADEVICE plughw:1,0
|
||||
CHANNEL 0
|
||||
|
||||
# User settings
|
||||
#MYCALL {{ET_CALLSIGN}}
|
||||
MYCALL KT7RUN
|
||||
MYCALL {{ET_CALLSIGN}}
|
||||
|
||||
# Modem settings
|
||||
MODEM 1200
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Author : Gaston Gonzalez
|
||||
# Date : 11 January 2023
|
||||
# Updated : 4 November 2024
|
||||
# Purpose : Install Pat Winlink client
|
||||
set -e
|
||||
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
|
||||
trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR
|
||||
|
||||
VERSION=0.16.0
|
||||
FILE="pat_${VERSION}_linux_amd64.deb"
|
||||
|
||||
et-log "Installing Pat Winlink client version ${VERSION}..."
|
||||
|
||||
TARGET_PATH="${ET_DIST_DIR}/${FILE}"
|
||||
|
||||
if [ ! -e ${TARGET_PATH} ]; then
|
||||
|
||||
URL="https://github.com/la5nta/pat/releases/download/v${VERSION}/${FILE}"
|
||||
|
||||
et-log "Downloading: ${URL}"
|
||||
curl -s -L -o ${FILE} --fail ${URL}
|
||||
|
||||
[ ! -e ${ET_DIST_DIR} ] && mkdir ${ET_DIST_DIR}
|
||||
[ ! -e ${ET_SRC_DIR} ] && mkdir ${ET_SRC_DIR}
|
||||
|
||||
mv -v ${FILE} ${ET_DIST_DIR}
|
||||
fi
|
||||
|
||||
et-log "Installing: ${TARGET_PATH}"
|
||||
dpkg -i ${TARGET_PATH}
|
||||
@@ -39,6 +39,8 @@ exitIfNotRoot
|
||||
./install-direwolf.sh
|
||||
./install-yaac.sh
|
||||
|
||||
./install-winlink.sh
|
||||
|
||||
./install-audio-tools.sh
|
||||
|
||||
# Add user-specific data
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
# Author : Gaston Gonzalez
|
||||
# Date : 3 November 2024
|
||||
# Updated : 4 November 2024
|
||||
# Purpose : Test Pat Winlink installation
|
||||
|
||||
OUT=$(pat version | grep v0.16.0)
|
||||
exit $?
|
||||
Reference in New Issue
Block a user