From f9d03245098f3f397166729f233fff3965a7fa78 Mon Sep 17 00:00:00 2001 From: marcel Date: Mon, 7 Feb 2022 19:40:39 +0100 Subject: [PATCH] Incomming messages from APRSIS are now acknowledged if needed. --- aprs_utils/process_aprs_messages.sh | 28 ++++++++++++++++++++++++++++ aprs_utils/send_message.sh | 6 +++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/aprs_utils/process_aprs_messages.sh b/aprs_utils/process_aprs_messages.sh index 4dd47b7..345b61c 100755 --- a/aprs_utils/process_aprs_messages.sh +++ b/aprs_utils/process_aprs_messages.sh @@ -213,6 +213,34 @@ while read LINE #/usr/sbin/beacon -d "$APRS_HEADER" -s ax1 "$APRS_FRAME" /usr/sbin/beacon "${args[@]}" + # Message on port aprsis, send ack on LoRa as this channel has the most iGATEs + elif [ $PORT == "aprsis" ]; then + + # Local (own) stations do not need to be digipeated + if [ $OWN_CALL ]; then + APRS_HEADER="APRX29" + APRS_FRAME="::$FORMATTED_CALL:ack$ACKNOWLEDGE_NUMBER" + args[0]=-d + args[1]="APRX29" + args[2]=-s + args[3]=ax2 + args[4]=":$FORMATTED_CALL:ack$ACKNOWLEDGE_NUMBER" + # Everyone else is digipeated + else + APRS_HEADER="APRX29 WIDE2-2" + APRS_FRAME="::$FORMATTED_CALL:ack$ACKNOWLEDGE_NUMBER" + args[0]=-d + args[1]="APRX29 WIDE2-2" + args[2]=-s + args[3]=ax2 + args[4]=":$FORMATTED_CALL:ack$ACKNOWLEDGE_NUMBER" + fi + + # use beacon to send acknowledge frame + #echo "/usr/sbin/beacon -d '$APRS_HEADER' -s ax1 '$APRS_FRAME'" + #/usr/sbin/beacon -d "$APRS_HEADER" -s ax1 "$APRS_FRAME" + /usr/sbin/beacon "${args[@]}" + fi fi diff --git a/aprs_utils/send_message.sh b/aprs_utils/send_message.sh index 2663d40..3b16067 100755 --- a/aprs_utils/send_message.sh +++ b/aprs_utils/send_message.sh @@ -88,7 +88,7 @@ CURRENT_DATE_TIME=$(date +"%Y-%m-%d %H:%M:%S") if [ "$Interface" == "ax0" ]; then # Log message - echo "$CURRENT_DATE_TIME,ax0,$Call,APRX29,$Message" >> $APRS_RECEIVED_MESSAGES_DIR$MESSAGE_FILE + echo "$CURRENT_DATE_TIME,ax0,$Call,APRX29,\"$Message\"" >> $APRS_RECEIVED_MESSAGES_DIR$MESSAGE_FILE # if call is less than 9 characters, add spaces at the end (according to the APRS protocol) printf -v Call %-9.9s "$Call" @@ -103,7 +103,7 @@ if [ "$Interface" == "ax0" ]; then elif [ "$Interface" == "ax1" ]; then # Log message - echo "$CURRENT_DATE_TIME,ax1,$Call,APRX29,$Message" >> $APRS_RECEIVED_MESSAGES_DIR$MESSAGE_FILE + echo "$CURRENT_DATE_TIME,ax1,$Call,APRX29,\"$Message\"" >> $APRS_RECEIVED_MESSAGES_DIR$MESSAGE_FILE # if call is less than 9 characters, add spaces at the end (according to the APRS protocol) printf -v Call %-9.9s "$Call" @@ -129,7 +129,7 @@ elif [ "$Interface" == "ax1" ]; then /usr/sbin/beacon "${args[@]}" elif [ "$Interface" == "ax2" ]; then # Log message - echo "$CURRENT_DATE_TIME,ax2,$Call,APRX29,$Message" >> $APRS_RECEIVED_MESSAGES_DIR$MESSAGE_FILE + echo "$CURRENT_DATE_TIME,ax2,$Call,APRX29,\"$Message\"" >> $APRS_RECEIVED_MESSAGES_DIR$MESSAGE_FILE # if call is less than 9 characters, add spaces at the end (according to the APRS protocol) printf -v Call %-9.9s "$Call"