[arm-allstar] Radioless Node - push button switch to run connect to hub/node script
larry
larry at n7fm.com
Sun Mar 12 13:43:00 EDT 2023
Rob,
Did you get this all working?
To me it would not be much different than the Shutdown function example
as pointed out by others.
The main difference is to create different macros for each function and
instead of running the shutdown function point it to a script that runs
the proper macro for the function you want it to perform, The push and
hold time can be lowered to your preference
Referring to
<https://www.crompton.com/hamradio/hamvoip-howto/GPIO_how-to.pdf>
Example Script to read a bit
Another very useful 'gpio' command is 'wfi'This command waits for an
interrupt based on a rising or falling
level at a pin. It takes no processor time unlike polling. The command
syntax is:
gpio wfi 1 falling|rising
This example is from the shutdown monitor code I written for the RPi2
#!/bin/bash
# Required button hold down seconds
HOLDTIME=6
# set mode to in and pullup pin 0 (Physical pin 11, GPIO17)
gpio mode 0 in
gpio mode 0 up
TIME1=1
while [ 1=1 ]
# wait in interrupt for pin to go low
gpio wfi $PIN falling
do
# Got the low now poll to see if it stays low for holdtime
while [ `gpio read $PIN` -eq "0" ];
do
sleep 1
let TIME1+=1
if [ $TIME1 -gt $HOLDTIME ]; then
# if greater than holdtime then exit past done
break 3;
fi
done
TIME1=1
continue
done
# code to execute when holdtime is exceeded goes here
Larry - N7FM
On 3/6/23 7:32 AM, wrhowell amphibiansolutions.us via ARM-allstar wrote:
> How are you going to interface that box to a Pi in order to use the mic & speaker?
>
> Wil/Can you provide your setup afterwards for others to share, please?
>
>
> Thank you,
>
> William KI5PHN
> ________________________________
> From: ARM-allstar<arm-allstar-bounces at hamvoip.org> on behalf of Rob Seaman via ARM-allstar<arm-allstar at hamvoip.org>
> Sent: Sunday, March 5, 2023 5:06 PM
> To:arm-allstar at hamvoip.org <arm-allstar at hamvoip.org>
> Cc: Rob Seaman<vk6ld at outlook.com.au>
> Subject: [arm-allstar] Radioless Node - push button switch to run connect to hub/node script
>
> Hi All,
>
> I'm building a radioless node for a friend who has interest in Allstar, but little to no interest in computers.
>
> He has given me a well made box, that was previously used a radio test jig setup, so it has a mic, speaker and a row of LED's & momentary SPST push button type switches on the front panel.
>
> One idea I had was to use the momentary switches to connect to some hubs, one for discconnect all and one for a shutdown switch on GPIO pins 9 & 11.
>
> The shutdown switch is easy, as the script already exists in Hamvoip.
>
> I had a search back through the Hamvoip.org list archives and the Allstar Community chat for connect/disconnect via a momentary switch on the GPIO, while there was one or two brief mentions of wanting to do this, I wasn't able to find any other information or scripts.
>
> I read the 'Using the GPIO command with Allstar 06/11/15' found on the Hamvoip website, so have a slightly better understanding, but I'm not clear how Allstar/Hamvoip is to monitor for example, GPIO pin 13 going to ground, therefore execute disconnect all (*76) or pin 15 going to ground, therefore connect to UK Hub (*7341522).
>
> Hope the above makes sense and any tips or assistance would be aprpeciated.
>
> Regards,
>
> Rob...
> VK6LD
>
> _______________________________________________
>
> 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/4 web page -http://hamvoip.org
> _______________________________________________
>
> 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/4 web page -http://hamvoip.org
More information about the ARM-allstar
mailing list