TETRA-Kit: A New Open Source TETRA Decoder

Thank you to Larry for submitting information about his latest project called TETRA-Kit. TETRA-Kit is an extensible open source TETRA downlink decoder for Linux that makes use of GNU Radio as the first stage, so it should be compatible with any SDR supported by GNU Radio, including the RTL-SDR. Larry writes:

[TETRA-Kit] is inspired by a lot of existing stuff (see 'Previous work' in the project page) but started from scratch with those following ideas:

  • Stays as close as possible to TETRA specification layers defined in ETSI EN 300 392-2 v3.4.1 (2010-08)
  • Transmit downlink informations (including speech frames) in Json plain text format to be recorded or analyzed by an external program
  • Reassociate speech frames with a simple method based on associated caller id and usage marker (save messages transmitted simultaneously in separated files)
  • KISS

The decoder implements a soft synchronizer allowing missing frames (50 bursts) before loosing synchronization.

It consists in 3 parts:

  • A physical layer transforming PI/4 DQPSK rf signal to bits (RF frontend is NESDR at 2MBPS)
  • A decoder, which is the actual TETRA stack reading bits and transforming it to Json text
  • A recorder, which read Json stack output and reorder speech frames into separate files

The ETSI codec is also provided so unencrypted speech can be played.

Software is written in C++ and licensed under GPLv3 and use few external softwares with compatible licensing.

TETRA is a type of digital voice and trunked radio communications system that stands for “Terrestrial Trunked Radio”. It is used in many parts of the world, but not in the USA.

TETRA-Kit Screenshot
TETRA-Kit Screenshot
Subscribe
Notify of
guest

53 Comments
Inline Feedbacks
View all comments
Nonam

Constellation of the Pi/4-DQPSK modulation should look like 8-PSK constellation. But the constellation in the Tetra-kit looks like QPSK. Can anyone explain why?

Larry

Sure, there is something subtle done when recovering pi/4-DPQSK signal by pi/4 transitions instead of full 8 points recovery, only 4 points will then appear, see for example https://blog.atx.name/kvak/

Ed V

Who says TETRA is not used in the US??? Its been in use for over 7 years including Canada, and in the US states such as NJ, GA and NYC is just about ready to flip the switch on TETRA. Many airports in the US are moving to TETRA for flight services, etc….And…many are NOT encrypted so easy listening on this side of the pond!

tester

Not start
pi4dqpsk_rx.grc + pi4dqpsk_rx .grc
Both not start 2 blocks RED color named QT Gui Entry
rx_mpsk.grc = working

larryth

Which version of Gnuradio are you using ? I think there are few missing parts, such as Qt widgets.
By the way, if you don’t have Qt widgets, the waterfall block should also be in red, can you confirm ?

tester

pi4dqpsk_rx.grc = not start
pi4dqpsk_tcp .grc = not start
rx_mpsk.grc = running
Iam totally not linux guru not sure the Tetrakit is installed correctly
I use GNUradio 3.7.11

tester

cd decoder
make
get a RED “fatal error u such file # include n
I think instal json

larryth

Yes there is an open issue on the project page, I will find a fixup for Json-c since it requires a specific version to work.

May you please open an issue on my Gitlab project for the pi4dqpsk not working ? You have the right version of Gnuradio, so it should work fine. And please add me a screenshot of the red blocks, I will check it.

tester

After did
~/json-c-builds$ make install
running……………….
the end get:
Makefile : 73: recipe for target ‘install’ failed
make : *** [install] Error 1

NOTICE
There is also a directory with Json-c
When do:
cd decoder
make
fatal error : json-c/json.h : No such file
# include -json-c/json.h
compilation terminated
Makefile:12 recipe for target ‘decode’_main.o failed
Make : *** [decoder main.0] error 1

tester

Red block something to do with the Gui Hint?
Remove / blank Gui hint
Red Color block is gone
Receiver grc file start up now, see tetra signal
But not yet decode voice
When do change center frequency in de flow Graph, it crashes
Only possible to change center Freq in the – Open Properties –

tester

Larry you have direct contact?
Than we able move faster to test and solve things

Larry

Hello Tester,
Please open an issue directly on the project https://gitlab.com/larryth/tetra-kit/-/issues
It will be easier to follow and everyone will be able to get informed.

tester

I am not linux guru, like simple step by step information for dummys No idea how to instal json-c 0.12

Anonymous

Yep, sure, not a problem 🙂
I will add it to the code in the project so everyone can use it.
Please refer to the Gitlab tetra-kit issues, you will see you are not alone in this case.

tester

Please for linux dummys in your RAEDME.md, possible a simple step by step copy paste terminal command to install, compile the json-c 0.12

Anonymous

I will do better than that.
I will add the source for a static build directly in my git repos, so you will have everything you need.

In the mean-time, if you want to build it from source, please refer to https://github.com/json-c/json-c/tree/json-c-0.12
everything is detailed to build it

tester

In terminal i try : ./decoder -r or /run ./decoder -r
both did nothing

Anonymous

Which is your Linux distribution ?
You may run it just with decoder instead of ./decoder

tester

LinuxMint 19.2

tester

xxx/xxx/tetra-kit/decoder$ make
g++ -O2 -fPIC -std=c++11 -Wall -c decoder_main.cc -o decoder_main.o
In file included from decoder_main.cc:19:0:
tetra_dl.h:33:10: fatal error: json-c/json.h:
#include
^~~~~~~~~~~~~~~
compilation terminated.
Makefile:12: recipe for target ‘decoder_main.o’ failed
make: *** [decoder_main.o] Error 1

Larry

You have to add the link to the folder where you installed json-c in the Makefile:
See issue #6 https://gitlab.com/larryth/tetra-kit/-/issues/6 it should work since Linux Mint is Ubuntu based distro

Larry

You may also simply modify the Makefile as follows:

>>CC = g++

>>CFLAGS = -O2 -fPIC -std=c++11 -Wall -I

>> LDFLAGS = -ljson-c -lz -L

Larry

CC = g++

CFLAGS = -O2 -fPIC -std=c++11 -Wall -I root_path_of_json_header
for example
CFLAGS = -O2 -fPIC -std=c++11 -Wall -I /usr/local/include

LDFLAGS = -ljson-c -lz -L root_path_of_library
for example
LDFLAGS = -ljson-c -lz -L /usr/local/lib64

tester

Receiver is up and running
No decoded voice

Larry

You are learning faste ?. Nos thé décoder os running, You have to start the recorder which record the voice

tester

tetra-kit/codec/
make
there is no make action

Larry

Do you have the makefile? It is in the codec folder. You can type ‘make all’ and it Will build the required targets

tester

tetra-kit/codec/Makefile = 1.4 KiB size
tetra-kit/codec/
make
nothing happen

tetra-kit/codec/
make all
nothing happen

tetra-kit/codec/
sudo make
nothing happen

tetra-kit/codec/
sudo make all
nothing happen

tester

decoder/ make file first line
CC = g++
CFLAGS=

/codec/ makefile first line
CC =gcc
CFLAGS=

Larry

You can change the gcc by g++ in the makefile. Run ‘make clean’ then run ‘make’. I think You could have a look To Google, there are many useful tutorials on gcc and makefile. Best regards

tester

Hi thanks for support
i am not a linux guru, i know nothing i am a complete linux dummy, only a simple radio listener
so i do what the instructions on tetra-kit gitlab website telling me to do and while fallow these instructions, bounce to these problems who i not have solution for, because i am not a linux coder 🙂 🙂 Any help or advices from author will be very appreciating. Your advice GNUradio 3.17 so i use 3.17, when try edit set a new frequency, the GNUradio flow graph is crashing. wish list UP / DOWN buttons to change frequency settings and a extra box to change step size 6.25 or 12.5 kHz, will be nice. Tetra use 6.25, 12.5 step.
makefile. Run ‘make clean’ then run ‘make’.
Last line give this:
collect2: error: ld returned 1 exit status
Makefile:49: recipe for target ccoder failed
make *** [ccoder] Error 1

Any advice from author is very appreciating 🙂 🙂

tester

— makefile. Run ‘make clean’ then run ‘make’.
Last line give this:
collect2: error: ld returned 1 exit status
Makefile:49: recipe for target ccoder failed
make *** [ccoder] Error 1

Any advice from author is very appreciating

Erik Bročko

Thaaank yoou! I tried running the Osmocom TETRA stack, but the Gnuradio Python components were outdated and it was so much hassle. I’m gonna try this one.

tester

Like test this in MINT 19.3 but i no way a linux guru Possible instructions to find / install these extra piece drivers i have not all in this distro?

larryth

What specific parts do you need for Mint ? You shoudl install gnuradio, gnuradio-companion, rtlsdr from osmocom, python and a gcc/g++ toolchain. Should work fine with that everything else is native c++

tester

not sure to do with the files, not linux guru

veselko

Hmm… useless for many european countries, because all tetra traffic here is encrypted. Any options to do sth on that?

none

No its not!
There are 2 different types:
1) a Private Company who is Contract to do the Gov. Stuff -> encrypt
2) Private Operator of Various Varitis -> NOT encrypt (for any reason)

I can receive the Bratislava Public Transport who is not encrypt.

veselko

Yeah, but those are rare, mostly are saturated in big cities… if so.

none

I found some open Data about your Contry:
T-MNC 232-1000 – TETRON Sicherheitsnetz Errichtungs- und BetriebsgmbH Hohenbergstraße 1 / Objekt 3 A 1120 Wien
T-MNC 232-1010 – Büro der Vereinten Nationen Wien Wagramer Strasse 5 A 1220 Wien
T-MNC 232-1020 – OMV Austria Exploration & Production GmbH Protteserstrasse 40 A 2230 Gänserndorf
T-MNC 232-1050 – Wiener Lokalbahnen GmbH Purkytgasse 1B A 1230 Wien
T-MNC 232-1234 – Flughafen Wien AG Flughafen A 1300 Wien-Flughafen

If would be nice when the Software allow to put this information in a CSV, XML File and show when someone select a Channel.
DE: https://www.bundesnetzagentur.de/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Nummerierung/TechnischeNummern/ITSI/ITSI_Basepage.html
Tetra Channels: https://www.bmk.gv.at/dam/jcr:e98ca9b5-f97a-47f2-b27b-f2926105ab28/mastertalk.zip
(I a PDF there)
AT: https://www.rtr.at/de/inf/odSKP

veselko

i’m not from Austria…

none

I guess you would find information for your country to. Where are you from?

none
veselko

293

none

You can look up at your local open Data catalogue.
Maybe you find in Gov. Data Website more infos?
You must search at any place to find more infos.

wuc

Because of people like you, it will be encrypted soon… stupid “none”

Erik Bročko

Exactly, I’m just working on an SDS decoder. The `decoder` program outputs json with raw packet data. I converted some messages to ASCII and got “Elektricky” and “Autobusy l”, not sure if it’s truncated by the decoding software or split across multiple messages.

I just wish the telive toolchain was up to date and worked on GnuRadio 3.8 and Python 3.8 .

larryth

Well the SDS handling is far from complete, may you provide me the bitsream (./decoder -o out.bits) I will have a look.

tester

Some are still open 🙂

none

is there any Software who allow me to select an Radio ID and brodcast/ stream only that?

larryth

The recorder program is only a ‘proof-of-concept’ of what can be done with decoder Json text output. One can imagine you track specific SSI and receive only packets and voice associated with this SSI… it can be written in Pyhton or whatever programming language you know

RF Guy

please do the same for Tetrapol.

larryth

Well, if you want to go to jail… it is used mainly by high security services and shoud be 100% encrypted. To my knowledge, a decoder “tetrapol-kit” was available on the web (I have no links with this work!)