mirror of
https://github.com/thetechprepper/emcomm-tools-os-community.git
synced 2026-09-17 15:41:44 -04:00
reticulum - Only poll for LoRa power settings if device is detected
This commit is contained in:
@@ -143,25 +143,28 @@ sed -i "s|{{ET_CALLSIGN}}|${CALLSIGN}|g" ${RETICULUM_CONF_FILE}
|
|||||||
# RNode (LoRA) interface updates
|
# RNode (LoRA) interface updates
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
# 1. Enable/disable intereface based on PnP device detection
|
# Enable/disable intereface based on PnP device detection
|
||||||
if [[ -e "${ET_DEVICE_LORA}" ]]; then
|
if [[ -e "${ET_DEVICE_LORA}" ]]; then
|
||||||
INTERFACE_RNODE_ENABLED="yes"
|
INTERFACE_RNODE_ENABLED="yes"
|
||||||
|
|
||||||
|
# Determine max power settings
|
||||||
|
et-log "Connecting to device to determine max power..."
|
||||||
|
|
||||||
|
INTERFACE_RNODE_TXPOWER=`rnodeconf -i ${ET_DEVICE_LORA} | awk -F': ' '/Max TX power/ {print $2}' | awk '{print $1}'`
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
INTERFACE_RNODE_TXPOWER=${INTERFACE_RNODE_TXPOWER_DEFAULT}
|
||||||
|
et-log "Can't determine max power. Using defaulting ${INTERFACE_RNODE_TXPOWER}."
|
||||||
|
fi
|
||||||
|
|
||||||
|
et-log "Setting max power to ${INTERFACE_RNODE_TXPOWER} dBm."
|
||||||
|
sed -i "s|{{ET_RETICULUM_INTERFACE_RNODE_TXPOWER}}|${INTERFACE_RNODE_TXPOWER}|g" ${RETICULUM_CONF_FILE}
|
||||||
|
|
||||||
else
|
else
|
||||||
INTERFACE_RNODE_ENABLED="no"
|
INTERFACE_RNODE_ENABLED="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i "s|{{ET_RETICULUM_INTERFACE_RNODE_ENABLED}}|${INTERFACE_RNODE_ENABLED}|g" ${RETICULUM_CONF_FILE}
|
sed -i "s|{{ET_RETICULUM_INTERFACE_RNODE_ENABLED}}|${INTERFACE_RNODE_ENABLED}|g" ${RETICULUM_CONF_FILE}
|
||||||
|
|
||||||
# 2. Determine max power settings
|
|
||||||
et-log "Connecting to device to determine max power..."
|
|
||||||
INTERFACE_RNODE_TXPOWER=`rnodeconf -i ${ET_DEVICE_LORA} | awk -F': ' '/Max TX power/ {print $2}' | awk '{print $1}'`
|
|
||||||
if [[ $? -ne 0 ]]; then
|
|
||||||
INTERFACE_RNODE_TXPOWER=${INTERFACE_RNODE_TXPOWER_DEFAULT}
|
|
||||||
et-log "Can't determine max power. Using defaulting ${INTERFACE_RNODE_TXPOWER}."
|
|
||||||
fi
|
|
||||||
|
|
||||||
et-log "Setting max power to ${INTERFACE_RNODE_TXPOWER} dBm."
|
|
||||||
sed -i "s|{{ET_RETICULUM_INTERFACE_RNODE_TXPOWER}}|${INTERFACE_RNODE_TXPOWER}|g" ${RETICULUM_CONF_FILE}
|
|
||||||
|
|
||||||
|
|
||||||
CMD="rnsd"
|
CMD="rnsd"
|
||||||
et-log "Starting Reticulum: ${CMD}"
|
et-log "Starting Reticulum: ${CMD}"
|
||||||
|
|||||||
Reference in New Issue
Block a user