Author: Terry Claiborne
Contact: kc3kmv@yahoo.com
Manual Mode + Optional Web UI Add-On
This repo contains two parts:
-
Base manual STFU mode
- helper script:
bm-stfu.sh - base installer:
install_bm_stfu_manual_mode.sh
- helper script:
-
Optional STFU Web UI add-on
- web installer:
install_stfu_web.sh - web files are stored in the repo under
web-ui/
- web installer:
The Web UI is an add-on for the base STFU project.
It does not work by itself.
git clone https://github.com/TerryClaiborne/bm-stfu-manual-mode.git && cd bm-stfu-manual-mode && chmod +x install_bm_stfu_manual_mode.sh && sudo ./install_bm_stfu_manual_mode.shFrom inside the same repo directory:
chmod +x install_stfu_web.sh && sudo ./install_stfu_web.shThe Web UI installer checks for the base install first.
If /usr/local/bin/bm-stfu.sh is missing, the Web UI installer stops and tells you to install the base project first.
After install, this is all you need:
sudo bm-stfu.sh start 3220008
sudo bm-stfu.sh tune 91
sudo bm-stfu.sh stop
sudo bm-stfu.sh statusThat’s it.
Edit your live file:
sudo nano /opt/MMDVM_Bridge/DVSwitch.iniSet the values that match your system, including:
BMPasswordUserIDTalkerAliasStartTG
If STFU briefly lands on TG91 before switching to the talkgroup you requested, set:
StartTG=0That avoided the brief unwanted startup hit on TG91 on my system.
The base installer will prompt you for these values during install:
MAIN_NODE
DVSWITCH_NODE
For a normal new install, you should not need to edit /usr/local/bin/bm-stfu.sh by hand.
If you ever need to review or change them later, you can check:
sudo nano /usr/local/bin/bm-stfu.shStart STFU on a talkgroup:
sudo bm-stfu.sh start 3220008Change talkgroups while STFU is already running:
sudo bm-stfu.sh tune 91Stop STFU and return to normal:
sudo bm-stfu.sh stopShow current status:
sudo bm-stfu.sh statusThe STFU Web UI is an optional browser-based front end for bm-stfu.sh.
It provides:
- Start
- Change TG
- Stop
- Refresh Status
- Save Favorite
- Load Favorite
- Delete Favorite
- private target support with trailing
#
Example private target:
3220008#
On my working system, the live files are installed to:
/var/www/html/stfu
Installed live files:
/var/www/html/stfu/index.php
/var/www/html/stfu/favorites.txt
/var/www/html/stfu/README.txt
/var/www/html/stfu/sudoers-example.txt
Repo source files:
web-ui/index.php
web-ui/favorites.txt
web-ui/README.md
web-ui/sudoers-example.txt
Saved favorites are stored in:
/var/www/html/stfu/favorites.txt
Each favorite includes:
- TG / Private TG
- Station Name / Label
- Description
Use this if you want the easiest supported path.
git clone https://github.com/TerryClaiborne/bm-stfu-manual-mode.git
cd bm-stfu-manual-mode
chmod +x install_bm_stfu_manual_mode.sh
sudo ./install_bm_stfu_manual_mode.shRun this only after the base manual mode is already working:
cd bm-stfu-manual-mode
chmod +x install_stfu_web.sh
sudo ./install_stfu_web.shThe Web UI installer now:
- installs the Web UI files
- installs the
stfu-websudoers rule - validates the sudoers file
- backs up an existing sudoers file before replacing it
- tests
bm-stfu.sh statusaswww-data
Use this if you do not want to run the installer scripts.
git clone https://github.com/TerryClaiborne/bm-stfu-manual-mode.git
cd bm-stfu-manual-mode
sudo apt update
sudo apt install -y gitCheck that DVSwitch / MMDVM_Bridge is already installed:
ls -l /opt/MMDVM_Bridge/DVSwitch.iniClone the STFU upstream repo:
sudo git clone https://github.com/DVSwitch/STFU.git /opt/STFUInstall the correct STFU binary.
For most 64-bit Debian / ASL3 systems:
sudo install -m 0755 /opt/STFU/bin/STFU.amd64 /usr/local/bin/STFUFor ARM64 systems:
sudo install -m 0755 /opt/STFU/bin/STFU.arm64 /usr/local/bin/STFUFor ARMHF systems:
sudo install -m 0755 /opt/STFU/bin/STFU.armhf /usr/local/bin/STFUInstall the helper script:
sudo install -m 0755 bm-stfu.sh /usr/local/bin/bm-stfu.shLink DVSwitch.ini into /opt/STFU:
sudo ln -sf /opt/MMDVM_Bridge/DVSwitch.ini /opt/STFU/DVSwitch.iniEdit your BrandMeister settings:
sudo nano /opt/MMDVM_Bridge/DVSwitch.iniMake sure [STFU] has your real values for:
BMPasswordUserIDTalkerAliasStartTG
Recommended:
StartTG=0If you used the manual install instead of the base installer, you must also set your node values in:
sudo nano /usr/local/bin/bm-stfu.shSet:
MAIN_NODE="YOUR_NODE"
DVSWITCH_NODE="YOUR_DVSWITCH_NODE"Test it:
sudo bm-stfu.sh status
sudo bm-stfu.sh start 3220008
sudo bm-stfu.sh tune 91
sudo bm-stfu.sh stopUse this only after the base manual STFU mode is already working.
Create the live web directory:
sudo mkdir -p /var/www/html/stfuCopy the web UI files:
sudo cp web-ui/index.php /var/www/html/stfu/index.php
sudo cp web-ui/favorites.txt /var/www/html/stfu/favorites.txt
sudo cp web-ui/README.md /var/www/html/stfu/README.txt
sudo cp web-ui/sudoers-example.txt /var/www/html/stfu/sudoers-example.txtSet file ownership and permissions:
sudo chown root:www-data /var/www/html/stfu/index.php
sudo chmod 644 /var/www/html/stfu/index.php
sudo chown www-data:www-data /var/www/html/stfu/favorites.txt
sudo chmod 664 /var/www/html/stfu/favorites.txt
sudo chown root:root /var/www/html/stfu/README.txt
sudo chmod 644 /var/www/html/stfu/README.txt
sudo chown root:root /var/www/html/stfu/sudoers-example.txt
sudo chmod 644 /var/www/html/stfu/sudoers-example.txtInstall the sudoers rule:
echo 'www-data ALL=(ALL) NOPASSWD: /usr/local/bin/bm-stfu.sh' | sudo tee /etc/sudoers.d/stfu-web >/dev/null
sudo chown root:root /etc/sudoers.d/stfu-web
sudo chmod 440 /etc/sudoers.d/stfu-web
sudo visudo -cf /etc/sudoers.d/stfu-webCheck PHP syntax:
sudo php -l /var/www/html/stfu/index.phpTest backend access as the web user:
sudo -u www-data sudo /usr/local/bin/bm-stfu.sh statusOpen the Web UI:
http://YOUR_NODE_IP/stfu/
If you want to remove only the Web UI add-on:
Back up favorites first if you want to keep them:
sudo cp /var/www/html/stfu/favorites.txt /root/favorites.txt.backupRemove the live Web UI files:
sudo rm -rf /var/www/html/stfuRemove the sudoers rule:
sudo rm -f /etc/sudoers.d/stfu-webThat removes:
- the web page
- saved favorites
- the web sudoers rule
It does not remove the base STFU manual mode.
If you want to remove the STFU base install too:
Stop STFU if it is running:
sudo bm-stfu.sh stop || trueRemove the installed helper script and binary:
sudo rm -f /usr/local/bin/bm-stfu.sh
sudo rm -f /usr/local/bin/STFURemove the STFU working directory:
sudo rm -rf /opt/STFUOptional: remove the local repo clone too:
rm -rf ~/bm-stfu-manual-modeOr, if you cloned it somewhere else, remove that directory instead.
The Web UI needs permission for the Apache web user to run the helper script.
A typical installed sudoers file is:
/etc/sudoers.d/stfu-web
Typical contents:
www-data ALL=(ALL) NOPASSWD: /usr/local/bin/bm-stfu.sh
Validate it with:
sudo visudo -cf /etc/sudoers.d/stfu-webThe Web UI installer now installs and validates the sudoers rule automatically.
It also backs up an existing sudoers file before replacing it.
sudo chown root:www-data /var/www/html/stfu/index.php
sudo chmod 644 /var/www/html/stfu/index.php
sudo chown www-data:www-data /var/www/html/stfu/favorites.txt
sudo chmod 664 /var/www/html/stfu/favorites.txt- Start should be used first.
- Change TG is meant for changing talkgroups after STFU is already active.
- Add Favorite is for adding a new favorite.
- Load fills the control target for quick use.
- Favorites are shown in a visible list and use
favorites.txt.
Warning: If you leave STFU active and then switch to AllTune2 or other DVSwitch tools, normal MMDVM_Bridge operation may not work until STFU is stopped and normal bridge mode is restored. Always press Stop before leaving the STFU Web UI or before using AllTune2.
Check:
- base manual STFU mode is installed first
bm-stfu.shworks from the command line- sudoers rule exists and is valid
favorites.txtexists and is writable bywww-data
Check Apache errors:
sudo tail -n 50 /var/log/apache2/error.logCheck PHP syntax:
sudo php -l /var/www/html/stfu/index.phpSet this in DVSwitch.ini:
StartTG=0The easiest recovery path is:
cd ~/bm-stfu-manual-mode
git pull origin mainThen:
- verify the correct
MAIN_NODEandDVSWITCH_NODEare in/usr/local/bin/bm-stfu.sh - rerun the Web UI installer:
chmod +x install_stfu_web.sh
sudo ./install_stfu_web.shThis repo now supports:
- Base manual STFU mode
- Optional STFU Web UI add-on
Install the base project first.
Then install the optional Web UI if you want browser-based control.
You can now install it either way:
chmod +x install_bm_stfu_manual_mode.sh && sudo ./install_bm_stfu_manual_mode.sh
chmod +x install_stfu_web.sh && sudo ./install_stfu_web.shUse the Install and Uninstall sections above for the full manual path.