SvxLink Beginners Guide: Difference between revisions

From WLPS Wiki
Jump to navigation Jump to search
mNo edit summary
 
(33 intermediate revisions by the same user not shown)
Line 20: Line 20:
* Programming periferials (PC, cable, CPS, etc).
* Programming periferials (PC, cable, CPS, etc).


= Programación del radio =
= Radio Programming =


To access the TETRA Mexico radio network  you will need to program your radio as follows:
To access the TETRA Mexico radio network  you will need to program your radio as follows:
Line 26: Line 26:
== Subscriber Unit Parameters ==
== Subscriber Unit Parameters ==


* Radio ISSI = 1234567 (Your ID from www.radioid.net)
* Radio ISSI = 1234567 (request your ID from [https://tetraid.wodielite.com tetraid.wodielite.com])


== DMO Parameters>DMO Group Call Timers ==
== DMO Parameters>DMO Group Call Timers ==
Line 132: Line 132:
* GPS>LIP Configuration/Destination ISSI = 9999
* GPS>LIP Configuration/Destination ISSI = 9999


Regresar a [[Radioafición en Español]]


= Linking to a Reflector =
= Linking to a Reflector =
Line 143: Line 141:
[http://leipzig2000.dyndns.org:4047 Dashboard Tetra]
[http://leipzig2000.dyndns.org:4047 Dashboard Tetra]


= Programming a Repetidor/Node =
= Programming a Repeater/Node =


If you want tomset up your own Repeater/Node, you will need the following stuff:
If you want to set up your own Repeater/Node, you will need the following stuff:


* 01 Motorola MTM800e or MTM5400 for 430-440 MHz (Gateway).
* 01 Motorola MTM800e or MTM5400 for 430-440 MHz (Gateway).
Line 153: Line 151:
* 01 FTDI cable for 3.3 Volts RS232 to USB.
* 01 FTDI cable for 3.3 Volts RS232 to USB.


* 01 URIxB interfase or Signalink or R1 2020.
* 01 URIxB interface or Signalink or R1 2020.


* 01 UHF antenna with cable, etc.
* 01 UHF antenna with cable, etc.
Line 173: Line 171:
La respuesta te llegará en unas 24 horas.
La respuesta te llegará en unas 24 horas.


== Download SVXLink ==
== Install SVXLink ==
 
Work in progress...
 
=== Software Installation ===
''' Aproach #2 '''
 
<pre>
sudo git clone https://github.com/f5vmr/svxlink_raspberry.git
sudo chmod +x svxlink_raspberry/*.sh
sudo bash svxlink_raspberry/install.sh
sudo cp /etc/svxlink/svxlink.conf /etc/svxlink/svxlink.bak
</pre>
 
<pre>
sudo nano /etc/svxlink/svxlink.conf
</pre>
 
<pre>
/etc/svxlink/svxlink.d/ModuleEchoLink.conf
</pre>
 
You can test the audio of your simplex node by Transmitting to it with DTMF ‘1#’ to enable the Parrot repeater. Whatever you say will be repeated back to you. To cancel the parrot transmit a ‘#’ and the node will confirm the disconnection.
 
USRP version
<pre>
sudo apt-get install qt-sdk
sudo apt-get -yq install gcc/g+\+
sudo apt-get -yq install make cmake groff
sudo apt-get -yq install gzip doxygen tar git
sudo apt-get -yq install libsigc++
sudo apt-get -yq install libpopt
sudo apt-get -yq install tcl
sudo apt-get -yq install libgcrypt libasound libgsm
sudo apt-get -yq install libjsoncpp libspeex
sudo apt-get -yq install librtlsdr libqt libgpiod
sudo apt-get -yq install  alsa-utils opus-tools
</pre>
 
<pre>
</pre>
 
<pre>
</pre>
 
<pre>
</pre>
 
=== Software Installation ===
''' Aproach #1 '''
 
In your Raspberry Pi configuration, activate the "Serial Port" interface, and deactivate "serial console". Disable bluetooth (for pi3B+). This requires restarting your Raspberry Pi.
 
Go to the /home/repeater directory
<pre>
cd /home/repeater
</pre>
 
Clone the tetra-contrib branch to get the TetraLogic function which interfaces the MTM via the PEI interface:
<pre>
sudo git clone -b tetra-contrib https://github.com/dl1hrc/svxlink
</pre>
 
This creates the svxlink directory.
 
For information, installation instructions are provided in the INSTALL.adoc file.
<pre>
cd svxlink
</pre>
 
Make an update to your Raspberry Pi.
<pre>
sudo apt-get update
sudo apt-get upgrade
</pre>
 
Install the compiler packages and other libraries (to be installed only once) :
<pre>
sudo apt-get -yq install gcc g++ make cmake libgcrypt-dev libgsm1-dev libsigc++-2.0-dev tcl-dev libspeex-dev libasound2-dev libpopt-dev libssl-dev libopus-dev groff libcurl4- git gpiod
sudo apt-get update
sudo apt-get -yq install libjsoncpp-dev mc doxygen
 
sudo apt update && sudo apt upgrade && sudo apt install curl && sudo apt-get install libcurl4-openssl-dev
 
# sudo apt-get -yq install openssl-dev
# sudo apt-get -yq install ligpiod-dev
</pre>
 
Create a svxlink user, and integrate it into the group daemon. The password is your choice: (enter) :
<pre>
sudo adduser svxlink
sudo usermod -a -G daemon svxlink
</pre>
 
 
Compile the source code for the Raspberry Pi. With the parameters in the cmake line, svxlink will be installed in the /usr/bin directory (parameter DCMAKE_INSTALL_PREFIX). The compilation takes about 15 mn.
<pre>
cd src
sudo mkdir build
cd build
sudo cmake -DUSE_QT=OFF -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc - DLOCAL_STATE_DIR=/var -DCMAKE_BUILD_TYPE=Release -DWITH_CONTRIB_TETRA_LOGIC=ON ..
sudo make
sudo make doc
sudo ldconfig
sudo make install
</pre>
 
Note that it sets the DUSE_QT variable to no, which does not compile Qtel, which is the Echolink client.
 
The compilation will create the config files in /etc/svxlink. If they are already existing, they will not be overwritten. The tetralogic.conf file is located in /etc/svxlink/svxlink.d
 
The following command avoids the TclVoiceMail error message when running svxlink:
*** ERROR: The spool directory (/var/spool/svxlink/voice_mail) is not writable by the current user or does not exist."
<pre>
sudo chmod -R 777 /var/spool/svxlink/voice_mail
</pre>
 
=== French voices installation ===
 
To give French voices to the repeater, install the sound files (16k WAV format). Choose one of the French
voices available on the F8ASB GitHub repository.
<pre>
cd /usr/share/svxlink/sounds/
sudo wget https://github.com/F8ASB/fr_FR_Agnes/archive/fr_FR_Agnes.zip
sudo unzip fr_FR_Agnes.zip
ls
</pre>
 
The fr_FR_Agnes directory now contains all the directories and wav files used to give voice to the relay. Rename the directory to fr_FR (This is the name that must be configured in the svxlink.conf file in the default language)
sudo mv fr_FR_Agnes-master fr_FR
 
=== Installing the USB sound card ===
 
On a Raspberry Pi 3 and Jessie configuration, it is necessary to add dwc_otg.fiq_split_enable = 0 at the end of the line of the /boot/cmdline.txt file (long line)
<pre>
sudo nano /boot/cmdline.txt
</pre>
 
Edit file /boot/cmdline.txt
<pre>
sudo nano /boot/cmdline.txt
</pre>
 
And add the next line at the end.
<pre>
dwc_otg.fiq_split_enable = 0
</pre>
 
Edit file /etc/modules
<pre>
sudo nano /etc/modules
</pre>
 
And add the next line at the end.
<pre>
snd-usb-audio
</pre>
 
Modify file /lib/modprobe.d/aliases.conf
<pre>
sudo nano /lib/modprobe.d/aliases.conf
</pre>
 
And change snd-usb-audio index from -2 to 0.
<pre>
snd-usb-audio index=0
<pre>
 
Add at the end of the file options add
<pre>
snd-usb-audio nrpacks=1
</pre>
 
Reboot your Raspberry Pi.
<pre>
sudo reboot
</pre>
 
Connect the USB sound card to your Raspberry Pi. The LED will light up. Check that the USB device is recognized.
 
Test Sound Card is connected:
<pre>
lsusb
</pre>
 
Check if the microphone audio input is present:
<pre>
arecord -l
</pre>
 
For the audio recording channel, locate the card number (here 'card 1') and the device number (here 'device 0'), because they will be used in the configuration of SvxLink
Check the audio output channel (speaker). It also appears the reading device that equips the Raspberry Pi (bcm2835)
 
<pre>
aplay -l
</pre>
 
=== SVXLINK Configuration ===
 
All the configuration (except modules) is in the file /etc/svxlink/svxlink.conf. The original unconfigured (raw) file is located in
/home/repeater/svxlink/src/svxlink/svxlink/svxlink.conf
<pre>
sudo nano /etc/svxlink/svxlink.conf
</pre>
 
==== TetraLogic configuration ====
 
Tetralongic.conf is the config file of the tetra configuration since 2022 oct. It is located in /etc/svxlink/svxlink.d
<pre>
/etc/svxlink/svxlink.d
</pre>
 
TetraLogic is the logic used by the TETRA_CONTRIB branch of SvxLink.
 
TetraLogic uses the 115200 baud /dev/ttyUSB0 link by default to connect to the MTM and send information back to svxlink. This has to be changed if you want to use the pi internal UART.
 
Edit in the [TetraLogic] section
Change dev/ttyUSB0 by /dev/ttyS0 on a pi3 if you are using a USB serial cable.
 
And for a pi2, /dev/ttyAM0
 
Change Bauds to 9600, which is the default speed of the PEI interface in the codeplug. Turn off Bluetooth.
 
At start, TetraLogic sets the Tetra station in DMO mode using AT+CTOM=1 command. It use the PEI link to retrieve information from Squelch (COS) and send PTT.
 
It also fetch the GPS to send the position to APRS. If the GPS board is not in the radio, you will get an error on the specific AT command if the DEBUG is set to 3.
 
Two access modes to squelch / PTT are possible depending on the logic used: TETRALOGIC to use squelch and PTT via software PEI interface or traditionally via hardware : SimplexLogic or RepeaterLogic for squelch and PTT via GPIO (but the SQ signal must be taken from the MTM800).
 
The operating mode is set in TETRA_MODE in the TetraLogic.conf file. It is used as an entry point to parse the file /etc/svxlink/pei-init.json
 
{| class="wikitable"
!colspan="4"|TETRA_MODE
|-
| TETRA_MODE=TMO
| Enables mode TMO (AT+CTOM=0)
|-
| TETRA_MODE=DMO-MS
| Enables mode DMO (AT+CTOM=1)
|-
| TETRA_MODE=DMO-RPT
| Enables mode Dmo repeater (AT+CTOM=6)
|-
| TETRA_MODE=GATEWAY
| Enables mode Gateway (AT+CTOM=5)
|-
|}
 
To use the MTM800/MTM5x00 in Direct DMO mode, set DMO-MS.
To use the MTM5x00 in DMO Repeater, set DMO-RPT. In this case you must use the wired PTT (otherwise broadcasts from network won't be transmitted).
 
==== TETRA branch configuration in svxlink.conf ====


For a Raspberry (Raspbian) version go to:
<pre>
[GLOBAL]
LOGICS=ReflectorLogic,TetraLogic
CFG_DIR=svxlink.d
TIMESTAMP_FORMAT="%c"
CARD_SAMPLE_RATE=48000 CARD_CHANNELS=1
LOCATION_INFO=LocationInfo
# Pour RLF en TETRALogic
LINKS=ALLlinkTetra


[https://www.dropbox.com/s/h0gy04hesie2bel/SVXLINK_TETRA_20211304_RASPI_8GB.zip?dl=0 Download SVXLink for Raspberry Pi]
[SimplexLogic]
TYPE=Simplex
RX=Rx1
TX=Tx1
#MODULES=ModuleHelp,ModuleParrot,ModuleMetarInfo
MODULES=ModuleEchoLink
CALLSIGN=xxxxx
SHORT_IDENT_INTERVAL=60
LONG_IDENT_INTERVAL=60
#IDENT_ONLY_AFTER_TX=4
#EXEC_CMD_ON_SQL_CLOSE=500
EVENT_HANDLER=/usr/share/svxlink/events.tcl
DEFAULT_LANG=fr_FR_Agnes


Burn the image on the Micro SD card.
[ReflectorLogic]
TYPE=Reflector
HOSTS=your tetra host
HOST_PORT=your port
CALLSIGN=your call
AUTH_KEY=your key
DEFAULT_TG=2080
MONITOR_TGS=2080,208,9
 
[ALLlinkTetra]
CONNECT_LOGICS=TetraLogic:9:NET,ReflectorLogic
DEFAULT_ACTIVE=1
TIMEOUT=300
ACTIVATE_ON_ACTIVITY=TetraLogic
 
==== Tetralogic.conf file configuration ====
 
[TetraLogic]
DTMF_CTRL_PTY=/tmp/dtmf
TYPE=Tetra
RX=RxTetra
TX=TxTetra
MODULES=ModuleHelp,ModuleParrot,ModuleEchoLink,ModuleTclVoiceMail
#MODULES=ModuleHelp,ModuleTclVoiceMail
CALLSIGN=xxxxx
DEFAULT_LANG=fr_FR_Agnes
BAUD=9600
#0=pas de debug 1=LOGWARNING 2=LOGINFO 3=LOGDEBUG
DEBUG=0
PORT=/dev/ttyS0
ISSI=123456
GSSI=1
MCC=901
MNC=1995
TETRA_MODE=DMO-RPT
PEI_INIT_FILE=/etc/svxlink/pei-init.json
#balise courte toutes les xx mn doit être un multiple de LONG_IDENT_INTERVAL
SHORT_IDENT_INTERVAL=0
#balise longue toutes les xx mn
LONG_IDENT_INTERVAL=60
TIME_FORMAT=24
#IDENT_ONLY_AFTER_TX=4
EVENT_HANDLER=/usr/share/svxlink/events.tcl
RGR_SOUND_DELAY=0
#RGR_SOUND_ALWAYS=0
MACROS=Macros
FX_GAIN_NORMAL=0
FX_GAIN_LOW=-12
PROXIMITY_WARNING=3.1
TIME_BETWEEN_SDS=3600
INFO_SDS=Welcome new user
TETRA_USER_INFOFILE=/etc/svxlink/tetra_users.json
TETRA_STATUS=Tetra_Status
SDS_ON_USERACTIVITY=SdsOnUserActivity
SDS_TO_OTHERS_ON_ACTIVITY=DMO_ON,DMO_OFF,PROXIMITY
SDS_TO_COMMAND=SdsToCommand
END_CMD=ATH
#SHARE_USERINFO=0
DAPNET_SERVER=dapnet.afu.rwth-aachen.de
DAPNET_PORT=43434
DAPNET_CALLSIGN=xxxxxxxx
DAPNET_KEY=xxxxxxxxxxxx
DAPNET_RIC2ISSI=Ric2ISSI
DAPNET_RUBRIC_REGISTRATION=RicRegistration
 
[Ric2ISSI]
# RIC=ISSI
#1234=23401
2089144=2089144
 
[RicRegistration]
# RIC=Rubric1,Rubric2,Rubric54 1234=1024,1051 23451=1028,1051
2089144=1024
 
[Tetra_Status]
# status=message
#The section name that contain a list of status codes in decimal notation and
#descriptions. Example:
# 32768=$8000
32768=at home
32769=on the road
61004=Parrot:
61005=Parrot:#
61010=MetarInfo:1
[SdsOnUserActivity]
0=Hello user you have powered on
1=Hello user you have powered off
2=Hello user you want to declare the state of emergency?
3=Hello user Push-to-talk condition is detected
4=Hello user Status
5=Hello user TXI=on
 
[SdsToCommand]
#The section name that contain a list of status codes in decimal notation and the
#according command that will be executed when the state sds has been received.
#The idea behind is the possibility to connect/disconntct links.
#32768=$8000
61000=9*
33009=919
33391=9191
33040=91204
33080=91208
33140=91214
33220=91222
33260=91226
33280=91228
33320=91232
33350=91235
33620=91262
33629=912629
40990=919990
</pre>
 
==== ReflectorLogic configuration ====
 
<pre>
[ReflectorLogic]
TYPE=Reflector
# host or ip address
HOST=rlf-87.dyndns.org
PORT=5387
CALLSIGN="xxxxxx"
AUTH_KEY="xxxxxxx"
JITTER_BUFFER_DELAY=2
EVENT_HANDLER=/usr/share/svxlink/events.tcl
DEFAULT_TG=20887
MONITOR_TGS=20887
TG_SELECT_TIMEOUT=4000000000
</pre>
 
==== Echolink.conf ====
 
Be careful to check if the MUTE_LOGIC_LINKING variable is set to 0 :
<pre>
[ModuleEchoLink]
NAME=EchoLink
ID=2
#timeout de déconnexion si pas d'activité
#TIMEOUT=60
# si 0 alors echolink transmet vers le gateway sinon non!
MUTE_LOGIC_LINKING=0
</pre>
 
=== Audio setup ===
 
Configure the Audio device to be used by Svxlink. Above it was identified that the recording (therefore the receiving channel Rx) is card 1, device 0. You must therefore have this in the configuration file:
<pre>
[RxXXX]
TYPE=Local
AUDIO_DEV=alsa:plughw:1
AUDIO_CHANNEL=0
</pre>
 
For the transmission part, the audio output channel (speaker) is also card 1, device 0 therefore in the configuration file:
<pre>
[TxXXX]
TYPE=Local
AUDIO_DEV=alsa:plughw:1
AUDIO_CHANNEL=0
</pre>
 
== TETRA events (Tetralogic.tcl) ==
 
If the TetraLogic.tcl file is missing in /usr/share/svxlink/event.d
Copy the file /home/pi/svxlink/src/svxlink/svxlink/TetraLogic.tcl
to /usr/share/svxlink/event.d
<pre>
sudo cp /home/repeater/svxlink/src/svxlink/svxlink/TetraLogic.tcl /usr/share/svxlink/event.d
</pre>
 
== Handling events to GPIO ==
 
It is possible to output event states to the GPIO interface. TCL syntax must be used in the TCL files. For instance, the code shows below how to export the squelch signal (whatever it comes from the GPIO or the PEI interface).
<pre>
sudo nano /usr/share/svxlink/events.d/TetraLogic.tcl
</pre>
 
Write 1 (3,3V) to the GPIO18 when squelch opens. Exec command is the TCL script execution command. You can then use any raspbian command which is not supported by TCL syntax. Don't forget to declare the use of GPIO18 in /etc/rc.local (see below).
 
It can be used to drive LEDss according to svxlink state (running/idle), drive a PTT keyer for another transceiver etc...
 
== GPIO configuration ==
 
You don't have to use GPIO configuration with tetra PEI interface (except for DMO repeater mode for PTT). For the use of the classic wired interface, the GPIO from the PI to the local station is used. Open the /etc/rc.local file for editing and change it according to the wiring of the PTT and COS (Squelch). Example here GPIO16 = PTT = output = out; GPIO19 = SQL = input = active when 1.
 
<pre>
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
#GPIO16=PTT
echo "16" >/sys/class/gpio/export
sleep 2
echo out >/sys/class/gpio/gpio16/direction
#GPIO19=SQL
echo "19" >/sys/class/gpio/export
sleep 2
echo "in" >/sys/class/gpio/gpio19/direction
#GPIO18=utilitaire
echo "18" >/sys/class/gpio/export
sleep 2
echo out >/sys/class/gpio/gpio18/direction
#GPIO23=stop button directly handling in python script
# vide le tampon du MTM en envoyant un CR
/home/pi/serial_write-CR.py
 
exit 0
</pre>
 
GPIO I/O can be tested with the instruction:
<pre>
gpio readall
</pre>
 
'''Restriction'''
 
With the MTM5x00, if the DMO Repeater mode is used, it is not possible to use the PEI interface to key the transmiter on. A broadcast from the network will to be transmited by the MTM5x00. You must use the wired PTT via GPIO16 and modify the Tx section accordingly.
 
=== UART release script ===
 
Install Python Serial module.
<pre>
sudo wget https://files.pythonhosted.org/packages/1e/7d/ae3f0a63f41e4d2f6cb66a5b57197850f919f59e558159a4dd3a818f5082/pyserial-3.5.tar.gz
sudo tar -xvzf pyserial-3.5.tar.gz
cd pyserial-3.5
sudo python setup.py install
cd /home/repeater
</pre>
 
 
 
In order for TetraLogic to communicate correctly with the PEI interface the first time it is powered on, a carriage return (CR) must be sent to the station to empty the buffer. This macro must be launched before running svxlink, in a file called "serial_write-CR.py" in /home/repeater:
<pre>
sudo nano /home/repeater/serial_write-CR.py
</pre>
 
And add the following code:
<pre>
#!/usr/bin/env python
import serial
# ser = serial.Serial(port='/dev/ttyS0', # Address for UART on your Pi
ser = serial.Serial(port='/dev/ttyUSB0', # Address for UART on your Pi thru USB
    baudrate=9600,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS,
    timeout=1
)
ser.write(13)
ser.close
</pre>
 
Make the script executable with
<pre>
sudo chmod 744 serial_write-CR.py
</pre>
 
This script is to be launched when starting the pi, it will of course be necessary for the MTM station to be powered on when the pi is powered on, we have done this already in:
add it in:
<pre>
/etc/rc.local
</pre>
 
on the last lines:
<pre>
# vide le tampon du MTM en envoyant un CR
/home/pi/serial_write-CR.py
</pre>
 
== Run Svxlink for testing ==
 
Before launching svxlink, free the MTM buffer by with the command
<pre>
./serial_write-CR.py
</pre>
 
Start svxlink by typing the following command:
<pre>
svxlink
</pre>
 
The led of the USB sound card should blink if it is equipped. At launch it is possible to get errors from the PEI.
According to the MUTE_FIRST_TX_LOC variable, the first push of PTT selects the TG (described in TETRALOGIC). The 2nd PTT call starts the talker which directs the audio to the TG on the network.


== Update Svxlink to the latest version ==
== Update Svxlink to the latest version ==
Line 425: Line 989:
|}
|}


== DMO Repeater node ==
== DMO Repeater Mode ==


This is a work in progress...
This is a work in progress...
Line 462: Line 1,026:


<pre>
<pre>
sudo chmod +x serial_write-CR.py
sudo chmod +x /home/pi/serial_write-CR.py
</pre>
</pre>


Line 468: Line 1,032:


<pre>
<pre>
./serial_write-CR.py
/home/pi/serial_write-CR.py
</pre>
</pre>


Line 498: Line 1,062:
_IP=$(hostname -I) || true
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
  printf "My IP address is %s\n" "$_IP"
fi
fi


# GPIO 16 = PTT
# GPIO 16 = PTT
echo "16" >/sys/class/gpio/export
echo "16" >/sys/class/gpio/export
sleep 2
sleep 1
echo out >/sys/class/gpio/gpio16/direction
echo "out" >/sys/class/gpio/gpio16/direction
sleep 1
echo 1 >/sys/class/gpio/gpio16/value;


# GPIO 19 = SQL
# GPIO 19 = SQL
echo "19" >/sys/class/gpio/export
echo "19" >/sys/class/gpio/export
sleep 2
sleep 1
echo "in" >/sys/class/gpio/gpio19/direction
echo "in" >/sys/class/gpio/gpio19/direction


# GPIO 18 = Utility
# GPIO 18 = Utility
echo "18" >/sys/class/gpio/export
echo "18" >/sys/class/gpio/export
sleep 2
sleep 1
echo out >/sys/class/gpio/gpio18/direction
echo "out" >/sys/class/gpio/gpio18/direction


# GPIO 23 = Stop button directly handling in python script.
# GPIO 23 = Stop button directly handling in python script.
# Clears the MTM buffer by sending a CR
# Clears the MTM buffer by sending a CR


/home/pi/serial_write-CR.py
# /home/pi/serial_write-CR.py
 
(…)
(…)
exit 0
exit 0
Line 535: Line 1,102:
proc squelch_open {rx_id is_open} {
proc squelch_open {rx_id is_open} {
Logic::squelch_open $rx_id $is_open;
Logic::squelch_open $rx_id $is_open;
puts "Le squelch change: $is_open";
  puts "Le squelch change: $is_open";
   if {$is_open==0} { exec echo 0 >sudo /sys/class/gpio/gpio18/value; }
   if {$is_open==0} { exec echo 0 >sudo /sys/class/gpio/gpio18/value; }
   if {$is_open==1} { exec echo 1 >sudo /sys/class/gpio/gpio18/value; }
   if {$is_open==1} { exec echo 1 >sudo /sys/class/gpio/gpio18/value; }
}
}
</pre>
Test Serial Port
<pre>
sudo apt-get install minicom
minicom -b 9600 -o -D /dev/ttyUSB0
</pre>
Restart to apply changes.
<pre>
sudo reboot
</pre>
</pre>



Latest revision as of 03:01, 15 February 2023

Introduction

Terestrial Trunked Radio (TETRA)

Terrestrial Trunked Radio (TETRA) is a four slot TDMA radio technology that fits in a standard 25khz channel. It supports voice, text, and data from up to four talkers (called terminals) simultaneously. It even supports phone calls bridged to the public switched telephone network (think private autopatch). The audio codec is patented, but the code is open source... so experimentation is at least technically possible. Some of the designed applications are public service, emergency response, and railroads. It is very popular in Europe and South America.

Some of it's cooler features include a "gateway" mode, where if one radio can't reach the infrastructure (repeater), but it can communicate with a radio that can, the radio in the middle can act as a bridge. Similarly, the radios can act as virtual repeaters in the total lack of any infrastructure at all: you can talk simplex to any radio you can hear, and through it, any radio it can hear, etc. Imagine being at an event with no repeater coverage, but being able to have a self expanding network of radios on a simplex network.

Here I will explain using DMO mode only, as TMO very expensive.


How to

There are two options, if you are located in an area with repeater/node coverage you only need a TETRA radio. I there is no repeater/node in your area you can setup one an link it to the TETRA Mexico network.

To use an existing repeater you will need:

  • 01 TETRA Radio 430-440 MHz.
  • Programming periferials (PC, cable, CPS, etc).

Radio Programming

To access the TETRA Mexico radio network you will need to program your radio as follows:

Subscriber Unit Parameters

DMO Parameters>DMO Group Call Timers

  • DMO Reservation Time, sec = 1

DMO Parameters>DMO Address Extension

  • MCC 901
  • MNC 16383

TalkGroups>DMO>DMO Folders List

DMO Folders List
Name Status Transmision Timeout Timer, sec Transmision Timeout Warning Timer, sec Number of Talkgroups in Range Receive Only
DMO Ham On 120 110 2

En la sección Talk Groups>DMO>DMO Talkgroup List necesitarás programar dos canales con la frecuencia del repetidor/nodo que utilizarás.

DMO Talkgroup List
Name ID Status DMO Folder List Communication type Gateway Selection Gateway Address Frequency Channel Receive Call to DMO Partnership Networks Network MCC Network MNC TMO Mapping Key Group Incoming Call Minimum Security Class Outing Call Security Class Status/Alarm/Addressing GPS LIP Addressing
Channel 1 1 Programmed 1:DMO Ham Direct None 433.650 User Defined 901 16383 NO_KG Security Class 1 Security Class 1 None None
Channel 2 1 Programmed 1:DMO Ham Repeater None 433.650 User Defined 901 16383 NO_KG Security Class 1 Security Class 1 None None

Data Services>Status ID List

Add the following messages to the table. These messages will allow you to connect and disconnect from different Reflectors or Nodes.

GPS>GPS Settings>GPS

If your radio have a GPS, you can program it. Remember to use LIP, as it it the supported protocol.

  • GPS>GPS Settings>GPS Location Protocol = LIP
  • GPS>LIP Configuration/Destination ISSI = 9999


Linking to a Reflector

To link a Repeater/Node to a reflector, on your radio press Menu then Messages then Send Status, select the Reflector/Node you want to connect and send a Group Message.

Here is a link to the nodes dashboard.

Dashboard Tetra

Programming a Repeater/Node

If you want to set up your own Repeater/Node, you will need the following stuff:

  • 01 Motorola MTM800e or MTM5400 for 430-440 MHz (Gateway).
  • 01 Raspberry Pi 2B or 3B with PSU, etc.
  • 01 FTDI cable for 3.3 Volts RS232 to USB.
  • 01 URIxB interface or Signalink or R1 2020.
  • 01 UHF antenna with cable, etc.
  • 01 12 Volts PSU
  • 01 Micro SD card with at least 8 Gb.
  • Internet.
  • Programming periferials (PC, cable, CPS, etc).

Request a Password for your Node

Entra al siguiente link y solicita una cuenta para solicitar una cuenta nueva para accesar al reflector.

https://forms.office.com/Pages/ResponsePage.aspx?id=WsUri6k2uUyVDFYiLbvQQMlKWpMbYRhDih7oaHFX6dJUMDZPUUJGRUdKRkRKNUI5QkFXRTFTT1hUQi4u

La respuesta te llegará en unas 24 horas.

Install SVXLink

Work in progress...

Software Installation

Aproach #2

sudo git clone https://github.com/f5vmr/svxlink_raspberry.git 
sudo chmod +x svxlink_raspberry/*.sh
sudo bash svxlink_raspberry/install.sh
sudo cp /etc/svxlink/svxlink.conf /etc/svxlink/svxlink.bak
sudo nano /etc/svxlink/svxlink.conf
/etc/svxlink/svxlink.d/ModuleEchoLink.conf 

You can test the audio of your simplex node by Transmitting to it with DTMF ‘1#’ to enable the Parrot repeater. Whatever you say will be repeated back to you. To cancel the parrot transmit a ‘#’ and the node will confirm the disconnection.

USRP version

sudo apt-get install qt-sdk
sudo apt-get -yq install gcc/g+\+
 sudo apt-get -yq install make cmake groff 
 sudo apt-get -yq install gzip doxygen tar git 
 sudo apt-get -yq install libsigc++ 
sudo apt-get -yq install libpopt 
 sudo apt-get -yq install tcl 
sudo apt-get -yq install libgcrypt libasound libgsm 
sudo apt-get -yq install libjsoncpp libspeex 
sudo apt-get -yq install librtlsdr libqt libgpiod
 sudo apt-get -yq install  alsa-utils opus-tools



Software Installation

Aproach #1

In your Raspberry Pi configuration, activate the "Serial Port" interface, and deactivate "serial console". Disable bluetooth (for pi3B+). This requires restarting your Raspberry Pi.

Go to the /home/repeater directory

cd /home/repeater

Clone the tetra-contrib branch to get the TetraLogic function which interfaces the MTM via the PEI interface:

sudo git clone -b tetra-contrib https://github.com/dl1hrc/svxlink

This creates the svxlink directory.

For information, installation instructions are provided in the INSTALL.adoc file.

cd svxlink

Make an update to your Raspberry Pi.

sudo apt-get update
sudo apt-get upgrade

Install the compiler packages and other libraries (to be installed only once) :

sudo apt-get -yq install gcc g++ make cmake libgcrypt-dev libgsm1-dev libsigc++-2.0-dev tcl-dev libspeex-dev libasound2-dev libpopt-dev libssl-dev libopus-dev groff libcurl4- git gpiod
sudo apt-get update
sudo apt-get -yq install libjsoncpp-dev mc doxygen

sudo apt update && sudo apt upgrade && sudo apt install curl && sudo apt-get install libcurl4-openssl-dev

# sudo apt-get -yq install openssl-dev
# sudo apt-get -yq install ligpiod-dev

Create a svxlink user, and integrate it into the group daemon. The password is your choice: (enter) :

sudo adduser svxlink
sudo usermod -a -G daemon svxlink


Compile the source code for the Raspberry Pi. With the parameters in the cmake line, svxlink will be installed in the /usr/bin directory (parameter DCMAKE_INSTALL_PREFIX). The compilation takes about 15 mn.

cd src
sudo mkdir build
cd build
sudo cmake -DUSE_QT=OFF -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc - DLOCAL_STATE_DIR=/var -DCMAKE_BUILD_TYPE=Release -DWITH_CONTRIB_TETRA_LOGIC=ON ..
sudo make
sudo make doc
sudo ldconfig
sudo make install

Note that it sets the DUSE_QT variable to no, which does not compile Qtel, which is the Echolink client.

The compilation will create the config files in /etc/svxlink. If they are already existing, they will not be overwritten. The tetralogic.conf file is located in /etc/svxlink/svxlink.d

The following command avoids the TclVoiceMail error message when running svxlink:

      • ERROR: The spool directory (/var/spool/svxlink/voice_mail) is not writable by the current user or does not exist."
sudo chmod -R 777 /var/spool/svxlink/voice_mail

French voices installation

To give French voices to the repeater, install the sound files (16k WAV format). Choose one of the French voices available on the F8ASB GitHub repository.

cd /usr/share/svxlink/sounds/
sudo wget https://github.com/F8ASB/fr_FR_Agnes/archive/fr_FR_Agnes.zip
sudo unzip fr_FR_Agnes.zip
ls

The fr_FR_Agnes directory now contains all the directories and wav files used to give voice to the relay. Rename the directory to fr_FR (This is the name that must be configured in the svxlink.conf file in the default language) sudo mv fr_FR_Agnes-master fr_FR

Installing the USB sound card

On a Raspberry Pi 3 and Jessie configuration, it is necessary to add dwc_otg.fiq_split_enable = 0 at the end of the line of the /boot/cmdline.txt file (long line)

sudo nano /boot/cmdline.txt

Edit file /boot/cmdline.txt

sudo nano /boot/cmdline.txt

And add the next line at the end.

dwc_otg.fiq_split_enable = 0

Edit file /etc/modules

sudo nano /etc/modules

And add the next line at the end.

snd-usb-audio

Modify file /lib/modprobe.d/aliases.conf

sudo nano /lib/modprobe.d/aliases.conf

And change snd-usb-audio index from -2 to 0.

snd-usb-audio index=0
<pre>

Add at the end of the file options add
<pre>
snd-usb-audio nrpacks=1

Reboot your Raspberry Pi.

sudo reboot

Connect the USB sound card to your Raspberry Pi. The LED will light up. Check that the USB device is recognized.

Test Sound Card is connected:

lsusb

Check if the microphone audio input is present:

arecord -l

For the audio recording channel, locate the card number (here 'card 1') and the device number (here 'device 0'), because they will be used in the configuration of SvxLink Check the audio output channel (speaker). It also appears the reading device that equips the Raspberry Pi (bcm2835)

aplay -l

SVXLINK Configuration

All the configuration (except modules) is in the file /etc/svxlink/svxlink.conf. The original unconfigured (raw) file is located in /home/repeater/svxlink/src/svxlink/svxlink/svxlink.conf

sudo nano /etc/svxlink/svxlink.conf

TetraLogic configuration

Tetralongic.conf is the config file of the tetra configuration since 2022 oct. It is located in /etc/svxlink/svxlink.d

/etc/svxlink/svxlink.d

TetraLogic is the logic used by the TETRA_CONTRIB branch of SvxLink.

TetraLogic uses the 115200 baud /dev/ttyUSB0 link by default to connect to the MTM and send information back to svxlink. This has to be changed if you want to use the pi internal UART.

Edit in the [TetraLogic] section Change dev/ttyUSB0 by /dev/ttyS0 on a pi3 if you are using a USB serial cable.

And for a pi2, /dev/ttyAM0

Change Bauds to 9600, which is the default speed of the PEI interface in the codeplug. Turn off Bluetooth.

At start, TetraLogic sets the Tetra station in DMO mode using AT+CTOM=1 command. It use the PEI link to retrieve information from Squelch (COS) and send PTT.

It also fetch the GPS to send the position to APRS. If the GPS board is not in the radio, you will get an error on the specific AT command if the DEBUG is set to 3.

Two access modes to squelch / PTT are possible depending on the logic used: TETRALOGIC to use squelch and PTT via software PEI interface or traditionally via hardware : SimplexLogic or RepeaterLogic for squelch and PTT via GPIO (but the SQ signal must be taken from the MTM800).

The operating mode is set in TETRA_MODE in the TetraLogic.conf file. It is used as an entry point to parse the file /etc/svxlink/pei-init.json

TETRA_MODE
TETRA_MODE=TMO Enables mode TMO (AT+CTOM=0)
TETRA_MODE=DMO-MS Enables mode DMO (AT+CTOM=1)
TETRA_MODE=DMO-RPT Enables mode Dmo repeater (AT+CTOM=6)
TETRA_MODE=GATEWAY Enables mode Gateway (AT+CTOM=5)

To use the MTM800/MTM5x00 in Direct DMO mode, set DMO-MS. To use the MTM5x00 in DMO Repeater, set DMO-RPT. In this case you must use the wired PTT (otherwise broadcasts from network won't be transmitted).

TETRA branch configuration in svxlink.conf

[GLOBAL]
LOGICS=ReflectorLogic,TetraLogic
CFG_DIR=svxlink.d
TIMESTAMP_FORMAT="%c"
CARD_SAMPLE_RATE=48000 CARD_CHANNELS=1
LOCATION_INFO=LocationInfo
# Pour RLF en TETRALogic
LINKS=ALLlinkTetra

[SimplexLogic]
TYPE=Simplex
RX=Rx1
TX=Tx1
#MODULES=ModuleHelp,ModuleParrot,ModuleMetarInfo
MODULES=ModuleEchoLink
CALLSIGN=xxxxx
SHORT_IDENT_INTERVAL=60
LONG_IDENT_INTERVAL=60
#IDENT_ONLY_AFTER_TX=4
#EXEC_CMD_ON_SQL_CLOSE=500
EVENT_HANDLER=/usr/share/svxlink/events.tcl
DEFAULT_LANG=fr_FR_Agnes

[ReflectorLogic]
TYPE=Reflector
HOSTS=your tetra host
HOST_PORT=your port
CALLSIGN=your call
AUTH_KEY=your key
DEFAULT_TG=2080
MONITOR_TGS=2080,208,9

[ALLlinkTetra]
CONNECT_LOGICS=TetraLogic:9:NET,ReflectorLogic
DEFAULT_ACTIVE=1
TIMEOUT=300
ACTIVATE_ON_ACTIVITY=TetraLogic

==== Tetralogic.conf file configuration ====

[TetraLogic]
DTMF_CTRL_PTY=/tmp/dtmf
TYPE=Tetra
RX=RxTetra
TX=TxTetra
MODULES=ModuleHelp,ModuleParrot,ModuleEchoLink,ModuleTclVoiceMail
#MODULES=ModuleHelp,ModuleTclVoiceMail
CALLSIGN=xxxxx
DEFAULT_LANG=fr_FR_Agnes
BAUD=9600
#0=pas de debug 1=LOGWARNING 2=LOGINFO 3=LOGDEBUG
DEBUG=0
PORT=/dev/ttyS0
ISSI=123456
GSSI=1
MCC=901
MNC=1995
TETRA_MODE=DMO-RPT
PEI_INIT_FILE=/etc/svxlink/pei-init.json
#balise courte toutes les xx mn doit être un multiple de LONG_IDENT_INTERVAL
SHORT_IDENT_INTERVAL=0
#balise longue toutes les xx mn
LONG_IDENT_INTERVAL=60
TIME_FORMAT=24
#IDENT_ONLY_AFTER_TX=4
EVENT_HANDLER=/usr/share/svxlink/events.tcl
RGR_SOUND_DELAY=0
#RGR_SOUND_ALWAYS=0
MACROS=Macros
FX_GAIN_NORMAL=0
FX_GAIN_LOW=-12
PROXIMITY_WARNING=3.1
TIME_BETWEEN_SDS=3600
INFO_SDS=Welcome new user
TETRA_USER_INFOFILE=/etc/svxlink/tetra_users.json
TETRA_STATUS=Tetra_Status
SDS_ON_USERACTIVITY=SdsOnUserActivity
SDS_TO_OTHERS_ON_ACTIVITY=DMO_ON,DMO_OFF,PROXIMITY
SDS_TO_COMMAND=SdsToCommand
END_CMD=ATH
#SHARE_USERINFO=0
DAPNET_SERVER=dapnet.afu.rwth-aachen.de
DAPNET_PORT=43434
DAPNET_CALLSIGN=xxxxxxxx
DAPNET_KEY=xxxxxxxxxxxx
DAPNET_RIC2ISSI=Ric2ISSI
DAPNET_RUBRIC_REGISTRATION=RicRegistration

[Ric2ISSI]
# RIC=ISSI
#1234=23401
2089144=2089144

[RicRegistration]
# RIC=Rubric1,Rubric2,Rubric54 1234=1024,1051 23451=1028,1051
2089144=1024

[Tetra_Status]
# status=message
#The section name that contain a list of status codes in decimal notation and
#descriptions. Example:
# 32768=$8000
32768=at home
32769=on the road
61004=Parrot:
61005=Parrot:#
61010=MetarInfo:1
[SdsOnUserActivity]
0=Hello user you have powered on
1=Hello user you have powered off
2=Hello user you want to declare the state of emergency?
3=Hello user Push-to-talk condition is detected
4=Hello user Status
5=Hello user TXI=on

[SdsToCommand]
#The section name that contain a list of status codes in decimal notation and the
#according command that will be executed when the state sds has been received.
#The idea behind is the possibility to connect/disconntct links.
#32768=$8000
61000=9*
33009=919
33391=9191
33040=91204
33080=91208
33140=91214
33220=91222
33260=91226
33280=91228
33320=91232
33350=91235
33620=91262
33629=912629
40990=919990

ReflectorLogic configuration

[ReflectorLogic]
TYPE=Reflector
# host or ip address
HOST=rlf-87.dyndns.org
PORT=5387
CALLSIGN="xxxxxx"
AUTH_KEY="xxxxxxx"
JITTER_BUFFER_DELAY=2
EVENT_HANDLER=/usr/share/svxlink/events.tcl
DEFAULT_TG=20887
MONITOR_TGS=20887
TG_SELECT_TIMEOUT=4000000000

Echolink.conf

Be careful to check if the MUTE_LOGIC_LINKING variable is set to 0 :

[ModuleEchoLink]
NAME=EchoLink
ID=2
#timeout de déconnexion si pas d'activité
#TIMEOUT=60
# si 0 alors echolink transmet vers le gateway sinon non!
MUTE_LOGIC_LINKING=0

Audio setup

Configure the Audio device to be used by Svxlink. Above it was identified that the recording (therefore the receiving channel Rx) is card 1, device 0. You must therefore have this in the configuration file:

[RxXXX]
TYPE=Local
AUDIO_DEV=alsa:plughw:1
AUDIO_CHANNEL=0

For the transmission part, the audio output channel (speaker) is also card 1, device 0 therefore in the configuration file:

[TxXXX]
TYPE=Local
AUDIO_DEV=alsa:plughw:1
AUDIO_CHANNEL=0

TETRA events (Tetralogic.tcl)

If the TetraLogic.tcl file is missing in /usr/share/svxlink/event.d Copy the file /home/pi/svxlink/src/svxlink/svxlink/TetraLogic.tcl to /usr/share/svxlink/event.d

sudo cp /home/repeater/svxlink/src/svxlink/svxlink/TetraLogic.tcl /usr/share/svxlink/event.d

Handling events to GPIO

It is possible to output event states to the GPIO interface. TCL syntax must be used in the TCL files. For instance, the code shows below how to export the squelch signal (whatever it comes from the GPIO or the PEI interface).

sudo nano /usr/share/svxlink/events.d/TetraLogic.tcl

Write 1 (3,3V) to the GPIO18 when squelch opens. Exec command is the TCL script execution command. You can then use any raspbian command which is not supported by TCL syntax. Don't forget to declare the use of GPIO18 in /etc/rc.local (see below).

It can be used to drive LEDss according to svxlink state (running/idle), drive a PTT keyer for another transceiver etc...

GPIO configuration

You don't have to use GPIO configuration with tetra PEI interface (except for DMO repeater mode for PTT). For the use of the classic wired interface, the GPIO from the PI to the local station is used. Open the /etc/rc.local file for editing and change it according to the wiring of the PTT and COS (Squelch). Example here GPIO16 = PTT = output = out; GPIO19 = SQL = input = active when 1.

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
#GPIO16=PTT
echo "16" >/sys/class/gpio/export
sleep 2
echo out >/sys/class/gpio/gpio16/direction
#GPIO19=SQL
echo "19" >/sys/class/gpio/export
sleep 2
echo "in" >/sys/class/gpio/gpio19/direction
#GPIO18=utilitaire
echo "18" >/sys/class/gpio/export
sleep 2
echo out >/sys/class/gpio/gpio18/direction
#GPIO23=stop button directly handling in python script
# vide le tampon du MTM en envoyant un CR
/home/pi/serial_write-CR.py

exit 0

GPIO I/O can be tested with the instruction:

gpio readall

Restriction

With the MTM5x00, if the DMO Repeater mode is used, it is not possible to use the PEI interface to key the transmiter on. A broadcast from the network will to be transmited by the MTM5x00. You must use the wired PTT via GPIO16 and modify the Tx section accordingly.

UART release script

Install Python Serial module.

sudo wget https://files.pythonhosted.org/packages/1e/7d/ae3f0a63f41e4d2f6cb66a5b57197850f919f59e558159a4dd3a818f5082/pyserial-3.5.tar.gz
sudo tar -xvzf pyserial-3.5.tar.gz
cd pyserial-3.5
sudo python setup.py install
cd /home/repeater


In order for TetraLogic to communicate correctly with the PEI interface the first time it is powered on, a carriage return (CR) must be sent to the station to empty the buffer. This macro must be launched before running svxlink, in a file called "serial_write-CR.py" in /home/repeater:

sudo nano /home/repeater/serial_write-CR.py

And add the following code:

#!/usr/bin/env python
import serial
# ser = serial.Serial(port='/dev/ttyS0', # Address for UART on your Pi
ser = serial.Serial(port='/dev/ttyUSB0', # Address for UART on your Pi thru USB
    baudrate=9600,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS,
    timeout=1
)
ser.write(13)
ser.close

Make the script executable with

sudo chmod 744 serial_write-CR.py

This script is to be launched when starting the pi, it will of course be necessary for the MTM station to be powered on when the pi is powered on, we have done this already in: add it in:

/etc/rc.local

on the last lines:

# vide le tampon du MTM en envoyant un CR
/home/pi/serial_write-CR.py

Run Svxlink for testing

Before launching svxlink, free the MTM buffer by with the command

./serial_write-CR.py

Start svxlink by typing the following command:

svxlink

The led of the USB sound card should blink if it is equipped. At launch it is possible to get errors from the PEI. According to the MUTE_FIRST_TX_LOC variable, the first push of PTT selects the TG (described in TETRALOGIC). The 2nd PTT call starts the talker which directs the audio to the TG on the network.

Update Svxlink to the latest version

Login to your Raspberry and run the following commands:

sudo systemctl stop svxlink
cd /home/pi/svxlink/src/build
sudo git pull
sudo make install
sudo systemctl start svxlink

Configure SVXLink

You will need to edit the svxlink.conf file as follows

nano /etc/svxlink/svxlink.conf

Global

If you are using a R1 2020 change te value to 2, if not, leave it as 1.

CARD_CHANNELS=1

ReflectorLogic

HOST=dashboard.vktetra.com

Replace your YourCallSign with your callsign.

CALLSIGN="YourCallSign-L"

Add your ReflectorPasswordHere

AUTH_KEY="ReflectorPasswordHere"

TetraLogic

Replace your YourCallSign with your callsign.

CALLSIGN=YourCallsign

Replace your YourCallSign with your callsign.

APRSPATH=APRS,qAR,YourCallsign-10:

SdsOnUserActivity

Replace your YourCallSign with your callsign.

0=Hello from YourCallSign-L! Refer to vktetra.com for more info.

Tetra_Users

Replace your YourCallSign with your callsign.

0901163830YourRadioISSI=YourCallsign-1,YourName,/1,Tetra DMO Your Gateway Frequency vktetra.com

LocationInfo

Replace 33.12.12S with your Lat using degreens.minutes.seconds

LAT_POSITION=33.12.12S

Replace 151.12.45E with your Long using degrees.minutes.seconds

LON_POSITION=151.12.45E

Replace your YourCallSign with your callsign.

CALLSIGN=EL-YourCallSign

Replace Your Frequency with the one you will be using on your Gateway, i.e. 433.650

FREQUENCY=Your Frequency

Replace Your Suburb with your suburb’s name.

COMMENT=TETRA DMO - Your Suburb Your Gateway Frequency vktetra.com 

To save changes press <CTRL> + <X> followed by <Y> and then <Enter>.

Restart to apply all changes.

sudo reboot

Linking you Raspberry to the radio

You will ned to use the rear accessory port.

For the MTM800 the RAP is a 20 pin header.

MTM800
PTT Pin 3
Tx audio Pin 5
Analog Ground Pin 7
Rx audio Pin 11

For the MTM5400 the RAP is a 26 pin header.

MTM5400
Digital Gnd Pin 16
PTT Pin 17
Tx Audio Pin 11
Analog Ground Pin 12
Rx Audio Pin 14
RXD (serial) Pin 20
TXD (serial) Pin 25

Programming the Repeater/Node radio

Subscriber Unit Parameters

  • Radio ISSI = 9999

DMO Parameters>DMO Group Call Timers

  • DMO Reservation Time, sec = 1

DMO Parameters>DMO Address Extension

  • MCC 901
  • MNC 16383

TalkGroups>DMO>DMO Folders List

DMO Folders List
Name Status Transmision Timeout Timer, sec Transmision Timeout Warning Timer, sec Number of Talkgroups in Range Receive Only
DMO Ham On 120 110 1

Talk Groups>DMO>DMO Talkgroup List

Type the frequency you will be using.

DMO Talkgroup List
Name ID Status DMO Folder List Communication type Gateway Selection Gateway Address Frequency Channel Receive Call to DMO Partnership Networks Network MCC Network MNC TMO Mapping Key Group Incoming Call Minimum Security Class Outing Call Security Class Status/Alarm/Addressing GPS LIP Addressing
Repetidor 1 Programmed 1:DMO Ham Repeater None 433.650 User Defined 901 16383 NO_KG Security Class 1 Security Class 1 None None

DMO Repeater Mode

This is a work in progress...


If you are going to use your MTM5400 in DMO Repeater mode is used, you must use the wired PTT via raspberry Pi GPIO 16 and modify the Tx section accordingly, it is not possible to use the PEI interface to key the transmitter on when a broadcast from the network needs to be transmitted by the MTM5x00.

Wired PTT via GPIO16 and modify the Tx section accordingly.

TBD

Install Phyton Serial

sudo apt-get install python-serial
sudo nano /home/pi/serial_write-CR.py
#!/usr/bin/env python
import serial
ser = serial.Serial(port='/dev/ttyUSB0',
  baudrate=9600,
  parity=serial.PARITY_NONE,
  stopbits=serial.STOPBITS_ONE,
  bytesize=serial.EIGHTBITS,
  timeout=1
)

ser.write(13)
ser.close
sudo chmod +x /home/pi/serial_write-CR.py

Test with

/home/pi/serial_write-CR.py



You will need to edit the rc.local file:

sudo nano /etc/rc.local

Add the following lines to the file:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

# GPIO 16 = PTT
echo "16" >/sys/class/gpio/export
sleep 1
echo "out" >/sys/class/gpio/gpio16/direction
sleep 1
echo 1 >/sys/class/gpio/gpio16/value;

# GPIO 19 = SQL
echo "19" >/sys/class/gpio/export
sleep 1
echo "in" >/sys/class/gpio/gpio19/direction

# GPIO 18 = Utility
echo "18" >/sys/class/gpio/export
sleep 1
echo "out" >/sys/class/gpio/gpio18/direction

# GPIO 23 = Stop button directly handling in python script.
# Clears the MTM buffer by sending a CR

# /home/pi/serial_write-CR.py

(…)
exit 0

Press <CTRL> + <X> then <Y> and last <Enter>.


sudo nano /usr/share/svxlink/events.d/TetraLogic.tcl
# Executed each time the squelch is opened or closed #
proc squelch_open {rx_id is_open} {
Logic::squelch_open $rx_id $is_open;
  puts "Le squelch change: $is_open";
  if {$is_open==0} { exec echo 0 >sudo /sys/class/gpio/gpio18/value; }
  if {$is_open==1} { exec echo 1 >sudo /sys/class/gpio/gpio18/value; }
}

Test Serial Port

sudo apt-get install minicom

minicom -b 9600 -o -D /dev/ttyUSB0

Restart to apply changes.

sudo reboot

Audio leveling

On the command line type:

sudo alsamixer

Choose your external sound card (the one you qre using to talk to the radio). Adjust the input and output levels. For that, you can use the Parrot Reflector 9990.

Finally, save your audio change with the following command:

sudo alsactl store 0

Connecting to Echolink (optional)

Run the following commands, watch the upper case and lowercase “L” on Echolink word.

sudo mv /usr/lib/arm-linux-gnueabihf/svxlink/ModuleEchoLink.so   /usr/lib/arm-linux-gnueabihf/svxlink/ModuleModuleEcholink.so 
sudo cp /etc/svxlink/svxlink.d/ModuleEchoLink.conf   /etc/svxlink/svxlink.d/ModuleEcholink.conf

Edit the following file with your Echolink information.

sudo nano /etc/svxlink/svxlink.d/ModuleEcholink.conf

Notice that the first line need to be modified as follows (watch the “l” on Echolink.

[ModuleEcholink]

Edit the following lines with your Echolink account information.

if 0 then Echolink transmits to the gateway otherwise no!

MUTE_LOGIC_LINKING=0
CALLSIGN=MYCALL
PASSWORD=Password
SYSOPNAME=Tu Nombre
LOCATION=[Svx] Frecuencia, Ciudad

DESCRIPTION="You have connected to a SvxLink node,\n"
            "a voice services system for Linux with EchoLink\n"
            "support.\n"
            "Check out http://svxlink.sf.net/ for more info\n"
            "\n"
            "QTH:     My_QTH\n"
            "QRG:     Simplex link on 433.650 MHz\n"
            "CTCSS:   901-16383\n"
            "Trx:     TETRA DMO\n"
            "Antenna: Comet/Omni/GP-3\n"

Press <CTRL> + <X> then <Y> and last <Enter>.

Restart to apply changes.

sudo reboot