[arm-allstar] Fan Control Script
Arthur Putnam
n7mnk at yahoo.com
Sat Oct 27 19:52:43 EDT 2018
Thank you very much Doug for taking the time to help me with this I much appreciate it. Thank you
Arthur Putnamemail:n7mnk at yahoo.com
A request from the sender of this e-mail message to the recipient: If you forward this email message, please delete the forwarding history, which includes my email address. It is a courtesy to me and others who may not wish to have their email addresses sent all over the world! Erasing the history helps prevent spammers from mining addresses and sending viruses. Thank you
On Saturday, October 27, 2018, 1:42:39 PM PDT, Doug Crompton via ARM-allstar <arm-allstar at hamvoip.org> wrote:
Below is a fan control script. It uses events to control the fan and as
configured it delays for 1 minute after unkey. The bit it sets is GPIO.23
to turn on the fan. This is also changeable. See gpio readall at the
Linux prompt. Do not apply any voltage to thie selected pin. It is an
output to drive a relay or solid-state fan controller. You can certainly
change this script to suit your needs. Put this script in
/etc/asterisk/local and run it in the background after testing. I call it
fan_control.sh
To run in the background put this at the beginning of /etc/rc.local -
/etc/asterisk/local/fan_control.sh &
#!/bin/bash
# Script to check for PTT and turn on fan via GPIO
# D. Crompton WA3DSP 10/2018
# Make sure the events stanza is named properly
# The node stanza will have an events=eventsxxxxx
# where xxxxx is the node number. Replace the
# xxxxx with the node number below
# Add the following three lines to rpt.conf
# [eventsxxxxx]
# touch /tmp/RPT_TXXKEYED = s|t|RPT_TXKEYED
# rm -f /tmp/RPT_TXKEYED = s|f|RPT_TXKEYED
# TX Key file check
TXKEYED="/tmp/RPT_TXKEYED"
# Fan delay at unkey
# This is in seconds or with 'm' for minutes
fan_delay="1m"
# GPIO fan control pin
# GPIO.23 Pi Physical pin 33
FAN_BIT=23
function FAN_ON {
# Turn on Fan
gpio write $FAN_BIT 1
while [ -e $TXKEYED ]
do
sleep 1
done
sleep $fan_delay
}
gpio mode $FAN_BIT out
while :
do
if [ -e $TXKEYED ]
then
echo "TX"
FAN_ON
else
echo "NO TX"
# turn fan off
gpio write $FAN_BIT 0
fi
sleep 1
done
*73 Doug*
*WA3DSP*
*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
_______________________________________________
ARM-allstar mailing list
ARM-allstar at hamvoip.org
http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
Visit the BBB and RPi2/3 web page - http://hamvoip.org
More information about the ARM-allstar
mailing list