DVB-S2 transmission and reception with SDR

Last updated: May 31, 2019

The DVB-S2 standard for digital satellite video broadcast is extremely well engineered. You would be hard pressed to find a more refined standard to exchange lots of data with minimal errors. With many good features like multiple modulation modes and multiple code rates (using the very powerful LDPC type of FEC code) the standard is quite a beast. Since it has been implemented and used by open-source and amateur radio communities, it is possible to transmit video to yourself using software defined radios. How cool is that?

What you need:

I’m sure it can work on other versions, but at least this establishes one case. The forum post for markro92’s software is here:

and the actual software is here:

http://v.1337team.tk/dvb-s_gui_amsat.zip

Just unzip the folder and run it. Easy! ( I first used SDR# to listen to FM radio, and I also viewed the DVB-S2 signal on the waterfall. This probably set up the windows driver for RTLSDR)

Getting GNU radio working is often less easy, but just try apt install gnuradio. I’ll assume it’s working for you, it’s really a separate issue. Getting the PLUTO SDR drivers is also a separate issue, and the guide on the wiki worked for me. With the basic elements ready, lets set up GNU radio. Use your expert Google-fu to get your PLUTO able to receive and transmit.

In GNU radio just navigate to the examples folder typically found in /usr/share/gnuradio/examples/. In the dtv folder there is an example flow graph called dvbs2_tx.grc. Copy that file to your project folder and open it.

Delete the sinks and place a PLUTO SDR sink instead. Next we’ll have to change all the settings to something the Demodulator can handle. I used a code rate of 1/4 with QPSK modulation and a rolloff factor of 0.2. Make sure to check your filter taps on the FFT block. I used 96 taps.

firdes.root_raised_cosine(1.0, samp_rate, samp_rate/2, rolloff, taps)

On my SDR sink I put the LO at 917 MHz so that I’m in an ISM band, and set the attenuation to 13 dB to keep it quiet. Viewing the spectrum through SDR# I didn’t see any other activity, just to be sure. Keep in mind the PLUTO has a minimum sample rate, so if you want to use a low symbol rate you will have to change the overall sample rate of the flow graph. I used 1000k sps, making the sample rate 2M. Later I will be interested to see how I can narrow the bandwidth of the signal.

That should do it for the flow graph, except we need to point the file source to a transport stream to transmit. We need to build a transport stream file that matches the settings of the flow graph, and to do that we use ffmpeg. For this test I simply used a single frame, a jpeg picture. ffmpeg can convert to .mp4 with

ffpeg -framerate 25 -i picname.jpeg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4

and convert .mp4 to .ts with

ffmpeg -i output.mp4 -c:v copy -c:a copy -muxrate 478577 -f mpegts test1.ts

This muxrate is for the settings specified in the flow graph. You can get other transfer rates for different symbol rates using dtv-utils. Make sure your PLUTO sdr had adequate power and a stable USB connection, and start transmitting through the flow graph. You should be able to see the waterfall display on SDR# or the dvbs demodulator.

Set up VLC to receive a network stream from udp://@:8888.

It can take quite some time to get a carrier lock, so keep messing with the base band gain setting until you just barely see white on the waterfall. Sometimes during lock the symbol rate deviates from your setting, so I just toggle to 1001 and back to flush it.

I was only transmitting with the antennas that come with the SDR kits at about 2 feet distance. Next up there are many practical considerations before this is actually useful. But it was extremely cool to transmit a picture over the air with the use of GNU radio.

Setting up GNU Radio

Open source software can be a pain. To get the dependencies for compiling gnu radio, start with the list provided by Ettus Research.

For Ubuntu Bionic (18.04) it’s:

sudo apt-get -y install git swig cmake doxygen build-essential libboost-all-dev libtool libusb-1.0-0 libusb-1.0-0-dev libudev-dev libncurses5-dev libfftw3-bin libfftw3-dev libfftw3-doc libcppunit-1.14-0 libcppunit-dev libcppunit-doc ncurses-bin cpufrequtils python-numpy python-numpy-doc python-numpy-dbg python-scipy python-docutils qt4-bin-dbg qt4-default qt4-doc libqt4-dev libqt4-dev-bin python-qt4 python-qt4-dbg python-qt4-dev python-qt4-doc python-qt4-doc libqwt6abi1 libfftw3-bin libfftw3-dev libfftw3-doc ncurses-bin libncurses5 libncurses5-dev libncurses5-dbg libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk3.0 git libqt4-dev python-numpy ccache python-opengl libgsl-dev python-cheetah python-mako python-lxml doxygen qt4-default qt4-dev-tools libusb-1.0-0-dev libqwtplot3d-qt5-dev pyqt4-dev-tools python-qwt5-qt4 cmake git wget libxi-dev gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2 libzmq3-dev libzmq5 python-requests python-sphinx libcomedi-dev python-zmq libqwt-dev libqwt6abi1 python-six libgps-dev libgps23 gpsd gpsd-clients python-gps python-setuptools

After that, I’m working on a bash script to automatically walk through the compile process. I was collecting dependencies, but later found the list above. So the compilation part looks like…

git clone https://github.com/nickhansenrf/gnuradio.git
cd ./gnuradio/
echo downloading volk
echo …
echo …
git clone https://github.com/gnuradio/volk.git
cd ./volk/
mkdir ./build
cd ./build/
echo configuring volk
cmake ../
echo compiling volk
make
make test
make install
ldconfig
cd ..
cd ..
mkdir ./build
cd ./build
echo configuring gr
cmake ../

Which is pretty much just taking my fork of the repo and compiling it. One thing is the VOLK repo is not my own fork, so I may want to change that.

Note: The official way is PYBOMBS which I should have tried first. Maintaining scripts like this is what PYBOMBS is for.

Starting HFSS

In our lab, we use a Red Hat 6 running HFSS 19 to do some antenna simulations. Getting this thing to work can be difficult, especially for non linux people (most people). In the future hopefully they just put windows on this machine, it’s a Xeos with lots of power so the hardware is worth keeping around.

Anyway, from May until this November when the license expires, to get HFSS running you have to restart the license server first. In HFSS 19 this is a session that connects to the server through your browser. To trigger this, use in bash:

cd /

cd ./ansys_inc/shared_files/licensing/

(use su or sudo) ./start_lmcenter

At this point it will do something and get stuck… so use control+c to kill that process and try to start the license manager center again. This time it should open firefox and you can press start. If you have internet connection, it should be running.

Next you might want to set up VNC server. On this machine it’s

vncserver :8 -name nick -geometry 1440×900

where you can change the desktop number, name, and geometry variables.

to get in, connect a vnc client to

129.xxx.xx.xxx:8

or whatever your desktop number is. You might be prompted for the password.

purging raspian

linux is great but how do you manage what’s installed?

use:

sudo aptget remove –purge PROGRAMHERE

remember that bash supports wild card with *, so you can install the entire libreoffice with

sudo apt-get remove –purge libreoffice*

You can also use

sudo apt-get clean

sudo apt-get autoremove

to get rid of any temporary stuff

Connect a raspberry pi to university enterprise network

Sometimes you just need to connect your linux mini computer to enterprise wifi. Unfortunately the GUI that comes with raspian OS can’t do it, so you need to take matters into your own hands.

It’s easy. Open a terminal and use the following commands to get to the wpa_supplicant.conf file.

  • ls (this will list the contents of your current directory)
  • cd / (this will take you to the top level directory)
  • cd ./next_directory (this will take you down into the next directory. Use tab autocompletion to look really smart! thanks bash)
  • sudo nano file_name (this will open the file in the text editor)

Now, add the following block at the bottom of wpa_supplicant.conf. No need to delete anything, just add this text!

network={

ssid=”Dal-WPA2″

key_mgmt=WPA-EAP

eap=PEAP

identity=”username”

password=”password”

}

All done! This works for Dalhousie University with a raspberry pi.