{"id":104,"date":"2016-04-09T20:23:52","date_gmt":"2016-04-09T18:23:52","guid":{"rendered":"https:\/\/einstein.amsterdam\/blog\/?page_id=104"},"modified":"2016-04-09T20:23:52","modified_gmt":"2016-04-09T18:23:52","slug":"how-to-start","status":"publish","type":"page","link":"https:\/\/einstein.amsterdam\/?page_id=104","title":{"rendered":"Part 1 : How to start"},"content":{"rendered":"<p><span id=\"Installing_rtl-sdr\" class=\"mw-headline\">Installing rtl-sdr<\/span><br \/>\nYou have probably heard about the cheap little USB Dongles made to receive digital Television and \/ or radio. They come in many shapes and forms (and prices) but you can find some cheap ones around the net. You can score one for around 10 \u20ac easy on ebay.<\/p>\n<p>The heart of the system is build on the RTL2832U Chipset or the RTL2838 (Many devices with EEPROM have 0x2838 as PID and RTL2838 as product name, but in fact all of them have an RTL2832U inside. Realtek never released a chip marked as RTL2838 so far (source) ) and comes with a variety of tuners. The two most common (and wanted) tuners are\u00a0:<\/p>\n<p>E4000 \u2013 53 Mhz \u2013 2217 Mhz (with a gap in 1109 to 1251 Mhz) These tuners are the most desirable to have, though the company providing this tuner (Elonics IP) seems to be sold. The future of this tuner is unsure. My Terratec Tstick, for example, has this tuner.<\/p>\n<p>R820T \u2013 Rafael Micro R820T \u2013 According to rtlsdr.org this tuner is a worthy follow up with comparable performance and cheaper in production.<\/p>\n<p>I have both variants. And I will connect them both to my freshly new Rasperry PI with Raspian and see what we are running up to\u00a0\ud83d\ude42<\/p>\n<p>So basically what I will do is install RTL-SDR to communicate with the USB Stick and we will install multimon-ng to add some extra nifty features for decoding POCSAG e.t.c.<\/p>\n<p>So the first step is to boot-up your Raspberry, connected to the network and SSH to your Raspberry (or use the local shell ofcourse, but I prefer to do it remotely)<\/p>\n<p>If you add the USB Stick (the R820T + RTL2838) I\u2019ve noticed the Raspberry rebooted.<\/p>\n<pre>pi@srv-rasp-01 ~ $ lsusb\nBus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\nBus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.\nBus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T\n<\/pre>\n<p>To see a bit more details and to find out the VID (Vendor ID) and PID (Product ID) you can use LSUSB -v and check if your hardware is compatible with RTL-SDR here\u00a0: <a class=\"external free\" href=\"http:\/\/sdr.osmocom.org\/trac\/wiki\/rtl-sdr\" rel=\"nofollow\">http:\/\/sdr.osmocom.org\/trac\/wiki\/rtl-sdr<\/a><\/p>\n<pre> idVendor           0x0bda Realtek Semiconductor Corp.\n idProduct          0x2838 RTL2838 DVB-T\n<\/pre>\n<p>It seems my DVB-T Stick is compatible. ( Generic RTL2832U (e.g. hama nano)) so lets move on to the installation of the RTL-SDR software.<\/p>\n<p>Get your Raspberry up2date first.<\/p>\n<pre>sudo -i\napt-get update &amp;&amp; apt-get upgrade\n<\/pre>\n<p>Now install the required utils and libraries to compile RTL-SDR<\/p>\n<pre>apt-get install git cmake libusb-1.0-0.dev build-essential\n<\/pre>\n<p>Download RTL-SDR and compile the software.<\/p>\n<pre>git clone <a class=\"external free\" href=\"git:\/\/git.osmocom.org\/rtl-sdr.git\" rel=\"nofollow\">git:\/\/git.osmocom.org\/rtl-sdr.git<\/a>\ncd rtl-sdr\/\nmkdir build\ncd build\ncmake ..\/ -DINSTALL_UDEV_RULES=ON\nmake\nmake install\nldconfig\n<\/pre>\n<p>In order to be able to use the dongle as a non-root user, I used cmake with -DINSTALL_UDEV_RULES=ON argument in the above build steps. This is an optional thing. The software will install in \/usr\/local\/bin\/ and consists of a few utils\u00a0: rtl_adsb, rtl_eeprom, rtl_fm, rtl_power, rtl_sdr, rtl_tcp, rtl_test<\/p>\n<p>After the installation, reboot the raspberry and login with a normal user account.<\/p>\n<p>Now, type rtl_test\u00a0:<\/p>\n<pre>pi@srv-rasp-01 ~ $ rtl_test\nFound 1 device(s):\n  0:  Generic RTL2832U OEM\n<\/pre>\n<p>Using device 0: Generic RTL2832U OEM<\/p>\n<p>Kernel driver is active, or device is claimed by second instance of librtlsdr. In the first case, please either detach or blacklist the kernel module (dvb_usb_rtl28xxu), or enable automatic detaching at compile time.<\/p>\n<pre>usb_claim_interface error -6\nFailed to open rtlsdr device #0.\n<\/pre>\n<p>Ok, not good. let\u2019s fix this little issue\u00a0\ud83d\ude42 . We have to blacklist the automatically loading of the kernel module. Edit \/etc\/modprobe.d\/raspi-blacklist.conf and add the following lines. (Note\u00a0: If this raspi-blacklist.conf doesn\u2019t exist, just create it)<\/p>\n<pre>blacklist dvb_usb_rtl28xxu\nblacklist rtl_2832\nblacklist rtl_2830\n<\/pre>\n<p>Reboot the Raspberry again and retry the rtl_test<\/p>\n<pre>pi@srv-rasp-01 ~ $ rtl_test\nFound 1 device(s):\n  0:  Generic RTL2832U OEM\nUsing device 0: Generic RTL2832U OEM\nFound Rafael Micro R820T tuner\nSupported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6\n<\/pre>\n<p>Info: This tool will continuously read from the device, and report if samples get lost. If you observe no further output, everything is fine.<\/p>\n<p>Reading samples in async mode&#8230; lost at least 64 bytes<\/p>\n<p>This looks O.K. to me. I lost a few samples at the startup. But no new messages popped up.<\/p>\n<p>source : <a class=\"external free\" href=\"http:\/\/www.yellownote.nl\/blog\/index.php\/2014\/01\/12\/dvb-t-fun-raspberry-pi\/\" rel=\"nofollow\">http:\/\/www.yellownote.nl\/blog\/index.php\/2014\/01\/12\/dvb-t-fun-raspberry-pi\/<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Installing rtl-sdr You have probably heard about the cheap little USB Dongles made to receive digital Television and \/ or radio. They come in many <a class=\"mh-excerpt-more\" href=\"https:\/\/einstein.amsterdam\/?page_id=104\" title=\"Part 1 : How to start\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages\/104"}],"collection":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=104"}],"version-history":[{"count":0,"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=\/wp\/v2\/pages\/104\/revisions"}],"wp:attachment":[{"href":"https:\/\/einstein.amsterdam\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}