multimonNG

Due to my recent acquisition of an RTL-SDR compatible radio module (Some would call it DVB-T stick) I started playing with radio transmissions. Doing so I found POCSAG (pager) transmissions which I tried to decode using multimon. Sadly multimon was very broken, after I finally managed to compile it on OS X I realized it had 64bit bugs preventing the decoding on my system. So I forked it and patched a lot. I rewrote large parts of the POCSAG decoder after reading the patent text as well as implemented the BCH forward error correction. Besides improving POCSAG my main focus was portability, it now even compiles on Windows 🙂

MultimonNG a fork of multimon. It decodes the following digital transmission modes:
POCSAG512 POCSAG1200 POCSAG2400 EAS UFSK1200 CLIPFSK AFSK1200 AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI

The following changes have been made so far:
-Fixes for x64
-Basic functionality on Mac OS X ‘Lion’ (Soundcard/OSS input is unsupported)
-‘DUMMY_AUDIO’ “backend” (Gets rid of the OSS dependency, breaks audio in doing so)
-‘ONLY_RAW’ disables the format conversion while getting rid of posix dependencies
-Option ‘NO_X11’ to disable the X11 dependency since Apple will drop Xorg soon
-Override mode for POCSAG decoding (e.g. force text decoding)
-Brute-Force BCH implementation for POCSAG forward error correction
-Verbose mode is now listed in ‘-h’
-Merged Debian patches for EAS (Emergency Alert System) decoding (untested)
-Portability is a major goal
-Compiles on Windows (MinGW or Cygwin) without format conversion
-PulseAudio support, contributed by inf_l00p_
-Windows native audio and a VisualStudio/MSVC project file, contributed by bzzt_ploink

In addition to the deprecated legacy Makefile there is also a file for qmake which is the preferred way of building MultimonNG. It’s recommended to use qmake to generate the Makefile. (‘qmake multimonNG.pro && make’)
So far multimonNG has been successfully built on OS X, Debian, Ubuntu and Windows. (On Windows using the Qt-MinGW build environment, as well as Cygwin and VisualStudio/MSVC)

Files can be easily converted into multimonNGs native raw format using ‘sox’.
e.g. “sox -t wav infile.wav -esigned-integer -b16 -r 22050 -t raw outfile.raw remix 1”
GNURadio can also generate the format using the file sink in input mode ‘short’.

Source: https://github.com/EliasOenal/multimonNG/
License: GPLv2

Windows version: https://github.com/EliasOenal/multimon-ng/releases
(It doesn’t come with SoX and as a result can’t handle filetype conversions. Soundcard input and virtual audio cables should work fine, though.)

Some testfile converted to the native multimon format: poc1200
(Source: http://www.kb9ukd.com/digital/)
To decode it try “multimonNG.exe -a POCSAG1200 -t raw poc1200.raw”.
(“-i” is needed for recent versions of multimon-ng)

PS:
Superkuh wrote a bit about using multimonNG with GNURadio allowing for realtime decoding. http://superkuh.com/rtlsdr.html

PPS:
Apparently you can combine multimonNG with rtl_fm to live decode POCSAG. It even seems to be lightweight enough to work on a Raspberry Pi. Thanks to Sonny_Jim from ##rtlsdr on freenode for trying!

<Sonny_Jim> Ok, so this works:
<Sonny_Jim> rtl_fm -f 153.353e6 -g 100 -s 22050 -l 310 – |multimon -t raw -a POCSAG1200 -f alpha /dev/stdin

68 Comments

  1. Hey, just to let you know I found this software very useful, thanks! I’ve managed to get it working along with a DVB-T dongle and rtl_fm to let me receive and decode POCSAG in realtime on my Raspberry Pi!

  2. I have not been able to get multimonNG running on my Mac (OS X 10.7). The
    application is built but it doesn’t execute.

    I installed qmake on my Mac this way:
    sudo port install qt4-mac

    I then used qmake generate the app:
    qmake multimonNG.pro && make

    A multimonNG.app file was created but it does not run when I click on it.
    There is not error message.

    Any advise you can provide would be greatly appreciated.

    Thanks for all the work you have done on Multimon.

  3. It is possible to add a TCP server for APRS rx?
    MultimonNG work well in APRS reception but write packets on stdout.
    Adding an optional TCP server for sending packets in TNC2 format can be possible to feed received packet to a APRS program as Xastir

    Regards

  4. Hi and thanks for the great job with multimonNG and Gqrx.

    I got some problem when using multimonNG, maybe you know what to do:

    When piping the rtl_fm output to multimonNG it doesn’t decode anything. First I thougt, the signal was to weak, but I tested it this way:
    – record with Gqrx
    – mix down to mono
    – normalize the sound
    -> multimonNG is able to decode it.

    So maybe is rtl_fm the problem – beware – crazy testing:
    – I “pipe” the sound via iMacs LineOut to a Windows Notebook with FMS32 installed
    -> FMS32 can decode the sound.

    Any idea, why multimon wouldn’t eat the plain output of rtl_fm?

    • Could you paste the actual command you were using? The version of multimonNG I have packaged doesn’t support standard input via pipe. Instead you can have it read from “/dev/stdin”. The latest version does support getting piped into and I will include it with the next bundle.

    • Have you considered that the normalization may have brought the signal levels up to the point that they could be decoded?

      You might try excluding the normalization step and see if the file can still be decoded. If it can’t be decoded then it means that the audio level needs to be increased. Although I have no idea how that’s done on your system. But at least you’d know where the problem is.

      Good luck. 🙂

  5. I use this one:

    rtl_fm -N -l 6 -E -f 173240000 -s 22050 -o 4 -g 100 – | tee >(./multimon -a POCSAG1200 -f alpha -t raw /dev/stdin) >(play -t raw -r 22050 -e signed-integer -b 16 -c1 -V1 -q -) > /dev/null

    to here what’s being received.

    It’s a self compiled version from github run under ubuntu.

    • Well if you don’t want to touch the Terminal.app you can download Qt Creator, load the project and hit “Build Project”. The CLI way of doing it is ‘mkdir build && cd build && qmake ../multimon-ng.pro && make && sudo make install’ after installing a compiler (clang/GCC) as well as qmake.

  6. Hello,
    thanks for this great article!
    I’ve installed the rtl_fm and multimon packages on my rpi and have Cinergy DVB-T Stick.
    Then I’ve set the frequency. But multimon says everytime:

    pi@raspberrypi ~ $ rtl_fm -N -o 4 -A lut -s 22050 -C -f 172.680M – | multimon-ng -t raw -a POCSAG512 -a POCSAG1200 -a POCSAG2400 -f alpha /dev/stdin
    POCSAG512 POCSAG1200 POCSAG2400 EAS UFSK1200 CLIPFSK AFSK1200 AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI1 ZVEI2 ZVEI3 DZVEI PZVEI EEA EIA CCIR MORSE_CW DUMPCSV SCOPE
    multimon-ng (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA
    (C) 2012/2013 by Elias Oenal
    available demodulators: POCSAG512 POCSAG1200 POCSAG2400 EAS UFSK1200 CLIPFSK AFSK1200 AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI1 ZVEI2 ZVEI3 DZVEI PZVEI EEA EIA CCIR MORSE_CW DUMPCSV SCOPE
    Enabled demodulators: POCSAG512 POCSAG1200 POCSAG2400
    Found 1 device(s):
    0: Realtek, RTL2838UHIDIR, SN: 00000001

    Using device 0: Terratec Cinergy T Stick RC (Rev.3)
    Found Elonics E4000 tuner
    Oversampling input by: 12x.
    Oversampling output by: 4x.
    Buffer size: 7.74ms
    Tuned to 172944600 Hz.
    Sampling at 1058400 Hz.
    Output at 22050 Hz.
    Exact sample rate is: 1058400.010094 Hz
    Tuner gain set to automatic.
    POCSAG1200: Address: 123456 Function: 2
    POCSAG1200: Address: CORRUPT Function: CORRUPT
    ———————————————————————————-
    What’s wrong? Corrupt isn’t good. I can’t read the messages. Sometimes i can read one part of a word, but then it says CORRUPT…
    Is it normaly that my set frequency (172.680 MHz) Tuned to 172944600 Hz??
    Should i change the configuration?

    Thanks for your help :).
    Felix

    • The frequency is fine, rtl_fm does that in order to avoid the DC-offset. Normally I’d guess it’d be a case of bad reception, though given that you’re using it on a raspberry pi, I’d suggest verifying the problem on an x86 system. I’ve heard about problems with recent versions of rtl_fm on the raspberry pi.

  7. Pingback: The BIG List of RTL-SDR Supported Software - rtl-sdr.com

  8. Pingback: Linux : decode APRS packet from RTL SDR | Y.Man's Blog

  9. Hello.

    Something i want to share (as it tried severl days to figure out the problem):
    since begin of this year something has changed in the rtl_fm code so that i had to adjust the call of multimon-ng on a Pi after doing a new build:
    rtl_fm -f XXX.XXXM -s 22050 -M fm -F 0 -E dc -p 37 2>/dev/null | multimon-ng -q -t raw -a POCSAG1200 -a POCSAG512 /dev/stdin 2>/dev/null >>/tmp/pocsag &
    New is -F 0 and -E dc. Before it has worked without. Now it is needed to get the same good decoding quality. CPU consumtion from rtl_fm is from 15 to 30%. mutlimon is 15%.

    Martin

  10. Using your sample poc1200.raw im getting:

    » ./multimon-ng -v10 -a POCSAG1200 -t raw poc1200.raw
    multimon-ng (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA
    (C) 2012-2014 by Elias Oenal
    available demodulators: POCSAG512 POCSAG1200 POCSAG2400 EAS UFSK1200 CLIPFSK AFSK1200 AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI1 ZVEI2 ZVEI3 DZVEI PZVEI EEA EIA CCIR MORSE_CW DUMPCSV
    Enabled demodulators: POCSAG1200

    ===POCSAG1200 stats===
    Words BCH checked: 2238
    Corrected errors: 686
    Corrected 1bit errors: 117
    Corrected 2bit errors: 569
    Invalid word or >2 bits errors: 1552

    Total bits processed: 2315
    Bits processed while in sync: 0
    Bits processed while out of sync: 2315
    Successfully decoded: 0.000000%

    on OS X

    But on Windows I get:

    multimonNG (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA
    (C) 2012 by Elias Oenal
    available demodulators: POCSAG512 POCSAG1200 POCSAG2400 EAS UFSK1200 CLIPFSK AFS K1200 AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI
    Enabled demodulators: POCSAG1200
    POCSAG1200+: Address: 501796 Function: 0
    POCSAG1200+: Numeric: 1234567890

    Im I doing something wrong? compiled using commit 611970773fa294eb86dbce9c2a751cc5a84456e0

    • The signal in that file is inverted, adding ‘-i’ fixes the problem. multimon-ng used to always decode the inverted, as well as the non-inverted input. I’ve changed the behaviour since it impacted the performance, while also confusing some people with low “Successfully decoded” percentages.

  11. Great update to the original.. after some struggles with the dongle, crappy signals.. I’ve gotten that resolved … but am having a problem..

    How do you eliminate the “Numeric” decode line? I AM USING -f alpha but still there…. I need to eliminate that

    Using:
    rtl_fm -l 32 -g 42.0 -F 0 -E dc -p -111 -M fm -f (mychannel_freq)M -s 22050 |multimon-ng -a POCSAG1200 -a POCSAG512 -a POCSAG2400 -a SCOPE -f alpha -t raw /dev/stdin > MyPagingLog.log

    Still get this:
    POCSAG1200-: Address: xx Function: 0
    POCSAG1200-: Numeric: 4 4]41.14.]019.399-280391U04246]3[9440145.5 9]4U.2-22828247]35.- 023394- 2U0423.5-04- 423U835.]3-9540115. 2012-9346184 4[UUU1435.]3-9541.4[9[ 56114449282 ]62386.4-7.3U87-023990.0.5U8 20513835.2U046U89 4624618.-1683 3 7]23U0U85 26950.6699 9]1789-028. [-1-0284]5]1[UU–]2UU9 370193-378789]364382 4701-1-9]9388]9]679950…U3-47-539803U5 04-20915][]63868448]-040U -U064U79 0613.182653-5-]6.U81-80000

    The line below this is an alpha decode of the above(?) which is the correct data…

    I want to elimnate that NUMERIC LINE, is that now what the -f alpha does????

    Also any chance of getting Flex added???? Really would love a NON bloated way to do flex.. I don’t need GnuRadio, and GUI, etc.. just text…

    Oh, and any chance of OFFICIAL implementation of the SQLite patch elsewhere or adding other SQL support, OFFICIALLY?

    THANKS!

  12. Hi,

    As per Phillipp above, I also have a list of pocsag riccodes/capcodes that I would like to filter on.
    Also is there any way of including a time/date stamp on the line when receiving a message or tone? This is useful for tracking activity when browsing the output file.

    Thanks

  13. Hello I am trying to install multilmonNG but get the following error

    jo@jo-Satellite:~/Downloads/multimonNG-master$ qmake multimonNG.pro && make
    gcc -c -m64 -pipe -O2 -Wall -W -DARCH_X86_64 -DPULSE_AUDIO -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -o unixinput.o unixinput.c
    unixinput.c:45:26: fatal error: pulse/simple.h: No such file or directory
    #include
    ^
    compilation terminated.
    make: *** [unixinput.o] Error 1

    Help 🙂
    Thanks Graham

  14. Hi. Is there any way you can add weatherfax to this? *Every single* application I’ve seen for decoding HF weatherfax use the sound card. I am stuck using pulse audio, but it tends to oscillate (badly) when listening to USB (not universal serial bus, but upper side band). Worse, the oscillation stays, and my tv tuner starts to oscillate too (and doesn’t go away till init 0, even init 6 won’t stop it). I can stop pulse audio and default back to alsa, but programs like JWX and fldigi don’t like alsa (they want pulse). And when I decode POCSAG I can turn the audio in GQRX right down, stream on port 7666, and multimon-ng works absolutely perfect, and I can listen to anything else on the computer (I usually also shape the bits with SOX). So wefax? It would be nice. Thanks again.

  15. Hi there,

    is ist possible to use multimon-ng on a raspberry pi with an external sound device (USB Sound card) instead of a RTL-Stick?
    As a Linux-beginner i only found examples to do it with RTL, i have no idea how i cold try it with another sound device…

    best regards,
    Heinz

    • You apparently don’t have any suitable compiler installed. On Mint and other Debian derivates you should be able to get everything necessary by installing the package “build-essential”.

  16. I am using a Raspberry Pi with Raspbian Wheezy with a RTL Nooelec Mini 2 an was able to decode OK AIS (aisdeco), ACARS (acarsdeco2), and ADB-S (dump1090).

    I follow the instruction to setup and RTL APRS Rx Igate and installed the software OK. But, the receive is deaf. Sometimes a packet comes in. But, mostly not able to decode. I tested first with:

    rtl_fm -f 144.390M -s 22050 -p 59 -g 42.0 – | multimon-ng -a AFSK1200 -A -t raw –
    Found 1 device(s):
    multimon-ng (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA
    (C) 2012-2014 by Elias Oenal
    available demodulators: POCSAG512 POCSAG1200 POCSAG2400 FLEX EAS UFSK1200 CLIPFSK FMSFSK AFSK1200 AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI1 ZVEI2 ZVEI3 DZVEI PZVEI EEA EIA CCIR MORSE_CW DUMPCSV SCOPE
    Enabled demodulators: AFSK1200
    0: Realtek, RTL2838UHIDIR, SN: 00000001

    Using device 0: Generic RTL2832U OEM
    Found Rafael Micro R820T tuner
    Tuner gain set to 42.10 dB.
    Tuner error set to 59 ppm.
    Tuned to 144643575 Hz.
    Oversampling input by: 46x.
    Oversampling output by: 1x.
    Buffer size: 8.08ms
    Exact sample rate is: 1014300.020041 Hz
    Sampling at 1014300 S/s.
    Output at 22050 Hz.

    I tried changing the parameters and no luck. My setup is very deaf. Not hearing the APRS packet my Handheld radio could decode.

    • Your question is almost a year old, but just in case this may still be helpful, try this (adjusting the -p, -g, and -l parameters for your RTL stick):

      rtl_fm -f 144.390M -s 22050 -p 73 -g 44.5 -l 55 | multimon-ng -a AFSK1200 -a SCOPE -t raw –

      Or, for “APRS” output:

      rtl_fm -f 144.390M -s 22050 -p 73 -g 44.5 -l 55 | multimon-ng -a AFSK1200 -A -t raw –

  17. Thanks for writing this, I hope you’re still looking at the blog comments.

    I’ve got this built on OSX but no matter which samples of POCSAG I find, wav or raw, I can’t get a single one to decode correctly – do you have any sample files that you use for testing/validation?

    Cheers
    -Rob

      • Thanks Elias, I tried inverting the samples as you suggested, as well as playing with a few other options but I’m still struggling.

        Most of the time I get no output at all, only the info that gets printed if multimon-ng is run without any parameters, other times I get some output like that below but I’m not sure what it signifies:

        1521.723389,-5493
        1521.768799,-6100
        1521.814087,-5260
        1521.859497,-2689

        Here’s two of the samples I’m attempting to use, I’m not sure where to go from here apart from maybe trying to find some more sources. I’m currently wondering if this is an OS-X issue.

        http://kb9ukd.com/digital/pocsag12.wav
        http://www.sigidwiki.com/images/6/65/POCSAG_IQ.zip

        I appreciate you must be tied up with other things but if you get the chance to take one of those (I realize the second will need unzip first) and validate that they’re working on your side, I can start focussing on trying to work out if it’s an OSX specific issue.

        Thanks again for still looking at the comments on your blog so many years after the initial post!

        • I can’t decode your file either, I think it might be missing the preamble. And the second file’s name suggests it contains IQ samples, which multimon-ng can’t process. Try this one: POCSAG_Sound.mp3 It decodes fine on my Macbook, though it requires SoX for mp3 conversion.
          ./multimon-ng -a POCSAG1200 -t mp3 -i POCSAG_Sound.mp3

          Without SoX you can first convert it on a different machine:
          sox -t mp3 POCSAG_Sound.mp3 -R -c 1 -esigned-integer -b16 -r 22050 -t raw POCSAG_Sound.raw
          And then decode on OSX:
          ./multimon-ng -a POCSAG1200 -i -t raw POCSAG_Sound.raw

  18. Thank you for writing this decoder! It’s my only and last hope to decode POCSAG on a Raspberry Pi 3.

    But even the test file pocsag12.wav won’t work, any idea? The stats say:
    Words BCH checked: 230
    Corrected errors: 81
    Corrected 1bit errors: 27
    Corrected 2bit errors: 54
    Invalid word or >2 bit erros: 149

    Total bits processed 457
    Bits processed while in sync: 0
    Bits processed while out of sync: 457
    Successfully decoded 0.000000%

    although I used the command
    multimon-ng -v1 -i -a POCSAG1200 -t raw pocsag12.wav
    (tried with and without sudo)

    Thanks in advance!

  19. Fantastic program, thank you Elias!

    I needed to spend some time tweaking rtl_fm first. I calculated the parts per million error rate based on rtl_test. I found the gain value on another website and then adjusted the squelch to suit my environment. Once I was happy with the output, I piped it into multimon-ng and it worked!

    For reference for other users, my command line is:

    rtl_fm -A fast -f [frequency]M -M fm -s 22050 -g 44.5 -l 140 -p 23 | multimon-ng -n -v1 -p -t raw -a POCSAG512 -f alpha /dev/stdin

  20. Is anyone else getting this when they input the command to try and decode pager signals . . . I had success the first time i tried but then when I tried later now all I get is this.

    Using device 0: Generic RTL2832U OEM
    Found Rafael Micro R820T tuner
    Tuner gain set to automatic.
    Tuned to 929927100 Hz.
    Oversampling input by: 12x.
    Oversampling output by: 4x.
    Buffer size: 7.74ms
    Exact sample rate is: 1058400.010094 Hz
    Sampling at 1058400 S/s.
    Output at 22050 Hz.
    Signal caught, exiting!

    User cancel, exiting…

    And it goes back to the command line, why would this happen and does anyone have any ideas for a solution?

Leave a Reply to Daniel Schlapa Cancel reply

Your email address will not be published.