Multimon was originally written by Tom Sailer HB9JNX/AE4WA in 1996.  MultimonNG in an updated fork of multimon by Elias Oenal.  It can decode:

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

I like how lightweight the program is.  It decodes a number of things, and with a script to watch it's output it can be used to do things.  Using the DTMF demodulator, for example you can use it to perform various functions when it hears/sees a matching DTMF string.  

In the past I have even changed the DTMF tone definitions (defined in Hz) so I could receive text message alerts when a matching Fire/EMS two tone was received. (ref)  In 2010 I blogged about the need for an open source way to decode EAS/SAME data.  It does that now, thanks to the open source community listening and their efforts.

The rest of this document will show you how to get multimon-ng installed on the Raspberry Pi micro computer.  Examples for DTMF control will also be shared.

Since the Raspberry Pi lacks a sound input, obviously you'll be adding a USB sound device.  I recommend the SYBA SD-CM-UAUD USB CM119 audio adapter.  But a lot has gotten easier since early 2013 when the Wheezy kernel support and sound configuration was limited.  Others will likely work.  I have not had to manually provision asound.conf for example since late 2013.


For gods sake, give yourself root access.

pi@raspberrypi ~ $ sudo passwd root

The needed stuff.  multimon-ng uses pulse audio:

sudo apt-get update
sudo apt-get --no-install-recommends -y install git cmake libusb-1.0-0-dev libpulse-dev libx11-dev screen qt4-qmake libtool autoconf automake libfftw3-dev
sudo apt-get install qt4-default
sudo apt-get install pulseaudio

Get the source and compile it:

mkdir ~/src
cd ~/src
git clone https://github.com/EliasOenal/multimonNG.git
cd ~/src/multimonNG
mkdir build
cd build
qmake ../multimon-ng.pro
make
sudo make install 

Start the pulseaudio dameon:

pulseaudio -D

Start multimon-ng like so:

root@raspberrypi:~# /usr/local/bin/multimon-ng -a DTMF
multimon-ng  (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA
             (C) 2012-2014 by Elias Oenal
available demodulators: POCSAG512 POCSAG1200 POCSAG2400 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: DTMF
DTMF: 5
DTMF: 5
DTMF: 5

If you get this error, when you try and start multimon-ng: ../unixinput.c: pa_simple_new() failed: Connection refused 

Make sure you have the pulseaudio daemon started:  pulseaudio -D  Also try starting it using the full path: /usr/local/bin/multimon-ng

If something goes to crap, you can stop the pulseaudio daemon with: pulseaudio --kill


You can see in the screen output above I sent three DTMF 5's, and that is what it will display on the screen.

You'll have to use a perl script to interact with multimon's output.  Here is an example:

http://www.qsl.net/kb9mwr/projects/pager/multimon-perl.pl.txt

Grab a copy with wget and then make it executable:

root@raspberrypi:~# wget http://www.qsl.net/kb9mwr/projects/pager/multimon-perl.pl.txt
root@raspberrypi:~# chmod 777 multimon-perl.pl.txt

Now you'll start multimon-ng using the script like so:

root@raspberrypi:~# ./multimon-perl.pl.txt
555 received

Once again I have sent three DTMF 5's

In the perl script, you can change the on trigger command strings to your liking "$on1_cmd = "echo 555 received";

You can have it speak responses using festival a text to speech engine.  You can toggle the Raspberries GPIO to control a LED/relay, or power a solenoid to flush your toilet!


Optional but not necessary.  Since you added a USB sound device, you might as make it your default sound device, for both input and output:

Edit /etc/modprobe.d/alsa-base.conf comment out "options snd-usb-audio index=-2"
You want ""options snd-usb-audio index=0"

Edit /etc/modules to look  like:
#snd-bcm2835
snd-usb-audio


Multimon-ng for Weather Alerts

-= some ideas, a work in progress =-

Since CAT repeaters no longer sells the cheaper WD-100 weather decoder (the one where you pair it with your own receiver) the following will show you how to build your own digital decoder that responds to Specific Area Message Encoded (SAME) alerts transmitted by the NOAA weather station located in your geographic area.  This would be a modernized version of the Computer Alert Interface that I documented 15+ years ago.

The eventual goal will be to pair a Micro-computer like the Raspberry Pi or Beagle Bone Black with a dedicated USB Software Defined Receiver (RTL SDR DVB-T Dongle RTL2832U) that is tuned to the NOAA frequency.  The project should cost about $60, (less than half of the WD-100), and the activation codes and events should be easily user definable, as well as the alert start functions, as the project should try and mimic the functionality of the WD-100.

Upon a matching activation code alert, the micro-computers GPIO will be toggled, which can disconnect your repeaterís transmitter from the controller and connect it to the weather receiver temporally to transmit the warning message.  Optionally using text to speech synthesis, alert messages can be generated from the micro-computer, and similarly be transmitted.  Or for that matter just about anything else, including sending SMS alerts to phones.

 

But first we will experiment with pre-recorded SAME data bursts:

Here are some good test files (courtesy of Thunder Eagle Alerting Systems):
http://www.thuneagle.com/testaudiofiles.htm

root@raspberrypi:~# /usr/local/bin/multimon-ng -a EAS -t wav test.10.3.wav
multimon-ng  (C) 1996/1997 by Tom Sailer HB9JNX/AE4WA
             (C) 2012-2014 by Elias Oenal
available demodulators: POCSAG512 POCSAG1200 POCSAG2400 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: EAS
EAS: ZCZC-WXR-RWT-011001-024009-024017-024021-024031-024033-024037-051013-051043-051047-051059-051061-051099-051107-051113-051137-051153-051157-051177-051179-051187-051510-051600-051610-051630-051683-051685-054037+0030-2761515-KLWX/NWS-
EAS: NNNN
EAS: NNNN
EAS: NNNN

From there you concoct a script to parse multimon's output for desired matching FIPS and Events, and have it toogle GPIO when it matches.

(This is the part that needs development)

NationalWeatherServiceInstruction10-1712.pdf - Detailed explanation of the SAME (specific area message encoding) format


If you are from Green Bay, Wisconsin here are my preferred events/codes/regions that it should respond to...

Severe Thunderstorm Watch SVA
Severe Thunderstorm Warning SVR
Severe Weather Statement SVS
Special Weather Statement SPS
Tornado Watch TOA
Tornado Warning TOR
Winter Storm Watch WSA
Winter Storm Warning WSW
Flash Flood Watch FFA, 
Flash Flood Warning FFW
Flood Watch FLA
Flood Warning FLW
Flood Statement FLS

Brown 055009
Calumet 055015
Door 055029
Kewaunee 055061
Manitowoc 055071
Marinette 055075
Outagamie 055087
Shawano 055115
Winnebago 055139


Once you have Multimon installed and working it is time to get the dedicated RTL receiver going.

Install the necessary drivers to the system:

sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0.dev
sudo apt-get install build-essential

Download and install rtl-sdr using the following commands:

git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

Before this will work you will need to locate your RTL directory using the file manger where the drivers where downloaded and copy the rules file (rtl-sdr.rules) into the /etc/udev/rules.d directory.  Once you have done all this, plug in the RTL-2832U stick and issue the rtl_test -t command to make sure the Raspberry Pi sees your stick.

One more thing, you'll want to block the new DVB drivers from conflicting with the custom SDR driver in the event you upgrade the Linux distro.  Add the following lines to the file /etc/modprobe.d/raspi-blacklist.conf

blacklist dvb_usb_rtl28xxu
blacklist rtl2830
blacklist dvb_usb_v2
blacklist dvb_core

Now you'll start the decoder by piping the RTL FM demodulator into it, for actual over the air use like so:

rtl_fm -f 162550000 -s 22050 - | multimon -a AFSK1200 -t EAS

This command uses rtl_fm to receive the NOAA frequency of 162.55 MHz and demodulate that to 22.05kHz audio. The audio is then piped to multimon, the general purpose digital decoder program for Linux. Multimon is set up to try and demodulate the EAS/SAME data packet, which we experimented with before.