mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
xiegu-x6100 Refactored rigctld priming into et-common function
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Author : Gaston Gonzalez
|
# Author : Gaston Gonzalez
|
||||||
# Date : 1 February 2025
|
# Date : 1 February 2025
|
||||||
# Updated : 20 August 2025
|
# Updated : 7 October 2025
|
||||||
# Purpose : Common environment variables and functions
|
# Purpose : Common environment variables and functions
|
||||||
|
|
||||||
# Standardized device paths for supported hardware
|
# Standardized device paths for supported hardware
|
||||||
@@ -141,3 +141,25 @@ download_with_retries() {
|
|||||||
echo "Download failed after $max_retries attempts."
|
echo "Download failed after $max_retries attempts."
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# prime_rigctld_conn makes a connection to the rig control daemon (rigctld)
|
||||||
|
# and requests the radio's frequency in an effort to initialize CAT control.
|
||||||
|
#
|
||||||
|
# For example, it takes almost 6 seconds for rig control clients (including
|
||||||
|
# the rigctl client) to connect the first time with the Xiegu X6100 to rigctld.
|
||||||
|
# JS8Call will fail to handle this properly if this "priming" task is not
|
||||||
|
# executed before it starts up..
|
||||||
|
prime_rigctld_conn() {
|
||||||
|
|
||||||
|
ACTIVE_RADIO=$(et-system-info active-radio)
|
||||||
|
case "${ACTIVE_RADIO}" in
|
||||||
|
"X6100")
|
||||||
|
et-log "Priming rig control client connection for ${ACTIVE_RADIO}"
|
||||||
|
notify_user "Please be patient. Priming connection to radio."
|
||||||
|
rigctl -m 2 f > /dev/null
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
et-log "No rigctld priming needed for ${ACTIVE_RADIO}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Author : Gaston Gonzalez
|
# Author : Gaston Gonzalez
|
||||||
# Date : 24 October 2024
|
# Date : 24 October 2024
|
||||||
# Updated : 6 October 2025
|
# Updated : 7 October 2025
|
||||||
# Purpose : Wrapper script for starting JS8Call with PnP support
|
# Purpose : Wrapper script for starting JS8Call with PnP support
|
||||||
#
|
#
|
||||||
# Preconditions
|
# Preconditions
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
# 1. Stop all running EmComm Tools modes
|
# 1. Stop all running EmComm Tools modes
|
||||||
# 2. JS8Call audio settings updated
|
# 2. JS8Call audio settings updated
|
||||||
# 3. JS8Call started
|
# 3. JS8Call started
|
||||||
|
. /opt/emcomm-tools/bin/et-common
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "usage: $(basename $0) <command>"
|
echo "usage: $(basename $0) <command>"
|
||||||
@@ -33,15 +34,8 @@ notify_user() {
|
|||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
|
||||||
# Handle a special case with Xiegu X6100 to pre-initialize the hamlib
|
# Ensure that we have a pre-initialized CAT control connection for select radios
|
||||||
# client connection. It takes almost 6 seconds for rig control clients
|
prime_rigctld_conn
|
||||||
# (including the rigctl client) to connect the first time with the X6100.
|
|
||||||
ACTIVE_RADIO=$(et-system-info active-radio)
|
|
||||||
if [[ "${ACTIVE_RADIO}" = "X6100" ]]; then
|
|
||||||
et-log "Priming rig control client connection for ${ACTIVE_RADIO}"
|
|
||||||
notify_user "JS8Call will be slow to start due to rig priming"
|
|
||||||
rigctl -m 2 f > /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
/opt/emcomm-tools/bin/et-kill-all && update-config && /usr/bin/js8call &
|
/opt/emcomm-tools/bin/et-kill-all && update-config && /usr/bin/js8call &
|
||||||
|
|
||||||
@@ -53,7 +47,7 @@ start() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update-config () {
|
update-config() {
|
||||||
|
|
||||||
JS8CALL_CONF_FILE="${HOME}/.config/JS8Call.ini"
|
JS8CALL_CONF_FILE="${HOME}/.config/JS8Call.ini"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user