[App_rpt-users] GPIO Timeouts

mike at midnighteng.com mike at midnighteng.com
Sun Jun 14 14:53:39 UTC 2015


Barry,

I wrote a little script to do what you want.

To use it, make a command for calling the script.
XXX=cmd,/etc/asterisk/myscripts/macro-timer.sh

when you execute your macro calling the change in gpio, add a call to the
above command to the end of that macro.

edit the script to your set time and inside the script to the call to the
macro you want to call to turn it off after the timer has elapsed.

Timer is in seconds.

here is the script...

#!/bin/bash
# mike/kb8jnm - macro-timer.sh
# create delay / run command
# make a command for this script, call it from a macro string


# set wait time in seconds 600 = 5min - 1800 = 15min
sleep 1200


# execute command (calling a macro to shut off the called function)
# format is - rpt fun NODE# CMD#
asterisk -rx "rpt fun 29283 *5xxxx"


# will clean exit after waiting and executing


...Let me know how it works for you.

...mike/kb8jnm



> Hi
>
> I have used the cop61 to switch GPIO Port1 on/off no problems I have a
> macro that does 2 commands one switching the GPIO on/off and another that
> does localplay <sound_file> to say enabled or disabled etc.
>
> I am looking to figure out how I can auto control this so that if a user
> sends the
> dtmf code to turn on the GPIO Port1 and leaves it on after a period of
> time
> say 30 mins later the command then times_out and resets its self back to
> the off state ?
>
> is there a way to do that ? I have been looking at functions and things
> cant quite figure it out ?
>
> Thanks All Barry G8SAU Node 2536
>
> _______________________________________________
> App_rpt-users mailing list
> App_rpt-users at ohnosec.org
> http://ohnosec.org/cgi-bin/mailman/listinfo/app_rpt-users
>
> To unsubscribe from this list please visit
> http://ohnosec.org/cgi-bin/mailman/listinfo/app_rpt-users and scroll down
> to the bottom of the page. Enter your email address and press the
> "Unsubscribe or edit options button"
> You do not need a password to unsubscribe, you can do it via email
> confirmation. If you have trouble unsubscribing, please send a message to
> the list detailing the problem.
>





More information about the App_rpt-users mailing list