Event Management + COP 62 + GPIO = error?

Hi,
I’m running a RadioUSB channel driver setup with an RA-35 USB peripheral with a CM119A that has several GPIO pins available. I’m attempting to write a test event to set a GPIO pin on that USB peripheral based on a system variable state, but I believe the app_rpt event parser is not correctly working and I’m wondering if this is a bug or there is a work around.

Here’s my GPIO setup in usbradio.conf

[general]

gpio1 = in

gpio2 = out0

gpio4 = out1

gpio5 = in

Here’s my event in rpt.conf

[events1999]

cop,62,GPIO4=1 = c|t|RPT_RXKEYED

cop,62,GPIO4=0 = c|f|RPT_RXKEYED

I receive the following error within the CLI when monitoring activity

ERROR[4499]: app_rpt.c:3483 rpt_event_process: Unrecognized event action (0) in exec item malformed: 0 = c|t|RPT_RXKEYED

ERROR[4499]: app_rpt.c:3483 rpt_event_process: Unrecognized event action (1) in exec item malformed: 1 = c|f|RPT_RXKEYED

It appears the first ‘=’ in the GPIOn=x setting is causing the parser to break the too early per the docs here

http://ohnosec.org/drupal/node/176

Apparently the parser is NOT really looking for ’ = ’ as the delimiting string, but catching ‘=’ instead. I see cop 61 event is looking for “GPIO%d=%d” per line 12827 in app_rpt.c as far as I can tell, but its never getting to that code

https://github.com/AllStarLink/Asterisk/blob/master/asterisk/apps/app_rpt.c

Note I can use the CLI and cop,62 command to properly toggle the GPIO so I know that part of the parser seems to be working OK. I’ve also set a DTMF function command to toggle GPIO and that works too. I’ve also placed other that don’t have an ‘=’ in place of my above cop,62 and that works fine as well.

Any suggestions, fixes or workarounds?

Thanks & 73

andyz - K1RA

http://k1ra.us/

Hi Andy,

Try this:

[functions]

881=cop,62,GPIO4=1

882=cop,62,GPIO4=0

TEMPVAR1 = v|e|"${RPT_RXKEYED}"

*881 = f|t|TEMPVAR1

*882 = f|f|TEMPVAR1

Paul / KN2R

···

On Tue, Aug 1, 2017 at 2:01 AM, K1RA - Andy Z k1ra@k1ra.us wrote:

Hi,
I’m running a RadioUSB channel driver setup with an RA-35 USB peripheral with a CM119A that has several GPIO pins available. I’m attempting to write a test event to set a GPIO pin on that USB peripheral based on a system variable state, but I believe the app_rpt event parser is not correctly working and I’m wondering if this is a bug or there is a work around.

Here’s my GPIO setup in usbradio.conf

[general]

gpio1 = in

gpio2 = out0

gpio4 = out1

gpio5 = in

Here’s my event in rpt.conf

[events1999]

cop,62,GPIO4=1 = c|t|RPT_RXKEYED

cop,62,GPIO4=0 = c|f|RPT_RXKEYED

I receive the following error within the CLI when monitoring activity

ERROR[4499]: app_rpt.c:3483 rpt_event_process: Unrecognized event action (0) in exec item malformed: 0 = c|t|RPT_RXKEYED

ERROR[4499]: app_rpt.c:3483 rpt_event_process: Unrecognized event action (1) in exec item malformed: 1 = c|f|RPT_RXKEYED

It appears the first ‘=’ in the GPIOn=x setting is causing the parser to break the too early per the docs here

http://ohnosec.org/drupal/node/176

Apparently the parser is NOT really looking for ’ = ’ as the delimiting string, but catching ‘=’ instead. I see cop 61 event is looking for “GPIO%d=%d” per line 12827 in app_rpt.c as far as I can tell, but its never getting to that code

https://github.com/AllStarLink/Asterisk/blob/master/asterisk/apps/app_rpt.c

Note I can use the CLI and cop,62 command to properly toggle the GPIO so I know that part of the parser seems to be working OK. I’ve also set a DTMF function command to toggle GPIO and that works too. I’ve also placed other that don’t have an ‘=’ in place of my above cop,62 and that works fine as well.

Any suggestions, fixes or workarounds?

Thanks & 73

andyz - K1RA

http://k1ra.us/


App_rpt-users mailing list

App_rpt-users@lists.allstarlink.org

http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users

To unsubscribe from this list please visit http://lists.allstarlink.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.

Paul / KN2R

Oops typo, meant this:

[functions]

881=cop,62,GPIO4=1

882=cop,62,GPIO4=0

[events]

TEMPVAR1 = v|e|"${RPT_RXKEYED}"

*881 = f|t|TEMPVAR1

*882 = f|f|TEMPVAR1

···

On Tue, Aug 1, 2017 at 7:47 AM, Paul Aidukas paulkn2r@gmail.com wrote:

Hi Andy,

Try this:

[functions]

881=cop,62,GPIO4=1

882=cop,62,GPIO4=0

TEMPVAR1 = v|e|"${RPT_RXKEYED}"

*881 = f|t|TEMPVAR1

*882 = f|f|TEMPVAR1

Paul / KN2R

On Tue, Aug 1, 2017 at 2:01 AM, K1RA - Andy Z k1ra@k1ra.us wrote:

Hi,
I’m running a RadioUSB channel driver setup with an RA-35 USB peripheral with a CM119A that has several GPIO pins available. I’m attempting to write a test event to set a GPIO pin on that USB peripheral based on a system variable state, but I believe the app_rpt event parser is not correctly working and I’m wondering if this is a bug or there is a work around.

Here’s my GPIO setup in usbradio.conf

[general]

gpio1 = in

gpio2 = out0

gpio4 = out1

gpio5 = in

Here’s my event in rpt.conf

[events1999]

cop,62,GPIO4=1 = c|t|RPT_RXKEYED

cop,62,GPIO4=0 = c|f|RPT_RXKEYED

I receive the following error within the CLI when monitoring activity

ERROR[4499]: app_rpt.c:3483 rpt_event_process: Unrecognized event action (0) in exec item malformed: 0 = c|t|RPT_RXKEYED

ERROR[4499]: app_rpt.c:3483 rpt_event_process: Unrecognized event action (1) in exec item malformed: 1 = c|f|RPT_RXKEYED

It appears the first ‘=’ in the GPIOn=x setting is causing the parser to break the too early per the docs here

http://ohnosec.org/drupal/node/176

Apparently the parser is NOT really looking for ’ = ’ as the delimiting string, but catching ‘=’ instead. I see cop 61 event is looking for “GPIO%d=%d” per line 12827 in app_rpt.c as far as I can tell, but its never getting to that code

https://github.com/AllStarLink/Asterisk/blob/master/asterisk/apps/app_rpt.c

Note I can use the CLI and cop,62 command to properly toggle the GPIO so I know that part of the parser seems to be working OK. I’ve also set a DTMF function command to toggle GPIO and that works too. I’ve also placed other that don’t have an ‘=’ in place of my above cop,62 and that works fine as well.

Any suggestions, fixes or workarounds?

Thanks & 73

andyz - K1RA

http://k1ra.us/


App_rpt-users mailing list

App_rpt-users@lists.allstarlink.org

http://lists.allstarlink.org/cgi-bin/mailman/listinfo/app_rpt-users

To unsubscribe from this list please visit http://lists.allstarlink.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.

Paul / KN2R

Paul / KN2R