Create the utility “aux” by undertaking the following steps:

cd /usr/local/sbin
wget http://www.qsl.net/k0kn/aux
Make the file executable: chmod +x /usr/local/sbin/aux

Create the utility “txfan” by undertaking the following steps:

cd /usr/local/sbin
wget http://www.qsl.net/k0kn/txfan
vi /usr/local/sbin/txfan

(or use your favorite editor on that file)

In that file you will make several modifications.  These should be somewhat obvious as I point them out to you:

  • Is your fan controlled by pin 4 on the parallel port? Change that as appropriate.
  • Kyle put his aux utility in /home/kyle but I had you create yours in /usr/local/sbin so you will change that.
  • Kyle was controlling his node 2211. I am controlling 27006 in my example. You will change as appropriate.
  • You may wish to adjust the trigger times for when the fan comes on and turns off.

For me, I end up with this line in that file:

FANON="/usr/local/sbin/aux 27006 4 1"

Of course yours will be custom to your application.  Now save and close the file (in vi I like ESC then ZZ).  Make the file executable with chmod like:

chmod +x /usr/local/sbin/aux

Put these utilities to work as follows:

  1. Edit /etc/asterisk/rpt.conf for each node you want to control the fan. Yes, you can have multiple nodes that control a single fan. The details of this step are outlined in the remarks for txfan from K0KN. Follow my example here as we make the magic happen for node 27006:
  2. In the section [27006] we will modify or add, as required, a statement that says: events=events27006
  3. Create a section [events27006] now elsewhere in the rpt.conf file. That section will look something like this:
[events27006]
touch /dev/shm/~pttstate = s|t|RPT_TXKEYED
rm -f /dev/shm/~pttstate = s|f|RPT_TXKEYED

You can now invoke the txfan script from your command line.  When you do it will show you the state of the fan and the timers.  Pretty cool really and it let’s you know that it’s working and helps you to troubleshoot if it isn’t.  For unattended operation though you really don’t care about that.  What you do care about is that the script get started on boot.  To do this, edit /etc/rc.local to add the following near the end of the file (see remarks in your txfan utility):

CUSTOM=/usr/local/sbin
if [ -f $CUSTOM/txfan ] ; then
echo -n "Starting TXFAN process..."
killall txfan &>/dev/null
/bin/su - -c $CUSTOM/txfan root &>/dev/null &
echo "done!"
fi

Reboot and verify proper function of the fan.