Decoding P2000 using Raspberry Pi 2 and RTL-SDR
|
P2000 is the Dutch paging network for emergency services like police, ambulance and fire brigade. There are many websites on which you can view the pager messages in real time. It’s not hard to receive and decode them yourself. This is how I built a simple receiver and decoder using a Raspberry Pi 2 with a RTL-SDR. The latter being just a cheap DVB-T USB-receiver based on the R820T-chipset.
P2000 as used in The Netherlands
Frequency: 169,650 MHz
Speed: 1600 bit/s (2FSK)
Protocol: Motorola FLEX
I’m installing this from my desktop-PC running Linux Mint onto a ‘headless’ Raspberry Pi. The Raspberry Pi doesn’t have a screen, neither a keyboard or mouse. The Raspberry is only attached to a network cable, the DVB-T-receiver and the power supply.


Tested with:
Raspberry Pi 2
2016-05-27-raspbian-jessie-lite
R820T DVB-T USB
Receiving P2000 paging signals: Raspberry Pi
First, you need to download Raspbian and write the image to the SD card. For this project, I chose Raspbian Jessie Lite. Put the image in the SD card (I used one of 16GB but a smaller card is OK too) and insert the card into the Raspberry. Do not insert the DVB-T receiver yet. Power on the Raspberry Pi and follow the usual installation procedure which I’ll walk you through below.
After booting up the Raspberry Pi got the ip adress ‘192.168.20.46’, handed out by the router. Using my desktop PC I logged in on the Pi over SSL using the standard username (‘pi’) and password (‘raspberry’):
ssh [email protected]
Start raspi-config:
sudo raspi-config


Choose option “1: expand filesystem”. Then reboot, and log back in. And then, as usual, you should update the package lists:
sudo apt-get update
Download some required packages (this can take a few minutes):
sudo apt-get -y install git cmake build-essential libusb-1.0 qt4-qmake libpulse-dev libx11-dev qt4-default
After this, we install support for the RTL-SDR.
Receiving P2000 paging signals: RTL-SDR
Execute the following commands to download and install the packages needed for the USB receiver:
mkdir -p ~/src/
cd ~/src/
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig
Now you can insert the USB receiver and test the installation like this:
rtl_test
Probably rtl_test will abort showing this error:
usb_claim_interface error -6
Failed to open rtlsdr device #0
If it does show this error, we need to ‘blacklist’ the conflicting (default) Raspbian drivers.
To do this you need to modify the file /etc/modprobe.d/raspi-blacklist.conf (this is probably an empty file):
sudo nano /etc/modprobe.d/raspi-blacklist.conf
Add these 3 rules:
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
Save the file using CRTL+O (letter O), and exit by pressing CTRL+X.
Then we need to reboot and log back in again:
sudo reboot
Check the installation of the USB receiver again:
rtl_test


If everything well, you can exit rtl_test by pressing CTRL+C. You can now install multimonNG to decode the FLEX datastream.
Decoding P2000 FLEX: multimon-NG
Execute the following commands to download and install ‘multimonNG’ decoder:
cd ~/src/
git clone https://github.com/Zanoroy/multimon-ng.git
cd multimon-ng
mkdir build
cd build
qmake ../multimon-ng.pro
make
sudo make install
Now we can receive and decode the P2000 broadcasts using the command:
rtl_fm -f 169.65M -M fm -s 22050 -p 83 -g 30 | multimon-ng -a FLEX -t raw /dev/stdin


Where:
- -g is gain, a value between 0-50; do not set for automatic gain
- -p is the ppm offset for your RTL-SDR.
You can also add the parameter -v 1 (of -v 2/-v 3) for more detailed output.


after using the command:
rtl_fm -f 169.65M -M fm -s 22050 -p 83 -g 30 | multimon-ng -a FLEX -t raw /dev/stdin
I get this:
[email protected]:~ $ rtl_fm -f 169.65M -M fm -s 22050 -p 83 -g 30 | multimon-ng -a FLEX -t raw /dev/stdin
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: FLEX
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to 29.70 dB.
Tuner error set to 83 ppm.
Tuned to 169903575 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.
Please can you tell what is the next step/
Thank you
There is no next step after that command, you should see some output at that point. Are you sure there’s a (strong enough) FLEX signal being transmitted in your area, on that same frequency? The frequency mentioned in the blog post (169.65) is the Dutch frequency for emergency services.
Thank you for replying so promptly.
I have changed the frequency to 153.35M which is the busiest channel here.
The demodulator is set for flex, how can I change this for POCSAG512, POCSAG1200 & POCSAG2400?
Your help is very much appreciated
You’re welcome! You could try something like this for POCSAG512:
rtl_fm -f 153.35M -M fm -s 22050 -p 83 -g 30 | multimon-ng -a POCSAG512 -t raw /dev/stdin
or this for multiple standards:
rtl_fm -f 153.35M -M fm -s 22050 -p 83 -g 30 | multimon-ng -a POCSAG512 -a POCSAG1200 -a POCSAG2400 -t raw /dev/stdin
Also, for best results, remember that you need to determine the PPM deviation for your particular RTL-SDR dongle. For mine it is 83 (hence the -p 83 in the command) but for your dongle it will be a different number, probably somewhere between 0-100. You can find the PPM value by letting this command run for a few minutes:
rtl_test -p
Hello i will thank you for the info of multimon-ng , it is working but where must i put devalue -v 1 -v 2 or -v 3 in command line.