Monday, February 26, 2024

AllStar Experimentation - South Africa (Part 1)


During the past month or two I was busy experimenting with AllStar.  Before I explain more lets find out what is AllStar in Amateur Radio?  

AllStarLink is a network of Amateur Radio repeaters, remote base stations, simplex radio links, Internet / Radio nodes and hot spots accessible to each other via Voice over Internet Protocol. AllStar runs on a dedicated computer (including the Raspberry Pi) that you host at your home, radio site, shack or computer center. It is based on the open source Asterisk PBX running our app_rpt application. App_rpt makes Asterisk a powerful system capable of controlling one or more radios. It provides linking of these radio "nodes" to other systems of similar construction anywhere in the world via VoIP.

AllStarLink's primary use is as a dedicated computer node wired to your repeater or radio. Connections from Echolink, other VoIP clients and telephone calls are supported.  Audio quality is way better than EchoLink or IRLP.

AllStarLink currently has 32,101 users and 32,010 nodes.  These figures increase on a daily basis.

As can be seen from the above AllStar is a very popular and useful "application" in Amateur Radio.

I started playing around with AllStar way back in August 2017. My first node 46765 was active and on the air in South Africa on Tuesday, 17 October 2017 at 15:14:36 PDT.  At the time only two nodes were active in South Africa.  One in Kwazulu Natal (Pietermaritzburg Repeater) and the other one in the Southern Cape (ZS1I GRHub Link). Since then several nodes were established one being the ZS1I DMR Bridge Node in Mossel Bay. It was one of the highlights as this introduced DMR for the first time to the Southern Cape area.

Let's get back to the latest experimentation.  Why experimenting further and what is there to experiment with?

I will try to explain.  My first node (GRHub Node) which is still active and on the air today was home built using a Raspberry Pi, Modified USB Soundcard Fob,  2 x Radios, Power Supply and LTE Internet Modem.  The USB Sound Fob was modified by me and in the process I destroying two USB soundcards.  The third modification was however successful.  Yep when you get older it is not easy to work with surface mount components especially if your eyesight is bad.  None the less the Raspberry Pi node has been running flawlessly since October 2017.

In the past few months several AllStar nodes were activated by fellow radio amateurs throughout South Africa at a very high cost.  During a technical discussion several radio amateurs indicated that they cannot pay the absorbent price for an AllStar interface (imported from overseas) nor do they wish to modify a USB Soundcard using either the CM108 or CM119 which must also be imported from overseas.  Now with the Rand / Dollar you can calculate the purchase-,  import- and tax costs.  Comes to a pretty penny for some of us. This set me thinking.  Why can one not use a cheap USB Soundcard even if the 48 pin surface mount IC has been covered with a black blob of nasty gunk.  I was thinking in the line of using the GPIO Pins on the Raspberry Pi for LED indication, PTT and COR.  After searching over several periods for several days it was clear that there is no support or very little information in this regard.  To cut it short, many pages I visited makes it very clear that this function will not be included in HamVoip or AllStarLink.

I find it quite strange but none the less an alternative for this is to use SVXLink which fully support the use of the GPIO pins.   Back to AllStar.  I am no programmer or a Linux Guru.  With the little bit of knowledge that I have I decided to experiment by using the GPIO pins of a Raspberry Pi to talk to AllStar and hopefully get everything to work without having to modify a USB Soundcard.

Now what follows, also in future postings is my humble experimentation looking at different ways and means to use the Raspberry Pi GPIO pins to perform several tasks while using AllStar. (HamVoip)  Please note that I am not the creator/writer of the code listed. I used bits and pieces from several sources which I combined that resulted in certain events / functions to be activated. There will be several parts posted under this topic which will explain how I hopefully succeeded in getting the following to work:

  • Using Raspberry Pi GPIO pins to indicate TX / RX LED status on a Radioless (RFless) node. (Tested Working 100 %)
  • Using Raspberry Pi GPIO pins to PTT a radio transceiver using a 3.3v Relay Module. (Tested Working 100 %)
  • Using Raspberry Pi GPIO pins to PTT a radio tranceiver using an Opto Coupler Circuit (Tested Working 100 %)
  • Using Raspberry Pi GPIO pins to activate COS (Work in progress)
  • Combining a Radioless Node with a normal RF Radio Node using either a relay module or Opto Coupler circuit with COS (Work in progress)

The first three methods were successful using a Raspberry Pi 3 b Ver 1.2 and HamVoip.  It took a fair bit of time to make it work.  Let us see if I can get the last two to also work flawlessly.

For those that are interested I will post the code that I used to get the TX / RX LED status up and running below.  I will also post a link to the PDF file where the code can be downloaded. As always there is another way to achieve the same result but I chose this method as in future postings it will become clear why I chose this method. 

A special word of recognition to:

  • AllStarLink Discussion Groups
  • Brett ??? 
  • Jeff Tranter
  • French Open Networks F1TZO
  • 4-Ham Radio Groups
  • Open Repeater
  • Raspberry Pi UK
  • Internet Resources


                                                  ################################

TX/RX STATUS LED’S = RADIOLESS ALLSTAR NODE OR ANY OTHER ALLSTAR NODE USING A RASPBERRY PI 3 B V1.2

Warning:  Ensure that you connect the LED’s to the correct pins. The GPIO pins are 3.3 volts maximum and output pins have a limited current capability of 16 mA. When interfacing be aware of this because you can damage the PI if you exceed the ratings!! I am not responsible if you damage or destroy your Raspberry Pi!!

This short manual discuss the method using the GPIO pins on the Rpi to send a TX and RX status to two LED’s using a Raspberry Pi 3 b Ver1.2.

Note: The one LED will light to show that the radioless node is receiving voice from the Internet. The other LED will light to show that the radioless node is transmitting your voice into the Internet.

 

Go to and open MobaXterm


Check to see if the rc.allstar file is in /usr/local/etc/


cd /usr/local/etc


enter


ls or dir


enter


sudo nano rc.allstar


enter


File will open. Add bold typed info as listed below.


#########################################

#!/bin/bash

#

# This is the startup rc script for allstar asterisk

#

# Rather than changing anything here

# please use the /usr/local/etc/allstar.env file

# for configuration changes.


#Makes gpio pins go to output upon startup

/etc/asterisk/local/write_gpio.sh


# If root profile missing, replace it.

if [ ! -f /root/.bash_profile ] ; then

/usr/bin/cp -f /etc/.bash_profile.backup /root/.bash_profile

fi


# source the allstar variables

if [ -f /usr/local/etc/allstar.env ] ; then

. /usr/local/etc/allstar.env

else

echo " Unable to read /usr/local/etc/allstar.env file."

echo " Asterisk will not start"

exit 1

################################################


Once the bold info is entered


save


ctrl + x


yes


cd


enter


cd /etc/asterisk/local/


enter


sudo nano write_gpio.sh


then type the following script


####################################


#!/bin/bash

#script name - write_gpio

gpio mode 7 out ; makes gpio 7 pin 7 an output

gpio mode 2 out ; makes gpio 2 pin 13 an output


#####################################


save


ctrl x yes enter


Check if write_gpio.sh file was created using ls enter or dir enter


Make write_gpio.sh file executable


chmod +x write_gpio.sh


cd



cd /etc/asterisk


enter


sudo nano rpt.conf


Under “Events” add the following:


########################################


; EVENTS


[events467652]


sudo /usr/local/sbin/7high.sh = s|t|RPT_TXKEYED

sudo /usr/local/sbin/7low.sh = s|f|RPT_TXKEYED

sudo /usr/local/sbin/2high.sh = s|t|RPT_RXKEYED

sudo /usr/local/sbin/2low.sh = s|f|RPT_RXKEYED


; Commands for FOB COS indicator when available

; For this to work you must also add - gpio4 = out,0 - to simpleusb.conf

; Uncomment (remove ;) on next two lines to activate

;cop,62,GPIO4:1 = c|t|RPT_RXKEYED

;cop,62,GPIO4:0 = c|f|RPT_RXKEYED


[events1999]


; FUNCTIONS


##########################################


save

ctrl x

Yes

enter

cd

cd /usr/local/sbin/

enter


Create 6 script files (Example: sudo nano 7high.sh enter)

7high.sh

7low.sh

2high.sh

2low.sh

In each script put:

7high.sh

#################

#!/bin/bash

gpio write 7 1

#################

7low.sh

#################

#!/bin/bash

gpio write 7 0

#################

2high.sh

#################

#!/bin/bash

gpio write 2 1

#################

2low.sh

#################

#!/bin/bash

gpio write 2 0

#################

save each one

ctrl x

Yes

enter

still in cd /usr/local/sbin/

make all 4 executable using the command

sudo chmod +x /usr/local/sbin/xxxxxx.sh

chmod +x 7high.sh

chmod +x 7low.sh

chmod +x 2high.sh

chmod +x 2low.sh

cd

sudo reboot



TX / RX LED’s will now be working!!

In a future posting I will include videos showing how the events /functions operate.

Recognition:  

AllStarLink Discussion Groups
HamVoip 

Download Manual  HERE (PDF)

 

Manual compiled by: 

Johan Terblanche ZS1I  

Mossel Bay

Date: 24 February 2024

                                               ###############################


Images:  Click on images for large view.


      

 
  

 
                      


Eskom Loadshedding Solutions - Raspberry Pi Router/Modem "Watchdog" Project: Testing Internet Connection (Part 3)

 Image:  ZS1I AllStar Hub, 145.550 Echolink Simplex Link and ZS-Link SVXLink Reflector With the recent loadshedding experienced I decided to...