From 40cb845e344f051745c91e45e13a244ffdeaba78 Mon Sep 17 00:00:00 2001 From: kx1t Date: Thu, 16 Nov 2023 23:13:44 -0500 Subject: [PATCH] add ability to configure TX comments --- README.md | 1 + docker-compose.yml | 13 +++++++++---- .../etc/s6-overlay/scripts/30-set-direwolf-params | 9 +++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ff247c9..f24af3f 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ For these parameters, the default values are generally good as a starting point, | `VERBOSE` | If set to `yes`/`on`/`1`/`true`, produce more verbose output | Unset | | `DW_DEBUG` | Sets debug verbosity for DireWolf. For accepted values, see `docker exec -it direwolf --help` | Unset | | `DW_EXTRA_CMDLINEARGS` | Any extra command line arguments you want to pass to DireWolf | Unset | +| `DW_TB_COMMENT` | Any comment text you want to add to your Tracker Beacon transmissions | Unset | \* If the automatic setting doesn't work, you can show which audio devices, cards and subdevices are available on your system with the following command: diff --git a/docker-compose.yml b/docker-compose.yml index 3d74e9a..0da6266 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,7 @@ version: '3.8' services: aprs: - #image: ghcr.io/sdr-enthusiasts/docker-aprs-tracker - build: https://github.com/sdr-enthusiasts/docker-aprs-tracker.git + image: ghcr.io/sdr-enthusiasts/docker-aprs-tracker container_name: aprs hostname: aprs restart: always @@ -11,13 +10,19 @@ services: privileged: true environment: - VERBOSE=false - - MYCALL=KX1T-1 + - MYCALL=NOCALL # set your callsign before using the container! + - DW_EXTRA_CONFIGS=TXDELAY=30 + - DW_EXTRA_CMDLINEARGS=-r 48000 + - DW_TB_COMMENT="Myname nocall@amsat.org" + - AUDIOLEVEL_TX=64 + # - DW_DEBUG=tog + # - DW_DONTSTART=true tmpfs: - /run:exec,size=32M - /tmp:size=32M - /var/log:size=32M ports: - - 2947:2947 + - 2947:2947 # exposes the GPSD port in case you want to use it for other purposes on the device volumes: - "/etc/localtime:/etc/localtime:ro" - "/etc/timezone:/etc/timezone:ro" diff --git a/rootfs/etc/s6-overlay/scripts/30-set-direwolf-params b/rootfs/etc/s6-overlay/scripts/30-set-direwolf-params index e543b7b..091d223 100755 --- a/rootfs/etc/s6-overlay/scripts/30-set-direwolf-params +++ b/rootfs/etc/s6-overlay/scripts/30-set-direwolf-params @@ -261,6 +261,15 @@ if [[ -n "$VIA" ]]; then "${s6wrap[@]}" echo "[INFO] Setting VIA: $(grep -o "^\s*#*\s*TBEACON.*$" "$DWCONFIGFILE")" fi +if [[ -n "$DW_TB_COMMENT" ]]; then + if grep -qio "^\s*#*\s*TBEACON.*COMMENT=.*$" "$DWCONFIGFILE"; then + sed -i "s/^\s*#*\s*\(TBEACON.*COMMENT=\).\+\(\b.*\)$/\1${DW_TB_COMMENT}\2/g" "$DWCONFIGFILE" + else + sed -i "s/^\s*#*\s*\(TBEACON.*\)$/\1 COMMENT=${DW_TB_COMMENT}/g" "$DWCONFIGFILE" + fi + "${s6wrap[@]}" echo "[INFO] Setting COMMENT: $(grep -o "^\s*#*\s*TBEACON.*$" "$DWCONFIGFILE")" +fi + if [[ -n "$SMARTBEACONING" ]]; then setdwconfig SMARTBEACONING "$SMARTBEACONING" "${s6wrap[@]}" echo "[INFO] Setting SMARTBEACONING $SMARTBEACONING"