RossLUG Talk: Radio on Linux

This is a copy of the talk I gave to the Rossendale Linux User Group on Monday 28th October 2013, the topic is “Radio on Linux” intending to provide an overview of some of the amateur radio and software define radio technologies I have been playing with during the summer.

Radio on Linux


Hardware required

R820T Digital TV Tuner

A very cheap digital TV tuner that was discovered to allow hackers the ability to read raw radio i/o for software processing.


  • House TV antenna is fine for VHF/UHF.
  • Long-wire antenna for low frequencies under 30MHz, 20 metres of thin wire.
  • Can get quite complicated, lots of information online
Optional and Alternatives

e4000 TV tuners

Earlier DTV tuner chip that is similarly capable as newer R820T


  • 30MHz – 6GHz (wider frequency range)
  • 20MHz sampling bandwidth
  • RX/TX (can also transmit with appropriate licensing)
  • Costs ~£200 when available

Softrock SDR kits[3]

  • DIY electronic kits for self-assembly
  • Various capabilities and prices

“Ham It Up” v1.2 Up-converter[4]

  • Open Source hardware
  • Enables access to 0-30MHz frequencies on other SDR hardware
  • Requires a “pig-tail” lead to link with SDR receiver
  • Costs ~£30

Software Set-up

Blacklist DTV module

Linux may try to load the v4l module for the TV tuner card, this will claim the hardware preventing access by the SDR driver, so we need to disable it

On Ubuntu and derivatives:

$ rmmod dvb_usb_rtl28xxu # unload module if already loaded
$ sudo echo 'blacklist dvb_usb_rtl28xxu' >> /etc/modprobe.d/blacklist.conf # add to blacklist

Install the applications


GQRX is not in Ubuntu repositories, it is also under rapid development so it’s best to compile from source. GNU Radio in Ubuntu 13.10 should be adequate, compiling from source takes a long time!



Fedora has a ham radio special interest group maintaining a lot of packages. Currently GQRX does not seem to be included.

Using the application

  • Once loaded turn it on
  • Beware that frequencies are badly calibrated
  • Zoom into the frequency band by scrolling up on the frequency axis of the top display
  • Use “SQL” to squelch out noise to stop irritating your neighbours, the noise floor changes at different frequencies so may need to be reset
  • Don’t forget to set the right modulation type
    • WFM for commercial FM (Wide-band FM)
    • NFM for ham radio and CB Radio (27MHz), thought some illegal CB is AM
    • Airband is all AM
    • LSB (Lower Sideband) for ham radio < 10MHz
    • USB (Upper Sideband) for ham radio > 10MHz
  • Learn to recognise signals by their sound and pattern on the waterfall
  • Find numbers stations like “The Buzzer” we listened to at 4625KHz

Things to see and do


Try out listening to and decoding radio signals without paying a penny. WebSDR connects remote SDR hardware to the Internet so any user can tune in (without impacting others!).

Go to

My favourites:

University of Twente –

  • Full HF frequency range available
  • Based in Netherlands – Good location to hear all of Europe

Hack Green –

  • Based in Cheshire, similar results to what can be heard locally
  • Covers main HAM radio bands

What to see and do

  • Discuss what you can hear with other listeners
  • Find interesting signals, my favourite is polytones


Used for encoding and decoding digital modes such as Morse or more recent phase-shift-keying and others.

It’s designed for sending and receiving but fine to just receive

Digital communications tend to follow a standard format, don’t expect deep conversations going on (Rag-chews – in ham terminology)

Most common digital modes are:

  • Morse code AKA “CW” or “continuous wave”
  • BPSK31 – phase shift keying, 31Hz wide, very narrow on frequency waterfall
  • RTTY – two tones but wider apart than BPSK31

Keep trying different modes until it starts outputting readable text, you’ll get an ear for what different modes sound like with experience

 Other Applications

  • GNU Radio – build simple and complex radio systems, endless possibilities
  • Sigmira – Decode NATO STANAG 4285 modem signals
  • – See how APRS is translated with Google Maps
  • Dream – Digital Radio Mondiale on shortware frequencies
  • 433MHz home automation

Useful Links

Keeping Wikipedia going

I recently answered the call for donations splashed up on Wikipedia’s pages out of respect for the fact I’ve used the site for over 10 years and gained a huge amount of value from it pages without ever before giving back more than a few edits which is my bad really. My reasoning was really that simple but I received the following email back after the payment was confirmed.

Dear David,

Thank you for donating to the Wikimedia Foundation. You are wonderful!

It’s easy to ignore our fundraising banners, and I’m really glad you didn’t. This is how Wikipedia pays its bills — people like you giving us money, so we can keep the site freely available for everyone around the world.

People tell me they donate to Wikipedia because they find it useful, and they trust it because even though it’s not perfect, they know it’s written for them. Wikipedia isn’t meant to advance somebody’s PR agenda or push a particular ideology, or to persuade you to believe something that’s not true. We aim to tell the truth, and we can do that because of you. The fact that you fund the site keeps us independent and able to deliver what you need and want from Wikipedia. Exactly as it should be.

You should know: your donation isn’t just covering your own costs. The average donor is paying for his or her own use of Wikipedia, plus the costs of hundreds of other people. Your donation keeps Wikipedia available for an ambitious kid in Bangalore who’s teaching herself computer programming. A middle-aged homemaker in Vienna who’s just been diagnosed with Parkinson’s disease. A novelist researching 1850s Britain. A 10-year-old in San Salvador who’s just discovered Carl Sagan.

On behalf of those people, and the half-billion other readers of Wikipedia and its sister sites and projects, I thank you for joining us in our effort to make the sum of all human knowledge available for everyone. Your donation makes the world a better place. Thank you.

Most people don’t know Wikipedia’s run by a non-profit. Please consider sharing this e-mail with a few of your friends to encourage them to donate too. And if you’re interested, you should try adding some new information to Wikipedia. If you see a typo or other small mistake, please fix it, and if you find something missing, please add it. There are resources here that can help you get started. Don’t worry about making a mistake: that’s normal when people first start editing and if it happens, other Wikipedians will be happy to fix it for you.

I appreciate your trust in us, and I promise you we’ll use your money well.


I thought I’d share this because it makes some important points about the wider value of Wikipedia that I hadn’t even considered when I made my donation and this might encourage others to help maintain this important resource because it belongs to all of us and it’s made a significant positive difference in the world, maybe even up there with the worldwide web itself. Just food for thought.

Surfing the shortwaves

Back in May I posted about my first tentative experiments in the world of radio. Since that first post I’ve made slow but steady progress spending time learning a lot about different frequency allocations, modulation types, antenna designs and so on but being careful not to get too carried away as I’m prone to do!

Switching Back to Linux

Initially I was using an application called SDR# or “SDR Sharp” to tune my RTL-SDR receiver. SDR# is a .net framework application for Windows but not being a Windows user I followed some instructions to get it working on Linux using the Mono framework. This worked but I found the performance nowhere near as good as on Windows so I began looking for alternatives.

I found another application for Linux called Gqrx which performs the same function as SDR# but is pure Linux. It is essentially a front-end for the GNU Radio suite which is a huge collection of tools for building software radios using modular components. Gqrx itself is written in QT but has no KDE dependencies so it is simple to set-up on my Mint 15 Cinnamon installation, to do so I followed these instructions to compile the latest development version of GNU Radio and Gqrx from source that have support for the r820t dongle I have, the current Ubuntu/Mint repositories contain an older version of GNURadio which does not have support for the r820t but should work with older e4000 TV tuners.

While Gqrx is a simpler application than SDR# it works well and it’s fast. It can tune quickly and easily like SDR# and can demodulate all the usual AM, FM, upper/lower sideband (SSB) and CW signals. I haven’t worked out if it can zoom into the Gqrx can zoom into the frequency band like SDR#, but it isn’t as intuitive or flexible, this feature is useful for identifying narrow bandwidth signals and distinguishing modulation types.

Going down-frequency

Happy in Linux I spent my early days listening to the local 70cm band repeaters and occasionally I’d discover nearby transmissions on the 2 metre band by hams or walkie talkie users on PMR446 at 446MHz. I could never hear anything on the 10 metre band at ~28Mhz but got a lot of noise from commercial transmissions, I found out I was setting my antenna gain too high and lowering it reduced a lot of the interference but I still get “ghost” FM signals around 26MHz which I believe might be resonance from transmissions in the main FM radio bands because I have direct line-of-sight from the local transmitter only a few miles away across the valley so they are probably a little too strong and bleed across the radio spectrum.


I was initially using my home’s spare TV antenna which is a common “Yagi” type which are designed to be directional, they focus their reception power wherever they are pointed but are not very good hearing anything behind them, so I made my first investment upgrade and bought a scanning antenna that is omni-directional and easy to move about to get a good signal.

While this has all been very fun there was never a lot of activity going on and in my research I kept hearing about all the fun hams were having on the HF bands which I didn’t have access to. The RTL-SDR dongle can received frequencies from 25MHz up to 1.8GHz but there’s a lot of activity below 25MHz where signals travel much further distances so people communicate across the world, I felt the need to investigate this!


To get my RTL-SDR “shack” tuning into these lower frequencies I needed an upconverter. This is a device that mixes a signal to shift it up the frequency spectrum so it can be handle more easily by the receiver. I made my 2nd investment upgrade and bought a “Ham it up” v1.2 upconverter from NooElec in the United States and it’s a thing of beauty!


The upconverter is open source hardware, the designs are available online to fabricate yourself which is interesting but way above my head. There’s an RF input on one side for the antenna, IF output on the other side to go to the receiver, power is supplied via a USB A-to-B cable from your computer and a switch is there to activate the upconversion or simply pass-though the signal untouched without needing to disconnect it when not in use.

This model uses a 125MHz clocking chip which is replaceable, with this any signal that comes in is shifted up 125MHz on the receiver. This isn’t 100% accurate and some fine tuning is required using a known frequency, I use Absolute Radio’s 1215KHz signal to adjust the offset, on my hardware is this 124.99000MHz which doesn’t seem like much but 10KHz s the difference between finding a signal or not when the signal bandwidth is very narrow. Gqrx and SDR# both have the ability to offset the frequency reading so they show only the RF frequency on the air not the IF frequency that the dongle is receiving which is 124.99MHz higher.

Update – 25th January 2015

My earlier problems with the offset were due to inaccurate frequency reporting by the RTL dongle and not the crystal which was very accurate.

First, you also need to set a frequency correction value, this is unique to each RTL dongle so to find your value see this later post on the topic. This value is entered in the ‘Freq. Correction’ box in the ‘Input Controls’ side panel.

Next, set the offset, still in ‘Input Controls’ edit the value “LNB LO”. For a 125MHz shift set the value to “-125.000000”, note this is a negative value because your tuning frequency is shifted down. If your upconverter is using a different crystal set the value as appropriate. Once done re-tune to your desired frequency and you’re all set.

Yet more antennas!

But let’s not forget the antenna! My house Yagi and scanning antenna both work only on VHF/UHF bands so are not sensitive to the relatively low frequencies of HF, for this I needed a new antenna, so I built one! I chose a simple design, a random longwire antenna, for which I borrowed 20 metres of steel garden wire, removed the insulation from one end and jammed it in the RF input on the upconverter, and it works!


Tuning In

True to my expectations I’ve discovered a lot of activity on HF, I can hear the normal AM commercial broadcasts on Longwave and Mediumwave, I can also hear a lot of world radio stations on various Shortwave bands. Shortwave radio is unfortunately in decline but there are still a lot of stations to be heard, I have not had this set up long but already I have heard broadcasts as far as Beijing and Botswana  over 5,500 miles away!

What is this strange place?

Being nearly 30 I am still too young to have experienced Shortwave’s peak, I didn’t know much about it before this experience but I’ve found it rather interesting in my unashamedly nerdish way. Compared with normal commercial AM, FM and DAB stations, Shortwave is bizarre. Because signals travel internationally transmissions are only part-time and sometimes overlap on certain frequencies. Tuning into shortwave is also a mixed bag, every time you turn on the radio you get something different, not just because of the intermittent broadcasting schedules but also because of variable propagation conditions. Signals travel different distances depending on the time of the day or the season of the year and the influence of these factors varies depending on which shortwave band you’re listening to, so your listening experience can be very random!

Most Shortwave listeners are either international travellers or people who follow a hobby called ‘Shortwave listening’. They aim to optimise conditions for listening to as many stations as possible as far away as possible. If you can hear them some stations ask you to write in and report where in the world you heard them from known as a QSL report, I heard one station already reading out the QSL reports they had received from listeners and they were certainly a far-flung group!

Many broadcasters are national institutions such as the BBC putting across their Government’s view of world events to foreigners. This is clearly used as a propaganda tool and so it’s sometimes jammed by oppressive states to block out the signals, North Korea are apparently famed for this unsurprisingly. Religious organisations also use it to preach their message, pirate radio stations are set up by revolutionaries and militaries broadcast warnings to whole continents or just to their agents in code.

Next time…

The BBC world service have been reining in their Shortwave broadcasts as they are expensive to operate and there’s a lot of ways to receive the BBC in most places in the world today however they have begun to transmit on Shortwave in digital format using Digital Radio Mondiale (DRM). This is similar to DAB used on VHF radio but designed for shortwave, this seeks to address low quality audio you frequently receive on shortwave bands so it can become a viable alternative to FM/AM while retaining its very wide coverage benefits.

However DRM seems be in the catch-22 situation that DAB had for a long time, there’s few broadcasters because there’s few listeners, there’s few listeners because there’s few radios, there’s few radios because there’s few listeners and broadcasters. Mind you the DAB radio in my kitchen tunes into DAB stations daily so it’s not impossible to break the cycle, it’ll just take time and effort to get there. Why do I mention this? Because there is a software DRM decoder called Dream that I can add to my RTL-SDR shack to listen into the growing number of DRM stations but that’s an experiment for another day!

PRISM update

One of my greatest concerns around the PRISM scandal was that it would fall foul of our society’s short attention span and disappear when the next news cycle came around but much to my relief and frankly, to my surprise, it didn’t, in fact it even survived the Royal baby cluttering up the news-wire which gave me warm feelings about the health of our culture today.

I’ve been wanting to update this blog over the last few weeks but unfortunately I’ve simply been too busy with work and studies but I have been able to keep up with a lot of PRISM news updates that have been steadily coming out.

Most interesting have been some of the discussions on the twit network, particularly IT security expert Steve Gibson’s ideas on what PRISM actually is and how it works; he makes a very convincing argument that it is essentially a wire-tap on the major Internet companies via their Internet providers, which explains why they can plausibly deny all knowledge but also suggests why the name “PRISM” was used. Unlike wire tapping a phone line in a house, wire tapping a high-speed Internet connection is complicated by the fact they are optical fibers so the fiber needs to be split to siphon off some of the light but not all of it so that Google et al still receive a signal but one that is slightly dimmed by the tap, and of course splitting light is essentially what a prism does!

Although I’ve seen some paranoia that the whole Internet is being tapped I still maintain that this is still infeasible although any traffic that passes to or from the major web sites on the Internet are likely to be monitored in this way which reinforces my earlier proposal that the solution is to diversify our online activities using smaller federated networks as this would make it more difficult to capture all of the traffic using this form of surveillance.

Some of the more disturbing news to come out of all this was surrounding Microsoft’s enthusiastic complicity with Government snoops by installing back doors in their major online services that agencies could use to gain access to their user’s data. Skype was one of the services mentioned which I find interesting because I had suspected this was the case before PRISM after I saw news articles showing Microsoft had introduced changes that basically enabled wire tapping on Skype shortly after their acquisition. Before this Skype had always been designed as a peer-to-peer network that would make it very strong against surveillance. When I first heard this news I ceased using Skype and took up open alternatives such as SIP or Mumble.

Microsoft’s behaviour highlights one of the key arguments against closed source proprietary software. When you can’t see the source code, you can’t be sure what the software actually does so you need to trust the creator of the software that it only does what they say it does. After all this though, can you trust Microsoft any more? I certainly couldn’t but then I never did. Going open source doesn’t just give you control, it’s the only safe way to ensure your software is not working against you and violating your privacy. Fortunately I’m already very embedded in the open source software world, I know the transition is not easy when you have to replace familiar applications with open source alternatives but it’s easier today than ever, there is a wide range of very high quality open source software, a new website provides a list of good alternatives to anyone looking to make the switch.

Although I use Linux and open source almost all the time, I’d like to consider myself pragmatic about it. Use open source when you can, certainly try it and if it’s evens between an open source and closed source product in terms of quality, opt for the open source one on the basis that you can trust it but know when you have proprietary software you have no control over it and you certainly can’t trust it any more than the creator which if the creator is Microsoft then that is “not at all”.

So what have I done in response to all this? A few things but as I said before my time has been limited. I’ll provide a brief run down which may provide you with some inspiration.

I took my email archive offline

I downloaded my messages onto my computer and now only recent email is kept online for which I don’t use a major email provider. My email archive contains messages going back to 2004, I don’t read them often so there’s no need for immediate access. I’ll now periodically download my mailbox into the archive so only a small amount of recent email is at risk of online surveillance.

I stopped using Gtalk/Google Hangouts

I did use Gtalk for chat, and MSN before that, and ICQ before that. All of these are closed proprietary chat networks but now I use XMPP for online chat which is an open, federate network. I run my own XMPP server although there are many more online, I intend to write more about this again soon. I also use IRC which is the granddaddy of chat protocols, it’s also open and there are many networks and applications.

I joined the Open Rights Group

Technological solutions are one thing but politics is also very important. John Oliver hit the nail right on the head on his first episode of the Daily Show as he stood in for John Stewart over the summer, the fact that this is legal is very disturbing and something has gone very wrong in Government to allow this.

The Open Rights Group are a UK political lobbying group who campaign for our rights online doing similar work to the Electronic Frontier Foundation in the US. The ORG are a young organisation but have had a strong start and perform a vital role in lobbying our Government. I support their cause wholeheartedly and from this month pay them £5/month to voice my concerns to the people who can effect change in parliament. This is a tiny amount but so important I encourage you to consider supporting them too.

It’s important though that this doesn’t end yet, there’s a lot of people very angry about all this and will keep it going until we secure the rights past generations had with the postal service and phone networks in the modern online world. It is critical so the Internet can continue to be the promoter of democracy it has been in the past decade, it’s important and we need to fight to keep it that way.

Growing the root filesystem on Arch Linux ARM for the Raspberry Pi

Changes to the partition layout in the July 2013 image invalidate the information in this post, please see the comment section for details.

I run Arch Linux on my Raspberry Pi, this defaults to creating a 2GB partition for it’s data which I needed to extend to access the remaining space on my 16GB SD card. I’ll explain how I did this below but only do this on a newly installed Arch installation so if anything goes wrong you do not lose any data.

To start I’m assuming you’ve installed Arch on your SD card, if you haven’t follow this guide to show you how.

Boot Arch on your Raspberry Pi, log in as root on the console or via SSH, either way works fine. To start we will remove the partition containing Arch and replace it with another partition starting in the same location but ending at the end of the SD Card, this will vary depending on the size of the card you have.

[root@alarmpi ~]# fdisk /dev/mmcblk0

In fdisk,

  1. Press ‘p’ to print the partition table, take note of the number in the Start column of the row starting ‘/dev/mmcblk0p2’
  2. Press ‘d’ to delete a partition then enter ‘2’ to choose the second partition
  3. Press ‘n’ to create a new partition, all the default options are fine:
  • Choose ‘primary’ partition type
  • Partition number 2
  • The starting block should be same number you took note of in step 1
  • The default ending block should be the last available block on the SD card, this will vary depending on what size SD card you have

4. Press ‘w’ to write the new partition table and return to the bash prompt

Reboot now to force the kernel to recognise the new partition table.

[root@alarmpi ~]# reboot

After reboot we now we have the same two partitions we started with except that the second partition containing the root filesystem is now larger. However, the root filesystem is still only 2GB so we now need to resize the filesystem in order to fill the partition.

[root@alarmpi ~]# resize2fs /dev/mmcblk0p2

And there you go, you can now run ‘df -h’ to view your new partition sizes! Here’s mine…

[root@alarmpi ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  457M   14G   4% /
devtmpfs         51M     0   51M   0% /dev
tmpfs           105M     0  105M   0% /dev/shm
tmpfs           105M  260K  105M   1% /run
tmpfs           105M     0  105M   0% /sys/fs/cgroup
tmpfs           105M     0  105M   0% /tmp
/dev/mmcblk0p1   90M   24M   67M  27% /boot

PRISM round-up

Other commentary

What to do about PRISM?

It really should come as no surprise. For years the Internet has been consolidating so that billions of people now concentrate their online life onto a few “free” networks controlled by major US corporations, and now we find that Governments have been actively exploiting this in a mass domestic surveillance spying programme. The unfortunate truth is that this was just waiting to happen since it became apparent that too many people are putting too much of their private lives in the hands of too few companies. Companies whose interests, like any business, are towards serving their shareholders, their Governmental masters and their customers, who are not their non-paying users. So what can we do about this?

“When you are not paying for something, you are not the customer, you are the product.” – Internet Proverb


The Internet is big, there are many alternatives out there, they might be less convenient but by simply spreading out your online activity you are gaining a lot of your privacy back. Put your events, calendars, documents, photos, emails, instant messaging and status updates in several different places so that gathering them all together would require a much larger programme than we understand PRISM to be. Reinforce this by using smaller, independent web services that are less likely to get tapped, make the economies of scale work in your favour.


Decentralising does lose some of the benefits of integrated online applications, however that doesn’t need to be the case. Federation is the concept of using common standards to allow services to exchange data across the internet. It breaks down silos and enables a more diverse Internet that is more resilient against Government oppression and failure of individual online service providers. Email is the prime example, you can send an email to anyone using many different applications, operated by anyone and it works! Instant messaging is federated too using XMPP, Google federated Gtalk and Wave using it but now they are pushing their users onto their Hangouts service that is a walled garden as just more damning evidence of their falling interests in an free and open Internet.

Be demanding

Don’t blindly accept services which don’t support your freedom and privacy. Demand the ability to export your own data; demand the ability to communicate outside of their networks; demand open source so their software has no hidden surprises. If they don’t meet these demands, don’t use them and keep looking, there will be another one out there.

I’m not claiming to be perfect, but join me in retaking our privacy, I know what I’ll be doing and I’ll update this blog to explain how I’m doing it.

Toe-dipping into Radio

As a perfectly contented computer geek, I have always been aware of the world of amateur radio but I had too much going on in the IT world to really pay it much notice. Of course the Internet is the place where worlds collide and at some point a couple of weeks ago I found myself reading about a project called RTL-SDR, which meant nothing to me so as always when that happens I did a little digging to understand more about it.

That was the subtle start of my fall into the rabbit hole of Amateur Radio and I’m not sure if I’ll be coming back…

Continue reading “Toe-dipping into Radio”

Banksy Quote

People are taking the piss out of you everyday. They butt into your life, take a cheap shot at you and then disappear. They leer at you from tall buildings and make you feel small. They make flippant comments from buses that imply you’re not sexy enough and that all the fun is happening somewhere else. They are on TV making your girlfriend feel inadequate. They have access to the most sophisticated technology the world has ever seen and they bully you with it. They are The Advertisers and they are laughing at you. You, however, are forbidden to touch them. Trademarks, intellectual property rights and copyright law mean advertisers can say what they like wherever they like with total impunity. Fuck that. Any advert in a public space that gives you no choice whether you see it or not is yours. It’s yours to take, re-arrange and re-use. You can do whatever you like with it. Asking for permission is like asking to keep a rock someone just threw at your head. You owe the companies nothing. Less than nothing, you especially don’t owe them any courtesy. They owe you. They have re-arranged the world to put themselves in front of you. They never asked for your permission, don’t even start asking for theirs.

– Banksy