{"id":161,"date":"2019-03-28T18:00:33","date_gmt":"2019-03-28T22:00:33","guid":{"rendered":"http:\/\/thinkleet.net\/?p=161"},"modified":"2026-04-13T07:01:33","modified_gmt":"2026-04-13T11:01:33","slug":"loftek-lk5200-as-an-rtl-sdr-server","status":"publish","type":"post","link":"https:\/\/thinkleet.net\/index.php\/2019\/03\/28\/loftek-lk5200-as-an-rtl-sdr-server\/","title":{"rendered":"Loftek LK5200 as an rtl-sdr server"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/IMG_20190328_105512_Shrink-768x1024.jpg\" alt=\"\" class=\"wp-image-162\" srcset=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/IMG_20190328_105512_Shrink-768x1024.jpg 768w, https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/IMG_20190328_105512_Shrink-225x300.jpg 225w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><figcaption>The sacrificial offering.<\/figcaption><\/figure>\n\n\n\n<p class=\"has-drop-cap\">I have had this router sitting in a bag for approximately 4 years.  About 2 years ago, I had the idea that it would be a good platform to try to build a pineapple if it supported OpenWRT as I had already done a TP-Link MR3020 to be one, and the Loftek had a built in battery, making it easier to deploy.  I went through various attempts to find a way to install OpenWRT on the device to no avail.  I finally came back to the LK5200 today, and decided to dig a little deeper.  To start with today, I opened the case.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/IMG_20190328_104046_Shrink-768x1024.jpg\" alt=\"\" class=\"wp-image-163\"\/><figcaption>You can see its bare circuits<\/figcaption><\/figure>\n\n\n\n<p>An AR9331-AL1A is the processor that this device uses.  Well, we know that it is an ARM processor, and it is very similar to the one in the <a href=\"https:\/\/openwrt.org\/toh\/tp-link\/tl-mr3020\">MR-3020.<\/a> (Exactly the same as the V1.8 of the hardware).  This bodes well for me.  Before I go and attempt to flash this though, let&#8217;s see what else I can find out about the device.  Connecting the router to my network, the defaults are to not use DCHP and instead assign itself a static IP of 192.168.168.1, so I&#8217;ll use that address and run an nmap scan on it with &#8220;nmap 192.168.168.1 -vv&#8221;.  The image below shows the results.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"169\" src=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-13-29.png\" alt=\"\" class=\"wp-image-164\" srcset=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-13-29.png 658w, https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-13-29-300x77.png 300w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><figcaption>Hmmm.  These look normal.  Almost.<\/figcaption><\/figure>\n\n\n\n<p>This gives us a listing of all of the open ports.  Port 53 is a DNS server (expected), port 80 is the admin interface webserver (expected), ports 139 and 445 are used for Samba shares (expected as there is a usb port for file sharing on the network), and port 8181 is &#8230; Wait, what is that?  It&#8217;s up in the non-privileged area.  Most times i&#8217;ve come across this port it&#8217;s another webserver.  Let&#8217;s try and get to it in the browser.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"655\" height=\"649\" src=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-11-04-40.png\" alt=\"\" class=\"wp-image-165\" srcset=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-11-04-40.png 655w, https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-11-04-40-150x150.png 150w, https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-11-04-40-300x297.png 300w\" sizes=\"auto, (max-width: 655px) 100vw, 655px\" \/><figcaption>Odd, it looks like a command prompt and a banner for OpenWRT.<\/figcaption><\/figure>\n\n\n\n<p>That is interesting.  It seems as if the Loftek LK5200 is already running OpenWRT.  Let&#8217;s try connecting to the same address and port with telnet using <strong><em>telnet 192.168.168.1 8181<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"477\" src=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-11-07-04.png\" alt=\"\" class=\"wp-image-166\" srcset=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-11-07-04.png 732w, https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-11-07-04-300x195.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><figcaption>Well, that was easier than I thought it would be.<\/figcaption><\/figure>\n\n\n\n<p>Now I have access to the root shell on the router.  First thing to do is update the package listing because I don&#8217;t believe it has ever been done.  This is accomplished with <strong><em>opkg update <\/em><\/strong>.  Once done, I install rtl_sdr with <strong><em>opkg install rtl_sdr<\/em><\/strong>.  This installed all of the tools for using my neSDR smart as a SDR receiver.  One last thing to do is blacklist the original driver built into the kernel.   On this device there was no \/etc\/modprobe.d\/ folder, so it had to be created with <strong><em>m<\/em><\/strong><em><strong>kdir \/etc\/modprobe.d\/ <\/strong><\/em>.  Then we needed to create the blacklist.conf file underneath the directory we had just created.  To do this use, <strong><em>echo &#8220;blacklist dvb_usb_rtl28xxu&#8221; >> \/etc\/modprobe.d\/blacklist.conf<\/em><\/strong> .  This command puts what is inside the quotes into a the file &#8220;blacklist.conf&#8221; in the directory &#8220;\/etc\/modprode.d\/&#8221;.  <\/p>\n\n\n\n<p>A simple reboot later, and we can plug in our USB SDR stick, login over telnet as before and run the rtl_tcp program to feed the data to another device on the network.  This is accomplished with <strong><em>rtl_tcp -a 192.168.168.1 <\/em><\/strong>.  This command effectively creates a server that feeds the data received by the SDR to another machine on the network.  The -a in the command tells rtl_tcp which address to serve it on.  Now we can load up whatever our preferred application to view the stream (which for me is GQRX).  If it&#8217;s your first time loading GQRX, you will be greeted by this screen, which should be filled in thusly.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"473\" height=\"446\" src=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-43-21.png\" alt=\"\" class=\"wp-image-167\" srcset=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-43-21.png 473w, https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-43-21-300x283.png 300w\" sizes=\"auto, (max-width: 473px) 100vw, 473px\" \/><figcaption>Look at all the numbers!<\/figcaption><\/figure>\n\n\n\n<p>After clicking OK, you may then press the play button and search the waterfall for interesting things. <br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"951\" height=\"627\" src=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-44-04.png\" alt=\"\" class=\"wp-image-168\" srcset=\"https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-44-04.png 951w, https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-44-04-300x198.png 300w, https:\/\/thinkleet.net\/wp-content\/uploads\/2019\/03\/Screenshot-from-2019-03-28-13-44-04-768x506.png 768w\" sizes=\"auto, (max-width: 951px) 100vw, 951px\" \/><figcaption>This is definitely an interesting thing. <\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I have had this router sitting in a bag for approximately 4 years. About 2 years ago, I had the idea that it would be a good platform to try to build a pineapple if it supported OpenWRT as I had already done a TP-Link MR3020 to be one, and the Loftek had a built &hellip; <a href=\"https:\/\/thinkleet.net\/index.php\/2019\/03\/28\/loftek-lk5200-as-an-rtl-sdr-server\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Loftek LK5200 as an rtl-sdr server<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":162,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,4],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-sdr"],"_links":{"self":[{"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":4,"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":215,"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/posts\/161\/revisions\/215"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/media\/162"}],"wp:attachment":[{"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thinkleet.net\/index.php\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}