Run external script when local RF detected

General support for the Pi-Star System
Post Reply
M0LMK
Posts: 2
Joined: Mon Jan 21, 2019 4:02 pm

Run external script when local RF detected

Post by M0LMK » Sun Mar 17, 2019 1:14 pm

On our repeater we have TG6 connected to XLX, TG8 connected to DMR+ and TG9 connected to BM all on TS2. All of them connect to different reflectors which puts a good bit of activity over the repeater but id a local RF users wants to use BM they have to manually disconnect the XLX and DMR+ reflectors first otherwise they can lose their QSO if some network traffic comes in XLX or DMR+.

There seems to be no way of automatically giving preference to the last active TG/Network so I was thinking about having a go at writing a script that can run when local RF is detected and then either disconnect or mute whatever TG/Reflectors are not being used. It could keep them disconnected/muted for x minutes after the last local RF input then connect/unmute them if no more local RF is detected on the TG in use.

Is there a way to get Pi-Star to call an external script when local RF input is detected? Is this a viable solution? Does anyone have any thoughts? I've never dug into the Pi-Star code so wanted to get some thoughts before I started!

M1DNS
Posts: 203
Joined: Thu Apr 05, 2018 5:30 am

Re: Run external script when local RF detected

Post by M1DNS » Sun Mar 17, 2019 2:24 pm

Nothing comes to my mind imediatly. So Maybe, create a 'monitoring script' that watches the log files. when it logs an RF user, you action ur 'disconnect script'

There's a new mmdvm release, not part of pistar currently but it enhances the remote abilities of mmdvm enabling you to remotely set a mode, drop a mode or hold a mode for a given time. It isn't designed to work with dropping specific TG's, but Maybe look over that, to see if part of it could be repurposed for ur own needs or to give futhur ideas how to do what you require.

Andrew M1DNS, (Mod)






Andrew M1DNS.
Pi-star Admin Team.

M0LMK
Posts: 2
Joined: Mon Jan 21, 2019 4:02 pm

Re: Run external script when local RF detected

Post by M0LMK » Tue Mar 19, 2019 4:31 pm

Thanks Andrew.

I've got that working fine and can now 'do something' if an RF user comes onto a specific talkgroup.

My next question is...

Is there a way to either mute (prefered) or disconnect networks from the command line?

Thanks.

M1DNS
Posts: 203
Joined: Thu Apr 05, 2018 5:30 am

Re: Run external script when local RF detected

Post by M1DNS » Tue Mar 19, 2019 6:14 pm

This will be the fun part.
You'll need to find a way to trick the software into believing it just recieved a
64000 to disconnect from XLX and/or a
84000 to drop the DMR+ link.

You might be able to use something in the options line of DMR+
StartRef=4000;RelinkTime=60;UserLink=1;TS1_1=9;
Which starts the dmr+ without a reflector connection.
But you'll need to restart dmrgateway to read the file on boot. which will also drop all connections until it comes back up again.

It's gonna be fun.

It could be a good idea to join the MMDVM group.
To also pose ur question there, hopefully getting a few more
ideas how you might do this

Andrew M1DNS, (Mod)



Andrew M1DNS.
Pi-star Admin Team.

Post Reply