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

50 comments

  1. 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

          • 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

                    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

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

                    • 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 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

                    • Larry

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

      • 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

          • 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

  2. 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.

  3. 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++

  4. veselko

    Hmm… useless for many european countries, because all tetra traffic here is encrypted. Any options to do sth on 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

    • 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!)

Post a comment

You may use the following HTML:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.