Author Topic: More adventures with software defined radio (SDR)  (Read 8437 times)

Offline Paul Bonneau

  • Member, In Wyoming
  • Administrative Staff
  • *****
  • Posts: 7,480
    • Wyoming Liberty Index
More adventures with software defined radio (SDR)
« on: February 05, 2016, 06:26:20 PM »
I just started an elaborate post and then lost it! Grrr...  >:(

Oh well, here I go again.

I started with this topic:
https://www.fswforum.org/index.php?topic=16482.0

I dug into it some more. I had tried to install all this stuff on my regular (Lubuntu) PC but it was a gigantic thing that didn't work well anyway (after I upgraded the software it stopped working). Anyway I uninstalled all that stuff and just dropped it for a while.

Then I got the bright idea of making a bootable flash drive and dedicating it to SDR. That way I won't have to mess up my normal system with all this experimental stuff. Fortunately there is a recipe out there to do just that:
http://sdrtrainingonline.com/free/
His stuff is paid training but the first 3 lessons are free, and the 2nd is the one that explains how to set it up.

The first part, installing linux on a flash drive, turned out to be the hardest because of a bug in the Ubuntu "Startup Disk Creator" tool.
https://help.ubuntu.com/community/Installation/FromUSBStick
I finally ended up going to Windows (my wife's computer) to create a linux flash drive! (lame...) The steps are to get on Windows, install something called "Linux Live USB Creator":
http://www.linuxliveusb.com/en/download
Then download the distro and use that tool to install it on a flash drive.

-- CONTINUED BELOW --
Laws turn men into slaves.

Offline Paul Bonneau

  • Member, In Wyoming
  • Administrative Staff
  • *****
  • Posts: 7,480
    • Wyoming Liberty Index
Re: More adventures with software defined radio (SDR)
« Reply #1 on: February 05, 2016, 06:26:52 PM »
The guy in lesson 2 installed Ubuntu. I installed Lubuntu because it is smaller and easier on the cpu. This is important because SDR can be very compute-intensive (you might not be happy running it on a slow machine). It also saved me the steps he had to do to get rid of "Unity" in Ubuntu.
http://distrowatch.com/table.php?distribution=lubuntu
I did not run into the problem he had, where the driver needed to be blacklisted, as lubuntu 15.10 apparently already has it blacklisted. I did run into another problem, that gqrx did not start because "pulseaudio" was missing (it's probably already in Ubuntu but not Lubuntu). I pasted the error message I got into startpage and searched to figure that out (standard debug practice). All I had to do to fix it was to "sudo apt-get install pulseaudio".

Anyway, when you are done your bootable flash drive will have gnuradio (and its gui, gnuradio-companion) that allows you to actually design a radio. Many of the apps on this page were built with it:
http://www.rtl-sdr.com/big-list-rtl-sdr-supported-software/
Those apps also give an idea all the different things you can do with SDR.

The actual interactive radio on linux is gqrx, which you can use to listen to FM stations (maybe more stuff - that's all I've done so far). The corresponding app on Windows is called sdr#.

The device I got is this one, a repurposed TV tuner:
http://www.amazon.com/NooElec-NESDR-Mini-RTL2832-Antenna/dp/B00P2UOU72
A better version is this, due to improved cooling:
http://www.amazon.com/dp/B0129EBDS2?psc=1
It is of course receive-only, but more powerful (and expensive) transmit and receive dongles like this one are available:
http://greatscottgadgets.com/hackrf/
It's best to get your feet wet with the cheapie.

There are tutorials out there to actually design radios with the gnuradio tool:
https://gnuradio.org/redmine/projects/gnuradio/wiki/Tutorials
http://greatscottgadgets.com/sdr/
This stuff is fascinating. Become a signal-processing guru!  :)

With these cheap dongles, you need some extra hardware to get into the ham bands, e.g.:
http://www.amazon.com/dp/B009LQT3G6?psc=1
Possibly not needed with the more expensive dongles, as they have broader frequency range.

In my earlier investigation I wondered about calibrating this cheapie dongle. This page has a semi-understandable procedure:
https://www.jeroennijhof.nl/wiki/index.php?title=Software-Defined_Radio_on_Ubuntu#Listening_for_a_Payload
I never did see the twin peaks as he talks about, but a single peak that I put in the middle of the audio spectrum. I ended up with a -1.575kHz offset, a lot smaller than his (I suspect I have better hardware). Or, it's possible there was nothing!
« Last Edit: February 05, 2016, 06:30:18 PM by Paul Bonneau »
Laws turn men into slaves.

Offline Paul Bonneau

  • Member, In Wyoming
  • Administrative Staff
  • *****
  • Posts: 7,480
    • Wyoming Liberty Index
Re: More adventures with software defined radio (SDR)
« Reply #2 on: February 05, 2016, 06:37:36 PM »
Ah, now I see with that last link he is talking about calibration when listening to weather baloons, heh...

An added advantage of doing this on its own flash drive is that if the computer I am using does not have the horsepower to run the signal processing, it's a simple matter to take the flash drive and use it to boot a more powerful computer.
« Last Edit: February 05, 2016, 06:49:33 PM by Paul Bonneau »
Laws turn men into slaves.

Offline Paul Bonneau

  • Member, In Wyoming
  • Administrative Staff
  • *****
  • Posts: 7,480
    • Wyoming Liberty Index
Re: More adventures with software defined radio (SDR)
« Reply #3 on: February 06, 2016, 01:41:47 PM »
Here is a very good description of the workings of gqrx. It helped me a lot!

http://gqrx.dk/doc/practical-tricks-and-tips

I used this to calibrate the dongle oscillator (mine needed 75ppm). I just tuned to an FM station that had the digital sidebands; these have very vertical sides and it is easy to use those sides to center the display with the ppm adjustment.

It also shows how to capture and display weather reports, just as one example of what you can do with SDR.

Right at the end there is a comment about the internal laptop microphone. As I suspected, this is disabled when a mic plug is plugged into the mic jack. This would be a good security measure, never mind the effect on your audio - just like putting some tape over the laptop cam.
« Last Edit: February 06, 2016, 01:47:03 PM by Paul Bonneau »
Laws turn men into slaves.

Offline SunDog

  • FSW Member, In Wyoming
  • ****
  • Posts: 241
Re: More adventures with software defined radio (SDR)
« Reply #4 on: February 13, 2016, 04:08:28 PM »
I've done this on a couple of Windows machines. I've had no problems with the RTL dongle overheating, and my graying dual core PC (ca 2006) can keep up easily. I had one older XP laptop fail to run the SDR software due to a slow, single core CPU. With the help of a PC guru at the local electronics club, I am refitting a fast laptop with Fedora, and the SDR software is one goal. First I have to re-build the laptop - I bought it used, and the heat sink was plugged up with what I can only hope was closely shaved dog hair. Before the overhaul I had both Ubuntu and Fedora running, but the overheating was driving me crazy, and I want to take the 32 GB SSD out (leaving the 500 GB hd in) since neither flavor of linux seemed to know what to do with the SSd.

Offline Paul Bonneau

  • Member, In Wyoming
  • Administrative Staff
  • *****
  • Posts: 7,480
    • Wyoming Liberty Index
Re: More adventures with software defined radio (SDR)
« Reply #5 on: February 19, 2016, 12:53:43 PM »
I moved the software to a faster (USB 3.0) flash drive. Got tired of waiting for the old one. BTW look up the "hdparm" command for testing flash drive read speeds. In case you are interested, this is the one I settled on:
https://patriotmemory.com/product/spark-usb-3-0-usb-flash-drives/
I used the 16GB version, cheap and fast.

Funny you are having problems with the SSD. I've run lubuntu on several machines and never had a problem with them (maybe yours is an early, non-standard version). I like SSD's for laptops because there will never be a head crash...

I'm using an old hand-me-down hp laptop from my wife for this.

BTW I also got a couple of Baofeng UV-5R's to play with. One of these days I will have to get a license, if the S doesn't HTF first.  :P

I tried comparing a Sony portable short wave receiver I had (that got really good amazon reviews) with the el cheapo SDR chip I bought. There was not a lot of overlap in the spectrum between the two, but there was enough to concentrate in that part common to them. The SDR blew the Sony away as to sensitivity even though the Sony has (I'm guessing) a better antenna, and the display on the computer was so much more helpful for finding signals that I imagined I was just feeling around in the dark with the Sony. The only area the Sony was better in, was fan noise (which of course only existed with the computer). When you use older, power-hungry machines with SDR, the fan is going to be running full speed a lot of the time, because a lot of processing is going on. That kinda sucks.

One other thing I did was to buy a long active USB cable, this one:
http://www.amazon.com/Sabrent-32-foot-Active-Extension-CB-USBXT/dp/B002SB7K3E/ref=sr_1_1?ie=UTF8&qid=1455910169&sr=8-1&keywords=sabrent+usb+cable+32+ft

Price is very reasonable, and the cable allowed me to put the dongle up in the attic with the antenna. The dongle was plugged directly into the cable - no need for a powered hub to run the dongle as there was enough still in the cable from the laptop. I think for the long cable runs, it makes sense to run digital data rather than analog (RF) down the cable. Put the dongle out by the antenna, not down by the laptop. Digital data either works or it doesn't; if it does there is no degradation of the information. But the drawback is that USB was never meant for over 16 feet, so you are on questionable ground when trying it. There are some versions that have ethernet in the middle with USB on both ends, and those cables can get very long, but the bad news is that I haven't found any that work like that over USB 1.1 speeds! Weird...

I used hdparm to test the reads of a flash drive through this cable, compared with no cable. Using a fast USB 2.0 flash drive and port, there was no degradation in speed. Using a fast USB 3.0 flash drive and port, there was significant degradation in speed in this long cable, but not quite so slow as to get down to 2.0 speeds (who knows about data integrity though). These SDR dongles need 2.0 speeds to work, by the way.

Anyway putting the antenna and dongle up in the attic sure helped reception. I hardly have to amplify the signal in the dongle at all, and the signal/noise ratio seems better too (the computer itself generates a lot of RF noise so it helps to get away from that). Next is to get it out on the roof somehow...

Laws turn men into slaves.

Offline Terence

  • FSW Member, Wyoming Bound
  • FSW Member, Wyoming Bound
  • ***
  • Posts: 2,045
    • McGillespie.com
Re: More adventures with software defined radio (SDR)
« Reply #6 on: February 21, 2016, 11:04:04 AM »

Thanks for the detailed reports, Paul.  Especially interesting were your discoveries
About the USB speed degradation, needing USB 2.0 speeds and the comparison
Between the conventional radio and the dongle.

 Even with the relatively small number of radio enthusiasts out there SDR will
Change the premise of the whole field. I was happy the DSP chips had already been
widely integrated into products when i purchased in 2012. That was a major step forward
And a kind of SDR hybrid implementation.

Those little baofeng's could be the most important item in someone's
bugout bag depending on the situation.
Liberty is “Stolen” by your own signature. Find the adhesion contracts and deal with them.

Offline Paul Bonneau

  • Member, In Wyoming
  • Administrative Staff
  • *****
  • Posts: 7,480
    • Wyoming Liberty Index
Re: More adventures with software defined radio (SDR)
« Reply #7 on: February 22, 2016, 08:56:02 AM »
I found this website, looks like a good outfit:
http://www.amrron.com/
They have a lot of good youtubes, here is one:
https://www.youtube.com/watch?v=qaiKdyzwc6U

I wanted to check the data integrity on the long USB cable so I put my almost the fastest USB 3.0 flash drive at the end in the attic, and ran "sudo badblocks -w -s -o usbstick.log /dev/sdz" on it. No problem at all.

I agree Terence, this adds a large increment of advance to the job of monitoring and collecting others' transmissions (perhaps to be decoded later), and just being aware of what is out there. Actually using it as a radio to transmit, I'm still wondering, not the least because you have to get into much greater expense, not to mention being a bit ungainly to set up. I am now looking at the sdrplay which is a much better receiver for $150, still no transmit. Although I suspect there is going to be significant expense any route you go, if you get serious with this stuff.
http://www.sdrplay.com/index.html
« Last Edit: February 22, 2016, 08:58:07 AM by Paul Bonneau »
Laws turn men into slaves.

Offline Terence

  • FSW Member, Wyoming Bound
  • FSW Member, Wyoming Bound
  • ***
  • Posts: 2,045
    • McGillespie.com
Re: More adventures with software defined radio (SDR)
« Reply #8 on: February 22, 2016, 10:42:23 AM »

Ammron puts out very useful information. Their emergency comms booklet
Is worth the $10 as they've taken pains to work out so many problems.

There's a post on their website, or it might be on their radio free redoubt website,
About connecting that shortwave you have to the computer and using an
open source program to decode "digital" packets. It's a nifty little bare-bones
Way to receive text broadcasts. Your dongle would increase the accuracy, no doubt.

Found it: http://www.radiofreeredoubt.com/2013/06/30/how-to-receive-digital-communications-reposted/

Liberty is “Stolen” by your own signature. Find the adhesion contracts and deal with them.

Offline Paul Bonneau

  • Member, In Wyoming
  • Administrative Staff
  • *****
  • Posts: 7,480
    • Wyoming Liberty Index
Re: More adventures with software defined radio (SDR)
« Reply #9 on: March 03, 2016, 12:03:28 PM »
Thanks for the tips Terence, I looked into that and yes it looks very useful.

OK, time for an update.

I went ahead and splurged ($150 worth) for the sdrplay device, just because of the much broader spectrum and no need for an upconverter like the cheap dongles need to get into the lower bands.

Talk about a frustrating experience, pulling together the software to build the applications! Supposedly it supports gqrx but I could not get that to work. I did finally get CubicSDR to work and am now investigating it. One downside is that this device or the software is significantly more CPU intensive so my poor old laptop CPU is running at around 50% and the temp is 90 degrees C even if I take the sample rate down to 1MHz. Fan noise is there...

Since I put this on a bootable flash drive (running lubuntu 15.10) I can move it to another computer, maybe my son's hot gaming laptop, heh. If anyone wants to try this device I can send them the flash drive image (PM me) so they can at least get CubicSDR going. Who knows how difficult other applications will be.

Eventually there should just be installable packages out there, maybe in a year or two. This is normal for newish tech I guess.
« Last Edit: March 03, 2016, 12:11:07 PM by Paul Bonneau »
Laws turn men into slaves.