{"id":581,"date":"2012-08-28T00:30:32","date_gmt":"2012-08-27T22:30:32","guid":{"rendered":"http:\/\/blog.ulrichard.ch\/?p=581"},"modified":"2012-08-28T00:30:32","modified_gmt":"2012-08-27T22:30:32","slug":"software-defined-radio-on-the-cheap-with-a-dvb-stick","status":"publish","type":"post","link":"https:\/\/ulrichard.ch\/blog\/?p=581","title":{"rendered":"software defined radio on the cheap with a DVB stick"},"content":{"rendered":"<p>I think I first learned about software defined radio a few years ago on the <a href=\"http:\/\/chaosradio.ccc.de\/\" target=\"_blank\" rel=\"noopener\">chaosradio podcast<\/a>. I was totally excited about the idea, and immediately installed <a href=\"http:\/\/gnuradio.org\" target=\"_blank\" rel=\"noopener\">gnuradio<\/a> not only on my computers, but at times also on the smartphone. The <a href=\"http:\/\/gnuradio.org\/redmine\/projects\/gnuradio\/wiki\/USRP\" target=\"_blank\" rel=\"noopener\">USRP<\/a> has been on my wishlist ever since. That&#8217;s the hardware device most commonly used with gnuradio. The downside was the price tag. While the approx $ 1&#8217;000 are not much compared to commercial solutions, it was too much for just another project to toy around, and I didn&#8217;t have an idea for a project where I must have one so far.<\/p>\n<p>Then in last February (2012), I read on a blog post that was probably linked from <a href=\"http:\/\/news.ycombinator.com\/\" target=\"_blank\" rel=\"noopener\">hacker news<\/a> that somebody found out that a <a href=\"http:\/\/sdr.osmocom.org\/trac\/wiki\/rtl-sdr\" target=\"_blank\" rel=\"noopener\">cheap DVB tuner USB stick could be used as an SDR receiver<\/a>. That was exactly what I&#8217;ve been waiting for the past few years, except that a device with TX would be even cooler. Immediately I went to the local electronics shops with a <a href=\"http:\/\/www.reddit.com\/r\/RTLSDR\/comments\/s6ddo\/rtlsdr_compatibility_list_v2_work_in_progress\/\" target=\"_blank\" rel=\"noopener\">compatibility list<\/a>. But in most shops they had no clue, and they couldn&#8217;t even find out what chipset was in the devices they sold. In a more professional shop they tried to find out the chipset, and they had a device that looked very similar to one on the compatibility list. But it didn&#8217;t work. So, I ordered one directly from china. It took almost two months to get here, but then it took another two month before I really started experimenting with it beyond checking if I could sample something to the harddisk. <a href=\"http:\/\/www.ab9il.net\/software-defined-radio\/rtl2832-sdr.html\" target=\"_blank\" rel=\"noopener\">Here<\/a> is some background information.<!--more--><\/p>\n<p>I had gnuradio installed on my computers for some years without ever really using it. And just now when I was going to need it, it was removed from the debian and ubuntu repositories. They say the packaged version was outdated, and for this stuff, a recent version is required anyway. I was lucky, and found a ppa on launchpad with gnuradio as well as <a href=\"http:\/\/sdr.osmocom.org\/trac\/wiki\/rtl-sdr\">rtl-sdr<\/a> packaged.<\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\">add-apt-repository ppa:roman-moravcik\/gnuradio\napt-get update\napt-get install gnuradio librtlsdr-dev libgnuradio-baz-dev libosmosdr-dev libgnuradio-osmosdr-dev<\/pre>\n<p>So I could test the capabilities of my device:<\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\">$ rtl_test -t\nFound 1 device(s):\n  0:  ezcap USB 2.0 DVB-T\/DAB\/FM dongle\n\nUsing device 0: ezcap USB 2.0 DVB-T\/DAB\/FM dongle\nFound Elonics E4000 tuner\nSupported gain values (18): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0 43.0 45.0 47.0 49.0\nBenchmarking E4000 PLL...\n[E4K] PLL not locked for 51000000 Hz!\n[E4K] PLL not locked for 2182000000 Hz!\n[E4K] PLL not locked for 1091000000 Hz!\n[E4K] PLL not locked for 1265000000 Hz!\nE4K range: 52 to 2181 MHz\nE4K L-band gap: 1091 to 1265 MHz<\/pre>\n<p>Now, I tried to replicate a flow graph that I saw somewhere in the <a href=\"http:\/\/gnuradio.org\/redmine\/projects\/gnuradio\/wiki\/GNURadioCompanion\" target=\"_blank\" rel=\"noopener\">GnuRadioCompanion<\/a>. That&#8217;s actually a really cool application. I reminded me a bit about <a href=\"http:\/\/s2i.das.ufsc.br\/harpia\/en\/home.html\" target=\"_blank\" rel=\"noopener\">harpia<\/a>, in that you can connect some building blocks in a gui, and from that it generates a python script. Although, the flow graph looked the same, I kept getting errors when trying to execute: <img decoding=\"async\" src=\"https:\/\/ulrichard.ch\/piwigo\/upload\/2015\/11\/10\/20151110000207-69d95fe1.png\" alt=\"\" \/><\/p>\n<pre class=\"brush: bash; gutter: false; first-line: 1\">Showing: \"\/home\/richi\/sourcecode\/sdr_dvb_experiments\/sdr.grc\"\n\nGenerating: \"\/home\/richi\/sourcecode\/sdr_dvb_experiments\/top_block.py\"\n&gt;&gt;&gt; Warning: This flow graph may not have flow control: no audio or usrp blocks found. Add a Misc-&gt;Throttle block to your flow graph to avoid CPU congestion.\n\nGenerating: \"\/home\/richi\/sourcecode\/sdr_dvb_experiments\/top_block.py\"\n&gt;&gt;&gt; Warning: This flow graph may not have flow control: no audio or usrp blocks found. Add a Misc-&gt;Throttle block to your flow graph to avoid CPU congestion.\n\nExecuting: \"\/home\/richi\/sourcecode\/sdr_dvb_experiments\/top_block.py\"\n\nTraceback (most recent call last):\n  File \"\/home\/richi\/sourcecode\/sdr_dvb_experiments\/top_block.py\", line 194, in &lt;module&gt;\n    tb = top_block()\n  File \"\/home\/richi\/sourcecode\/sdr_dvb_experiments\/top_block.py\", line 49, in __init__\n    proportion=0,\n  File \"\/usr\/lib\/python2.7\/dist-packages\/gnuradio\/wxgui\/forms\/forms.py\", line 234, in __init__\n    self._add_widget(self._text_box, label)\n  File \"\/usr\/lib\/python2.7\/dist-packages\/gnuradio\/wxgui\/forms\/forms.py\", line 113, in _add_widget\n    update(self[INT_KEY])\n  File \"\/usr\/lib\/python2.7\/dist-packages\/gnuradio\/wxgui\/forms\/forms.py\", line 101, in &lt;lambda&gt;\n    update = lambda x: wx.PostEvent(widget, DataEvent(x))\n  File \"\/usr\/lib\/python2.7\/dist-packages\/gnuradio\/wxgui\/forms\/forms.py\", line 53, in __init__\n    wx.PyEvent.__init__(self, wx.NewId(), EVT_DATA.typeId)\nAttributeError: 'PyEventBinder' object has no attribute 'typeId'<\/pre>\n<p>Hmmm, strange. Let&#8217;s wait for an updated version of those experimental packages&#8230;<\/p>\n<p>In the meantime, I found out about <a href=\"http:\/\/sdrsharp.com\">sdrsharp<\/a> and <a href=\"http:\/\/rtlsdr.org\/softwarelinux\">how to get it to run<\/a>. Well, I don&#8217;t particularly like .net stuff, and with the instructions I have an application sitting in some random location with some arbitrary configuration. But at least it works, at least the nightly build.\u00c2\u00a0 It is pretty buggy, and it&#8217;s not the fancy decoding of whatever protocol you like that&#8217;s so cool about gnuradio, but it&#8217;s a nice visualization. But somehow I have the impression there should be more to see at 88MHz FM since a local radio station transmits at that frequency.<br \/>\n<a href=\"https:\/\/ulrichard.ch\/piwigo\/picture.php?\/1626\/category\/50\"><img decoding=\"async\" src=\"https:\/\/ulrichard.ch\/piwigo\/_data\/i\/upload\/2015\/11\/09\/20151109235910-f2f9f190-th.png\" alt=\"\" \/><\/a><\/p>\n<p>There&#8217;s another visualization app in the makes: <a href=\"http:\/\/www.oz9aec.net\/index.php\/gnu-radio\/gqrx-sdr\">GqRx<\/a><\/p>\n<p>Last time I tries I couldn&#8217;t get it to work, but from what I understand, the support for the DVB sticks was added only recently. And this one is based on gnuradio and Qt. On top of that, it will probably appear packaged sometime soon. So, definitely something to look forward to&#8230;<\/p>\n<h4>Update 15.09.2012<\/h4>\n<p>I found out that the GnuRadioCompanion works on my netbook which as well as my Workstation runs Ubuntu 12.04, although only 32bit. In a recent <a href=\"http:\/\/www.drdobbs.com\/embedded-systems\/radio-active\/240006820?queryText=sdr%2Bdvb\" target=\"_blank\" rel=\"noopener\">drdobs rticle<\/a> I found a grc file that works well. Although the netbooks has barely enough performance.<\/p>\n<h4>Update 28.10.2012<\/h4>\n<p>After the upgrade to Ubuntu 12.10 quantal, everything works fine on my workstation as well. And this machine is powerful enough to smoothly run gnuradio. I can now listen to FM radio using the blocks from the Dr Dobbs article.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think I first learned about software defined radio a few years ago on the chaosradio podcast. I was totally excited about the idea, and immediately installed gnuradio not only on my computers, but at times also on the smartphone. The USRP has been on my wishlist ever since. That&#8217;s the hardware device most commonly [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7,1],"tags":[97,195,249],"class_list":["post-581","post","type-post","status-publish","format-standard","hentry","category-projects","category-software","category-uncategorized","tag-gnuradio","tag-sdr","tag-wireless"],"_links":{"self":[{"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=581"}],"version-history":[{"count":0,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=\/wp\/v2\/posts\/581\/revisions"}],"wp:attachment":[{"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ulrichard.ch\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}