Loading ...
Sorry, an error occurred while loading the content.

Re: startup file location for script fan_ctrl

Expand Messages
  • tentecorion
    ... I guess I must be stupid but i have had no luck in geting this script to work. Here s what I did I placed this at the end of rc.irlp: # Controls TX Fan if
    Message 1 of 7 , Mar 15 8:20 PM
    • 0 Attachment
      --- In irlp-embedded@yahoogroups.com, "Don" <donmor46@...> wrote:
      >
      > This is the fan script that I run on two different nodes and works well.
      > Note down several lines where you have to add some lines to the rc.irlp file.......
      > I think that will get things going for you.
      >
      > Don VE7EDA
      >
      >
      >
      I guess I must be stupid but i have had no luck in geting this script to work. Here's what I did"

      I placed this at the end of rc.irlp:

      # Controls TX Fan
      if [ -f ${CUSTOM}/txfan ] ; then
      echo -n "Starting TXFAN process..."
      killall txfan &>/dev/null
      /bin/su - -c ${CUSTOM}/txfan repeater &>/dev/null &
      echo "done!"
      fi


      Then I created a file named txfan and placed it in /home/irlp/custom put all this in it:

      # Define the AUX Switch that the fan is connected to
      AUXPORT=3

      # Define the period of time after the PTT drops to shut off the fan
      TIMEAFTER=300

      # define variables
      declare -i IDLETIMER

      # need to set environment
      . /home/irlp/custom/environment

      # Make sure we are user repeater!!!
      if [ `/usr/bin/whoami` != "repeater" ] ;
      then
      echo This program must be run as user REPEATER!
      exit 1
      fi

      # Start with state set to "Initial"

      STATE="Initial"

      while [ TRUE ]
      do

      case "$STATE" in


      "Initial") # Wait for first keyup, then proceed to Countdown

      echo -en "\n\n"`date ` "STATE = Initial\n"

      # while IRLP board is silent (PTT=T)
      while $BIN/pttstate ; do
      sleep 1
      done

      echo -en "\nPTT keyed, activating fan"
      ${BIN}/aux"$AUXPORT"on
      STATE="Countdown"
      ;;


      "Countdown") # Count down period, if PTT is triggered, reset the timer.

      echo -en "\n\n"`date ` "STATE = Countdown\n"
      sleep 1
      IDLETIMER=$TIMEAFTER

      while [ TRUE ]
      do
      echo -en "\rWaiting for Countdown: $IDLETIMER "
      IDLETIMER=$IDLETIMER-1
      sleep 1

      if ! $BIN/pttstate
      then
      IDLETIMER=$TIMEAFTER
      fi

      if [ $IDLETIMER = 0 ]
      then
      break
      fi
      done

      echo -en "\nTimer expired, deactivating fan"
      ${BIN}/aux"$AUXPORT"off
      STATE=Initial
      ;;

      esac
      done

      echo -e "\n\nOops! - Not supposed to get to here"


      I then flash_sync and reboot.

      At the end of boot it echoed "Starting TXFAN process"...."Done"

      When the transmitter activates I get no AUX light.

      Does anyone have a clue what I am doing wrong?

      Thanks,

      Tom NJ1K
    • tentecorion
      OK, I did finally get the script to run, but only if I manuall start it. It doesn t seem to wantr to start itself when that server starts.
      Message 2 of 7 , Mar 16 5:26 AM
      • 0 Attachment
        OK, I did finally get the script to run, but only if I manuall start it. It doesn't seem to wantr to start itself when that server starts.
      • AG0N-3055
        ... I didn t look through the actual script in your note to see if you had any problems in it (just woke up), but you don t say how long the transmitter was
        Message 3 of 7 , Mar 16 5:35 AM
        • 0 Attachment
          On Fri, 16 Mar 2012 03:20:17 -0000, tentecorion wrote:

          > I guess I must be stupid but i have had no luck in geting this script to work. Here's what I did"

          I didn't look through the actual script in your note to see if you had
          any problems in it (just woke up), but you don't say how long the
          transmitter was keyed before you declared it not working. The script
          does not start the fan immediately upon keyup. It assumes a fan is not
          needed for short key periods. I believe that period is settable in the
          script, and I think I run 30 seconds or so on mine.

          Sorry if I missed something and this doesn't help.

          Gary
          --
          http://ag0n.net
          3055: http://ag0n.net/irlp/3055
          NodeOp Help Page: http://ag0n.net/irlp
        • tentecorion
          ... OK, it seems permissions was the reason I could not get it to run manually. I got that fixed. Then it didn t like lines 28 and 51: 28:
          Message 4 of 7 , Mar 16 5:58 AM
          • 0 Attachment
            --- In irlp-embedded@yahoogroups.com, AG0N-3055 <mcduffie@...> wrote:
            >
            > On Fri, 16 Mar 2012 03:20:17 -0000, tentecorion wrote:
            >
            > > I guess I must be stupid but i have had no luck in geting this script to work. Here's what I did"
            >
            > I didn't look through the actual script in your note to see if you had
            > any problems in it (just woke up), but you don't say how long the
            > transmitter was keyed before you declared it not working. The script
            > does not start the fan immediately upon keyup. It assumes a fan is not
            > needed for short key periods. I believe that period is settable in the
            > script, and I think I run 30 seconds or so on mine.
            >
            > Sorry if I missed something and this doesn't help.
            >
            > Gary
            > --
            > http://ag0n.net
            > 3055: http://ag0n.net/irlp/3055
            > NodeOp Help Page: http://ag0n.net/irlp
            >

            OK, it seems permissions was the reason I could not get it to run manually. I got that fixed. Then it didn't like lines 28 and 51:

            28: ${BIN}/aux"$AUXPORT"on
            51 ${BIN}/aux"$AUXPORT"off

            The macnihe interpreted these as auxauxport. I removed aux and now it runs fine but will not run the script automatically when the machine boots.

            Any help appreciated
            Tom NJ1K
          • tentecorion
            Ok, nevermind, I goty it all taken care of... Tom NJ1K
            Message 5 of 7 , Mar 17 6:56 PM
            • 0 Attachment
              Ok, nevermind, I goty it all taken care of...

              Tom

              NJ1K
            Your message has been successfully submitted and would be delivered to recipients shortly.