From 525aa3cc0a69e14a5f5070160ee8ff7124b53d33 Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 6 Feb 2022 21:51:49 +0100 Subject: [PATCH] Beacon time randomized and processing of aprsis messages. --- CHANGELOG.md | 8 +++++ aprs_utils/beacon_ax0.txt | 2 +- aprs_utils/beacon_ax1.txt | 2 +- aprs_utils/beacon_ax2.txt | 2 +- aprs_utils/crontab.pe1rxf | 6 ++-- aprs_utils/pe1rxf-aprs-server.cfg | 16 ++++----- aprs_utils/process_aprs_messages.sh | 54 +++++++++++++++++++++++++++-- aprs_utils/set_beacon.sh | 9 ++--- web-interface/index.php | 19 +++++++++- 9 files changed, 96 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7bc426..045dcd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,3 +41,11 @@ First official release with LoRa support. ### Removed - LoRa SX1278 library is now a stand alone project and should be cloned separately from this project. + +## [1.1.1] - 2022-02-06 + +### Changed +- Beacons time is now "set time" + random seconds between 0-60. This way the beacons are not send at exactly hole minutes. This also prevents rapid firing of beacons on different channels. + +### Added +- Messages from APRS-IS are now also processed and displayed on the web interface. diff --git a/aprs_utils/beacon_ax0.txt b/aprs_utils/beacon_ax0.txt index 67736e2..45b9fd1 100644 --- a/aprs_utils/beacon_ax0.txt +++ b/aprs_utils/beacon_ax0.txt @@ -1 +1 @@ -PE1RXF-1>APRX29,WIDE2-1:!5302.78N/00707.91E-https://meezenest.nl/pe1rxf +PE1RXF-1>APRX29,WIDE2-1:!5302.78NR00707.91E&APRS RX iGATE 144.800MHz https://meezenest.nl/pe1rxf diff --git a/aprs_utils/beacon_ax1.txt b/aprs_utils/beacon_ax1.txt index ee85e06..60de5f5 100644 --- a/aprs_utils/beacon_ax1.txt +++ b/aprs_utils/beacon_ax1.txt @@ -1 +1 @@ -/usr/sbin/beacon -d "APRX29" -s ax1 '!5302.78N/00707.91E-https://meezenest.nl/pe1rxf' +/usr/sbin/beacon -d "APRX29" -s ax1 '!5302.78NR00707.91E&APRS RX iGATE 432.500MHz https://meezenest.nl/pe1rxf' diff --git a/aprs_utils/beacon_ax2.txt b/aprs_utils/beacon_ax2.txt index 8cbe378..bec6b25 100644 --- a/aprs_utils/beacon_ax2.txt +++ b/aprs_utils/beacon_ax2.txt @@ -1 +1 @@ -/usr/sbin/beacon -d "APRX29" -s ax2 '!5302.78N/00707.91E-https://meezenest.nl/pe1rxf' +/usr/sbin/beacon -d "APRX29" -s ax2 '!5302.78NL00707.91E&LoRa APRS RX iGATE 433.775MHz https://meezenest.nl/pe1rxf' diff --git a/aprs_utils/crontab.pe1rxf b/aprs_utils/crontab.pe1rxf index 1174975..d2439cb 100644 --- a/aprs_utils/crontab.pe1rxf +++ b/aprs_utils/crontab.pe1rxf @@ -34,10 +34,10 @@ */30 * * * * /home/marcel/ham/aprs_utils/generate_diagrams_from_aprs_data_PE1RXF-7.sh # Send beacon on AX0 (internal radio) -#* * * * * /home/marcel/ham/aprs_utils/send_beacon_internal_radio.sh +*/10 * * * * sleep $(echo | awk '{print rand()*60};') && /home/marcel/ham/aprs_utils/send_beacon_internal_radio.sh #Send beacon on AX1 (external radio) -#* * * * * /home/marcel/ham/aprs_utils/send_beacon_external_radio.sh +#* * * * * sleep $(echo | awk '{print rand()*60};') && /home/marcel/ham/aprs_utils/send_beacon_external_radio.sh #Send beacon on AX2 (LoRa internal radio) -#* * * * * /home/marcel/ham/aprs_utils/send_beacon_lora_radio.sh +*/10 * * * * sleep $(echo | awk '{print rand()*60};') && /home/marcel/ham/aprs_utils/send_beacon_lora_radio.sh diff --git a/aprs_utils/pe1rxf-aprs-server.cfg b/aprs_utils/pe1rxf-aprs-server.cfg index 6de08c4..955ded1 100644 --- a/aprs_utils/pe1rxf-aprs-server.cfg +++ b/aprs_utils/pe1rxf-aprs-server.cfg @@ -10,11 +10,11 @@ ax0_name=Digipeater 2 meter ax0_frequency=144.800 MHz # Beacon time internal radio (ax0) in minutes. 0-60, where 0 disables beaconing. -ax0_beacon_time=0 +ax0_beacon_time=10 ax0_beacon_destination=APRX29 ax0_beacon_path=WIDE2-1 -ax0_beacon_position=!5302.78N/00707.91E- -ax0_beacon_comment=https://meezenest.nl/pe1rxf +ax0_beacon_position=!5302.78NR00707.91E& +ax0_beacon_comment=APRS RX iGATE 144.800MHz https://meezenest.nl/pe1rxf ax0_beacon_file=/home/marcel/ham/aprs_utils/beacon_ax0.txt ax0_transmit_directory=/home/marcel/ham/aprs_utils/aprs_files_to_transmit/ @@ -47,8 +47,8 @@ ax1_frequency=432.500 MHz ax1_beacon_time=0 ax1_beacon_destination=APRX29 ax1_beacon_path=none -ax1_beacon_position=!5302.78N/00707.91E- -ax1_beacon_comment=https://meezenest.nl/pe1rxf +ax1_beacon_position=!5302.78NR00707.91E& +ax1_beacon_comment=APRS RX iGATE 432.500MHz https://meezenest.nl/pe1rxf ax1_beacon_file=/home/marcel/ham/aprs_utils/beacon_ax1.txt # Predefined messages @@ -77,11 +77,11 @@ ax2_name=Digipeater LoRa ax2_frequency=433.775 MHz # Beacon time LoRa radio (ax2) in minutes. 0-60, where 0 disables beaconing. -ax2_beacon_time=0 +ax2_beacon_time=10 ax2_beacon_destination=APRX29 ax2_beacon_path=none -ax2_beacon_position=!5302.78N/00707.91E- -ax2_beacon_comment=https://meezenest.nl/pe1rxf +ax2_beacon_position=!5302.78NL00707.91E& +ax2_beacon_comment=LoRa APRS RX iGATE 433.775MHz https://meezenest.nl/pe1rxf ax2_beacon_file=/home/marcel/ham/aprs_utils/beacon_ax2.txt # Predefined messages diff --git a/aprs_utils/process_aprs_messages.sh b/aprs_utils/process_aprs_messages.sh index f6c6d2b..4dd47b7 100755 --- a/aprs_utils/process_aprs_messages.sh +++ b/aprs_utils/process_aprs_messages.sh @@ -69,7 +69,21 @@ while read LINE CALL="$(grep -oP "(?<=PE1RXF-2 R ).+?\>"<<<$LINE)" PORT="ax1" fi - + + # If call is empty, frame not from channel 1 or 2, maybe from channel 3? + if [ -z $CALL ]; then + #CALL="$(grep -o -P "(?<=PE1RXF-2 R \*).+?\>"<<<$LINE)" + CALL="$(grep -oP "(?<=PE1RXF-3 R ).+?\>"<<<$LINE)" + PORT="ax2" + fi + + # If call is empty, frame not from channel 1, 2 or 3, maybe from channel APRSIS? + if [ -z $CALL ]; then + #CALL="$(grep -o -P "(?<=PE1RXF-2 R \*).+?\>"<<<$LINE)" + CALL="$(grep -oP "(?<=APRSIS R ).+?\>"<<<$LINE)" + PORT="aprsis" + fi + # Lets do something with the message from channel 1 or 2 if [[ $CALL ]]; then @@ -85,9 +99,15 @@ while read LINE if [ $PORT == "ax0" ]; then #FULL_PATH="$(grep -o -P '(?<=PE1RXF-1 R \*).+?:'<<<$LINE)" FULL_PATH="$(grep -oP "(?<=PE1RXF-1 R ).+?:"<<<$LINE)" - else + elif [ $PORT == "ax1" ]; then #FULL_PATH="$(grep -o -P '(?<=PE1RXF-2 R \*).+?:'<<<$LINE)" FULL_PATH="$(grep -oP "(?<=PE1RXF-2 R ).+?:"<<<$LINE)" + elif [ $PORT == "ax2" ]; then + #FULL_PATH="$(grep -o -P '(?<=PE1RXF-2 R \*).+?:'<<<$LINE)" + FULL_PATH="$(grep -oP "(?<=PE1RXF-3 R ).+?:"<<<$LINE)" + elif [ $PORT == "aprsis" ]; then + #FULL_PATH="$(grep -o -P '(?<=PE1RXF-2 R \*).+?:'<<<$LINE)" + FULL_PATH="$(grep -oP "(?<=APRSIS R ).+?:"<<<$LINE)" fi FULL_PATH="$(grep -o -P '(?<=\>).*'<<<$FULL_PATH)" @@ -138,7 +158,7 @@ while read LINE echo "$APRS_FRAME" > "$APRS_SEND_MESSAGE_DIRECTORY$APRS_TRANSMIT_FILE" # Message on port ax1 - else + elif [ $PORT == "ax1" ]; then # Local (own) stations do not need to be digipeated if [ $OWN_CALL ]; then @@ -165,6 +185,34 @@ while read LINE #/usr/sbin/beacon -d "$APRS_HEADER" -s ax1 "$APRS_FRAME" /usr/sbin/beacon "${args[@]}" + # Message on port ax2 + elif [ $PORT == "ax2" ]; 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/set_beacon.sh b/aprs_utils/set_beacon.sh index 88b2b31..b1cff9b 100755 --- a/aprs_utils/set_beacon.sh +++ b/aprs_utils/set_beacon.sh @@ -144,6 +144,7 @@ ConstructBeaconFile() Interface="0" TimeInterval="-1" crontab_time_string="* * * * *" +crontab_delay_string="sleep \\\$(echo | awk '{print rand()*60};') && " crontab_command_string_ax0="/home/marcel/ham/aprs_utils/send_beacon_internal_radio.sh" crontab_command_string_ax1="/home/marcel/ham/aprs_utils/send_beacon_external_radio.sh" crontab_command_string_ax2="/home/marcel/ham/aprs_utils/send_beacon_lora_radio.sh" @@ -210,17 +211,17 @@ if [ "$work_with_config_file" -eq "1" ]; then # Select ax.25 port if [ "$Interface" == "ax0" ]; then - crontab_full_string="$crontab_time_string $crontab_command_string_ax0" + crontab_full_string="$crontab_time_string $crontab_delay_string$crontab_command_string_ax0" sed_string="sed -i \"/send_beacon_internal_radio/c\\$crontab_full_string\" $crontab_intermediate_file" elif [ "$Interface" == "ax1" ]; then - crontab_full_string="$crontab_time_string $crontab_command_string_ax1" + crontab_full_string="$crontab_time_string $crontab_delay_string$crontab_command_string_ax1" sed_string="sed -i \"/send_beacon_external_radio/c\\$crontab_full_string\" $crontab_intermediate_file" elif [ "$Interface" == "ax2" ]; then - crontab_full_string="$crontab_time_string $crontab_command_string_ax2" + crontab_full_string="$crontab_time_string $crontab_delay_string$crontab_command_string_ax2" sed_string="sed -i \"/send_beacon_lora_radio/c\\$crontab_full_string\" $crontab_intermediate_file" else echo "No valid value. Using default." - crontab_full_string="$crontab_time_string $crontab_command_string_ax0" + crontab_full_string="$crontab_time_string $crontab_delay_string$crontab_command_string_ax0" sed_string="sed -i \"/send_beacon_internal_radio/c\\$crontab_full_string\" $crontab_intermediate_file" fi diff --git a/web-interface/index.php b/web-interface/index.php index 60bffef..ddd6977 100644 --- a/web-interface/index.php +++ b/web-interface/index.php @@ -385,7 +385,24 @@ ?> - + +

APRS-IS (internet)

+

+ "; + } + } + + ?> +

+

  Back