I’ve looked at the various threads regarding using GPIO but none really seem to address my situation.
Conditions:
ASL Beta 2.0 running on a Pi3+
Repeater Builder RIM-Lite interface using usbradio.so driver
The RIM-Lite uses the CM119A and it uses GPIO3 as PTT controI and I thought it would be nice to be able to control the PTT line (for external applications) via GPIO manipulation.
So I tested things…
In usbradio.conf, I placed:
gpio3 = out0
and in rpt.conf, I placed:
962 = cop,62,GPIO3=501 (supposed to set GPIO3 to a logic 1 for 500 ms)
Restarted asterisk and from the bash CL:
root@AH6LE-HUB:~# asterisk -rx ‘rpt fun 1100 *962’
Nothing - PTT didn’t go active. So I went to the Asterisk CLI, hoping to see some debug info:
AH6LE-HUB*CLI> rpt fun 1100 *962
AH6LE-HUB*CLI>
Thoughts (other than I’m always pushing the envelope!)
Fair point about the case (I will try lower) but the sample in the rpt.conf file itself references uppercase:
961 = cop,61,GPIO4=501 ; Send Message to USB to control GPIO pins (cop,61,GPIO1=0[,GPIO4=1]…)
962 = cop,62,GPIO3=501 ; Send Message to USB to control GPIO pins, quietly (cop,62,GPIO1=0[,GPIO4=1]…)
Use 0 or 1 to set the specified output to 0 or 1, or a number greater then 1 to specify how
many milliseconds minus 1 to invert its current state. For example, to pulse the bit for 500ms you
would use the value ‘501’(currently, specified time only significant in increments of 50ms). The
use of specifying a value of N+1 to indicate N milliseconds was done so that if, in the future,
the granulatity increases down to the millisecond level, a value of 1 ms could be specified.
Ok thanks. As I’m a member of the Allstar list on groups.io, I read that thread you referenced and the last post in that thread indicates that the GPIO does work from the CLI
Still, I am unable to make it work using that scheme as well. I have only tried GPIO3 (the one used in the RB Rim Lite to control PTT) so perhaps there’s some sort of lockout in the code. I need to poke around some more I suppose
I would have to guess that since you say you can run this from a command line and not from a dtmf commanded function, that you have a conflict in your command set…
Do you have anything also starting with dtmf 9 or 96
I do not use GPIO on USB so I can only speak from theory, not experience.
Since you seem to behaving such a issue for so long, and you are using a Pi,
why not just toggle a Pi GPIO pin. There are 8 of them for output.
@AH6LE The PR I submitted gets the parameters into the event processing where previously they were not parsed. Given the pulse feature is not working from the cli, then it’s not related to my PR. However I’d suspect that you’d need my update if you want the pulse settings to be event driven and the argument passed ultimately into usbradio.c. I’ve been looking at usbradio.c this morning. I suspect it’s a feature that hasn’t been used much and got broken along the way. Can you test with simpleusb and see if there is a difference? Maybe that’ll give a clue where we can address the issue.