Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: control beacon transmission using an external command #179

Open
arodland opened this issue Oct 30, 2018 · 1 comment
Open

Comments

@arodland
Copy link
Contributor

Use case: I have direwolf running headless on a pi connected to the mobile rig in my car. I can use aprsdroid to view the map and do messaging, but direwolf beacons on its own using gpsd+smartbeaconing, whether my phone is connected or not. I also have a commentcmd set up to pull QSY information from my radio and even adjust the comment based on which channel I have the subband to. So far so good.

But I would also like to be able to tell direwolf that it shouldn't transmit at all if the subband of my radio isn't tuned to APRS. As a minimal working hack I've added a return; to the "COMMENTCMD failure" case in beacon_send, but I am of course open to a cleaner method.

@radar27
Copy link

radar27 commented Mar 5, 2020

Greetings,

There is a TX Inhibit Input via GPIO referenced in the User-Guide.pdf on pages 71-72

9.2.11 Radio Channel – Transmit Inhibit Input
For the Linux version only, it is possible to have a GPIO control input to prevent transmitting. This might
be used with a squelch signal from the receiver. A site with multiple radios could use this to give priority
to the other radio service when it is active.

TXINH GPIO 17
TXINH GPIO -17
As with PTT, minus in front of the GPIO number means invert the signal.

One could wire some other GPIO pin to the TXINH pin (say GPIO 16 for output then GPIO 17 for TXINH via small jumper) then via script toggle GPIO 16 high or low as needed. I have not done this specifically, but I wrote a small bash script to manually activate the PTT line for various testing. Here is the body of that script.

#!/bin/bash
PTTGPIO=16
if [ -z $1 ]
then
echo Activating PTT, press any key to stop
echo 1 > /sys/class/gpio/gpio${PTTGPIO}/value
read foo
echo Deactivating PTT
echo 0 > /sys/class/gpio/gpio${PTTGPIO}/value
else
echo Activating PTT for $1 seconds
echo 1 > /sys/class/gpio/gpio${PTTGPIO}/value
sleep $1
echo Deactivating PTT
echo 0 > /sys/class/gpio/gpio${PTTGPIO}/value
fi

In the event the target GPIO pin is not set, this script will set it up for output.

if [ ! -d /sys/class/gpio/gpio16 ]
then
echo GPIO16 is not setup for Output
sudo su -c "echo 16 > /sys/class/gpio/export"
sudo su -c "echo out > /sys/class/gpio/gpio16/direction"
echo GPIO16 setup complete
fi

With the above options in direwolf.conf and GPIO setup, inhibiting transmit is just:

echo 1 > /sys/class/gpio/gpio16/value

Reenabling transmit is then

echo 0 > /sys/class/gpio/gpio16/value

I hope this helps.

73!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants