[arm-allstar] HamVoIP I/O support - What is Best Current Practice for implementing I/O?
Doug Crompton
wa3dsp at gmail.com
Tue Jan 16 22:13:28 EST 2018
Lloyd,
OK attached is the modified script to use the USB FOB for control. You now
have the option of Pi GPIO using the bcd_control.sh script or the FOB using
bcd_control_usb.sh script. I am attaching the later.
Here is a sample of the output -
./bcd_control_usb.sh 1
Entered Channel 1
Executing - /bin/asterisk -rx "rpt cmd cop 61 GPIO1=1"
Executing - /bin/asterisk -rx "rpt cmd cop 61 GPIO2=0"
Executing - /bin/asterisk -rx "rpt cmd cop 61 GPIO4=0"
Executing - /bin/asterisk -rx "rpt cmd cop 61 GPIO5=0"
./bcd_control_usb.sh 5
Entered Channel 5
Executing - /bin/asterisk -rx "rpt cmd cop 61 GPIO1=1"
Executing - /bin/asterisk -rx "rpt cmd cop 61 GPIO2=0"
Executing - /bin/asterisk -rx "rpt cmd cop 61 GPIO4=1"
Executing - /bin/asterisk -rx "rpt cmd cop 61 GPIO5=0"
Note - you MUST initialize these bits in /etc/asterisk/simpleusb.conf like
this in the stanza for the USB you are using and restart or reboot -
gpio1=out0 ; in, out0 or out1
gpio2=out0
gpio4=out0
gpio5=out0
See the DMK-URI or whatever CM119x FOB you are using for bit pin outs.
This is then sent to Asterisk to perform the action. I have tested that
this does control the bits but not as a package so you need to test. Once
this is proven I will probably put both of these scripts out as a general
update for all and also do a howto on it.
Please get back to me with how you make out.
*73 Doug*
*WA3DSP*
*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
On Tue, Jan 16, 2018 at 8:28 PM, Lloyd Duck <lduck at me.com> wrote:
> Oh ok that’s why it’s now changing the USB FOB bits. Thank you..
>
>
>
> Yes the FOB I’m using is a CM119.
>
>
>
> Do you have any guidance how to modify the script to control the FOB I/O
> bits? I’m lost on that step.
>
>
>
>
>
> Lloyd Duck
>
> W5LND
>
>
>
> *From:* Doug Crompton [mailto:wa3dsp at gmail.com]
> *Sent:* Tuesday, January 16, 2018 7:09 PM
> *To:* Lloyd Duck <lduck at me.com>
> *Subject:* Re: [arm-allstar] HamVoIP I/O support - What is Best Current
> Practice for implementing I/O?
>
>
>
> This script changes the Pi GPIO bits NOT the USB FOB bits. The bits and
> pin numbers on the Pi GPIO are shown. The GPIO readall is a visual monitor
> of those bits. The Pi bits chosen are the recommended ones to use but that
> can be changed in the script. If you want to control the FOB I/O bits
> first of all you need a CM119x FOB chip as the CM108 does not have enough
> bits. You also need to modify the script to control the FOB I/O bits and
> not the Pi I/O bits. Either would work. The Pi GPIO might be more reliable
> and more transportable as if the FOB was changed out it would have to be
> both a CM119x and have the bits brought out.
>
>
> *73 Doug*
>
> *WA3DSP*
>
> *http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
>
>
>
>
>
> On Tue, Jan 16, 2018 at 7:37 PM, Lloyd Duck <lduck at me.com> wrote:
>
> Doug,
>
> I wasn’t able to get your script to work, any idea what I may be doing
> work?
>
>
>
>
>
>
>
> *From:* arm-allstar [mailto:arm-allstar-bounces at hamvoip.org] *On Behalf
> Of *"Doug Crompton via arm-allstar"
> *Sent:* Friday, January 12, 2018 11:50 AM
> *To:* ARM Allstar <arm-allstar at hamvoip.org>
> *Cc:* Doug Crompton <wa3dsp at gmail.com>
> *Subject:* Re: [arm-allstar] HamVoIP I/O support - What is Best Current
> Practice for implementing I/O?
>
>
>
> Randy,
>
>
>
> Attached is the bcd_control.sh script. It controls 16 channels or 4 bits.
> It has a strobe on a 5th bit that can be ignore if not needed. Here is and
> example running it at the linux prompt -
>
>
>
> ./bcd_control.sh 2
> Entered Channel 2
> Channel 2 written to BCD - 0010
>
>
>
> and just a portion of a 'gpio readall' showing the bits
>
>
>
> | 5 | 21 | GPIO.21 | OUT | 0 | 29
> | 6 | 22 | GPIO.22 | OUT | 1 | 31
> | 13| 23 | GPIO.23 | OUT | 0 | 33
> | 19| 24 | GPIO.24 | OUT | 0 | 35
> | 26| 25 | GPIO.25 | OUT | 0 | 37
>
>
>
> To control from Allstar here is one way to do it. Add to the functions
> stanza, assumes the script is in /etc/asterisk/local. Make sure the script
> is executable - chmod 750 bcd_control.sh. Run it manually as above to
> confirm. You only need to enter functions for as many channels as you have.
> In your case 3 bits or 8 channels. The script was not written for a
> Motorola but it should work fine.
>
>
>
> 801=cmd,/etc/asterisk/local/bcd_control.sh 1
>
> 802=cmd,/etc/asterisk/local/bcd_control.sh 2
>
> 803=cmd,/etc/asterisk/local/bcd_control.sh 3
> 804=cmd,/etc/asterisk/local/bcd_control.sh 4
>
> 805=cmd,/etc/asterisk/local/bcd_control.sh 5
> 806=cmd,/etc/asterisk/local/bcd_control.sh 6
> <https://maps.google.com/?q=sh+6+807&entry=gmail&source=g>
> 807 <https://maps.google.com/?q=sh+6+807&entry=gmail&source=g>
> =cmd,/etc/asterisk/local/bcd_control.sh 7
> 808=cmd,/etc/asterisk/local/bcd_control.sh 8
>
> 809=cmd,/etc/asterisk/local/bcd_control.sh 9
> 810=cmd,/etc/asterisk/local/bcd_control.sh 10
> 811=cmd,/etc/asterisk/local/bcd_control.sh 11
> 812=cmd,/etc/asterisk/local/bcd_control.sh 12
>
>
>
> etc....
>
>
>
> Another way to do this is use the autopatch in command mode. Then you just
> need one line in rpt.conf and a custom extensions.conf stanza. See the
> howto on the hamvoip.org web page.
>
>
>
> https://www.hamvoip.org/Allstar_extended_functions_using_autopatch.pdf
>
>
>
> Again - VERY IMPORTANT! The Pi is 3V GPIO logic. Use diodes pointed
> towards the radio on each line. You may possibly need to use pullups on the
> radio side of the diode if the radio does not supply them. The radio lines
> probably float high. If they do that won't be necessary.. You also need a
> ground connection between the radio and the Pi. This could be Pi pin 37 or
> any defined 0V pin.
>
>
> *73 Doug*
>
> *WA3DSP*
>
> *http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
>
>
>
>
>
>
>
> On Fri, Jan 12, 2018 at 2:53 AM, "Randy Neals via arm-allstar" <
> arm-allstar at hamvoip.org> wrote:
>
> Hi,
>
> What is the best current practice for implementing I/O on a Raspberry Pi to
> control external things.
> In this case, remote channel selection on a VHF remote base, a radio with 8
> channels and having external control lines.
>
> From looking through the list archives, I see references to using an
> Arduino Nano, and at an earlier time, using a USB I/O board from SparkFun,
> and of course using the lines on the RPi itself.
>
> Anticipated questions...
>
> Q. What Am I trying To Do?
> A. Control channel select lines on a VHF remote base station.
>
> Q. What format/How many lines?
> A. 3 logic control lines. The lines are normally pulled up to +5V by the
> radio.
> BCD format with the lines having binary weighting of 4, 2, and 1
> respectively.
> High = weighted value / Low = zero value.
>
> Q. What audio interface will I use?
> A. Simple USB, likely DMK URI. (But I could use a USB FOB, or other
> interface if there is one with I/O)
>
> Thanks,
> Randy
> W3RWN
> _______________________________________________
>
> arm-allstar mailing list
> arm-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hamvoip.org/pipermail/arm-allstar/attachments/20180116/b415204f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 5131 bytes
Desc: not available
URL: <http://lists.hamvoip.org/pipermail/arm-allstar/attachments/20180116/b415204f/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 2769 bytes
Desc: not available
URL: <http://lists.hamvoip.org/pipermail/arm-allstar/attachments/20180116/b415204f/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bcd_control_usb.sh
Type: application/x-sh
Size: 2699 bytes
Desc: not available
URL: <http://lists.hamvoip.org/pipermail/arm-allstar/attachments/20180116/b415204f/attachment-0001.sh>
More information about the arm-allstar
mailing list