[App_rpt-users] SimpleUSB gpio?

Stephen - K1LNX k1lnx at k1lnx.net
Thu Aug 4 12:46:34 UTC 2016


An update on this, and I've learned something that was not so obvious to
me, so I'll put this out there in case someone runs into this in the future.

Consider my dilemma.. I am using an RTCM to drive a pair of radios in full
duplex mode. I needed to drive a relay (or MOSFET board in my case, more on
that in a bit) to turn a fan on the transmit radio on and off as needed.
Considering there are no GPIO's on the RTCM, I had a URIx also connected
that I planned on using for another application that I thought I could tap
the GPIO off of. I found Kyle, K0KN's excellent fan script, as well as this
resource:

http://latinovoip.net/allstar-and-the-gpio-fan-script-for-dmk-engineering-uri/

I elected to use the version linked above, and got everything configured,
but discovered my cop,62 commands were not working to toggle the GPIO line
on the URI. I tried a variety of differing configs and troubleshooting
methods, none of which worked, when I finally tried to issue the cop
command from the node that is on the URI instead as a test, and what do you
know, it worked.

It also appears that GPIO support was added into chan_simpleusb as of
revision 1060:
http://svn.ohnosec.org/viewvc/projects/allstar/astsrc-1.4.23-pre/trunk/asterisk/channels/chan_simpleusb.c?revision=1060&root=svn&view=markup

On the hardware side, I had issues with the relay board I was using. I was
seeing approximately 3.25 v when the GPIO was toggled to an on state on the
URI. That was not enough to "trigger" the relay board to fire the relay, it
needs right at a solid 5 volts. Rather than add another piece of hardware
to ramp the voltage up, I ran across this on Ebay:

http://www.ebay.com/itm/301357646243?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

This is a 3 channel MOSFET board that will switch the output on above 2.5v,
off at ground. Perfect for my application. I have yet to test it, but have
high confidence it will work just fine for my intended purpose.

On the software side, I had to make a few small changes in the scripts that
I got from the link above, most notably:

run_app_rpt_fan.sh
/etc/asterisk/local/app_rpt_fan.sh 1999 > /dev/null & ; change 1999 to the
node number that is attached to the URI, a private node in my case

app_rpt_fan.sh
PTTSTATE="/tmp/RPT_TXKEYED1999" ; change from the $1 variable to the node
number that is attached to the RTCM instead

There are more likely easier solutions than what I've provided above, but
this does work as intended now. After 10 seconds, GPIO1 goes high, goes
back to ground after 10 minutes. An even easier solution would be to
probably just use a snapdisc and have it fire on a certain temperature, but
I wanted more granular control so that wasn't really an option. I could
have also elected to use a Raspberry Pi and tap one of the GPIO's there
instead, but my AllStar server is built on an x86 box running other
applications so that wasn't really an option either.

I'd like to explore the possibility of maybe having chan_voter talk to the
GPIO's in chan_usb or simpleusb. We could say add a config to the
voter.conf file for the particulars for example. Not sure what this would
take, but curious if it could be done?

Hope this helps someone in the future...

73
Stephen
K1LNX


On Thu, Aug 4, 2016 at 3:32 AM, Stephen - K1LNX <k1lnx at k1lnx.net> wrote:

> I'm trying to manipulate a GPIO pin off of a URIx and I am not able to get
> it to work for whatever reason. If I send a cop,62 command to toggle it, it
> does not change the state.
>
> I found this message from Jim that was posted in June 2011:
>
> http://ohnosec.org/pipermail/app_rpt-users/2011-June/002725.html
>
> Does anyone know if this was ever implemented? This was quite some time
> ago.
>
> I might be able to use usbradio instead for my application, but prefer
> SimpleUSB as it's easier to implement.
>
> 73
> Stephen
> K1LNX
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.keekles.org/pipermail/app_rpt-users/attachments/20160804/45ed0c12/attachment.html>


More information about the App_rpt-users mailing list