[arm-allstar] Received variable - and automation delay

David Panscik dpanscik at yahoo.com
Tue May 5 15:00:21 EDT 2020


 Doug,
This is right up the alley of what I was looking for.
Ill use your code sample and see if I can get something accomplished here.
Thank you,
David
    On Tuesday, May 5, 2020, 11:56:24 AM PDT, Doug Crompton via ARM-allstar <arm-allstar at hamvoip.org> wrote:  
 
 David,

 This really would not have anything directly to do with cron but rather
would be applied to a script the cron called.  The fact that the TX has
been keyed is known by the RPT_TXKEYED variable. This variable can be used
in an event in Asterisk to call a script. This is what might be used to
control a fan and in fact the same principle would be used for a delay time.

Here is an example that would get you started.  You add the events to
rpt.conf and then run this script in the background adding the event to
call after the delay.  You could have multiple of these scripts running.
They could be started manually or in rc.local. Also keep in mind that the
telemetry system in Allstar while better than most controllers is limited
in some ways that might make this system not work the way intended. This is
on our list of things to improve.

# Add the following two lines to rpt.conf
# in the [events] section uncomment them
# remove the #  Do NOT uncomment
# here in this script.

# touch /tmp/RPT_TXXKEYED = s|t|RPT_TXKEYED
# rm -f /tmp/RPT_TXKEYED = s|f|RPT_TXKEYED

# TX Key file check
TXKEYED="/tmp/TXKEYED"

# delay at unkey
# This is in seconds or with 'm' for minutes
delay="1m"

function Delay {
while [ -e $TXKEYED ]
do
  sleep 1
done
sleep $delay

}

while :
do
if [ -e  $TXKEYED ]
  then
    echo "TX"
    Delay
    run_once=0
  else
    echo "NO TX"
    if [ run_once == 0 ]
      then
          # call operations to execute after delay here
          run_once=1
    fi
fi
sleep 1
done


*73 Doug*

*WA3DSP*

*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*


On Tue, May 5, 2020 at 10:46 AM "David Panscik via ARM-allstar" <
arm-allstar at hamvoip.org> wrote:

> I am not a good programmer.  More of a copy and paste coder with a little
> extra syntax thrown in to muddle solutions together.
> My end goal is to write a crontab schedule parser that can delay crontab
> events if there has been a keyup with in xx number of minutes.
> On the air I have heard reference that several people can use this feature.
> I see in supermon there is a "recieved" field that pulls data from
> console.log
> This field would be perfect to determine if a crontab event needs to be
> delayed or allowed to continue.
> Has anyone written some code to parse this into a system variable?
> console.log tabledata[localNode].remote_nodes[row].last_keyed)
> Thanks,
> David
>
> _______________________________________________
>
> 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/4 web page - http://hamvoip.org
_______________________________________________

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/4 web page - http://hamvoip.org
  


More information about the ARM-allstar mailing list