Running Events following update to ASL3

Hello,
I have just updated my Allstar node from version 1 to version 3.
All is well with the node operation however I have got two LED indicators on the node to show RX/TX state.
The script in the [events] section of version 1 had the following syntax
[events]
;;;;; Events Management ;;;;;
;status,2 = c|f|RPT_NUMLINKS ; Say time of day when all links disconnect.
/usr/local/sbin/TxKeyed = s|t|RPT_TXKEYED
/usr/local/sbin/TxUnKeyed = s|f|RPT_TXKEYED
/usr/local/sbin/RxActive = s|t|RPT_RXKEYED
/usr/local/sbin/RxInActive = s|f|RPT_RXKEYED

However following the install on version 3 the LEDs do not function. If I run the commands on the command line then the LEDs light accordingly.
Please can someone advise on the changes I need to make for ASL3?
Regards
Phil G0ELM

What are those scripts doing? It’s likely a permissions issue since asterisk doesn’t run as root.

Hi,
Thanks for the reply.

For example the compiled C source file is

#include <wiringPi.h>
#include <stdlib.h>
int main(void)
{
wiringPiSetup();
pinMode(2,OUTPUT);
digitalWrite(2,LOW);
exit(0);
}

The permissions on the compiled file are
-rwxr-xr-x 1 root root 70544 Jan 25 12:23 RxActive
-rwxr-xr-x 1 root root 70544 Jan 25 12:23 RxInActive
-rwxr-xr-x 1 root root 70544 Jan 25 12:23 TxKeyed
-rwxr-xr-x 1 root root 70544 Jan 25 12:23 TxUnKeyed

I know that in ASL version 1 it ran as root, but ASL3 runs under user asterisk.

Should the permissions allow the GPIO access.
The compiled files under node username and root run fine. What do I need to do to add users asterisk to get the scripts to function. asterisk is a member of group dialout but does it need to be a member of another group to access the GPIO?
Regards
Phil G0ELM

Try adding the user asterisk to the group gpio and restarting Asterisk.

usermod -aG gpio asterisk

Great I have just done that independenty and it works!
Many thanks for your advice.
Regards
Phil G0ELM

Well, don’t do it indecently!! :slight_smile:

Glad it’s working.

Didn’t edit it in time!!!
Cheers

Hi Phil, I’m currently trying to do the same… Is it OK to email you directly about the script for this?

Hi Kev,
I was using the same scripts on my ASL 1 version node.
My control files are .c files and I had to recompile them under 64 bit for ASL 3.
e.g. RxActive.c

#include <wiringPi.h>
#include <stdlib.h>
int main(void)
{
wiringPiSetup();
pinMode(3,OUTPUT);
digitalWrite(3,LOW);
exit(0);
}


Then compile with

gcc -o RxActive RxActive.c -lwiringPi

Then moved the output file to /usr/local/sbin/. ands make executable.

You might not be using compiled .c files for your functionality.

My stanza in rpt.conf for enabling event and setting the event functionality is:-

events=events46839

[events46839]
;;;;; Events Management ;;;;;
;status,2 = c|f|RPT_NUMLINKS ; Say time of day when all links disconnect.
/usr/local/sbin/TxKeyed = s|t|RPT_TXKEYED
/usr/local/sbin/TxUnKeyed = s|f|RPT_TXKEYED
/usr/local/sbin/RxActive = s|t|RPT_RXKEYED
/usr/local/sbin/RxInActive = s|f|RPT_RXKEYED


I had problems getting the functions to run from Allstar as I could get the files to execute from the command line

sudo …sh

But not from Asterisk.
Because ASL 3 runs under user asterisk not root as ASL 1 you have to make asterisk a member of the GPIO group in Linux for the scripts to function.

You can email me
g0elm@btinternet.com

If you want any further advice etc.
Regards
Phil G0ELM

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.