{"id":550,"date":"2018-01-31T12:06:14","date_gmt":"2018-01-31T17:06:14","guid":{"rendered":"http:\/\/www.k2dls.net\/blog\/?p=550"},"modified":"2018-01-31T14:00:22","modified_gmt":"2018-01-31T19:00:22","slug":"update-monitoring-nextgen-atc-on-the-cheap","status":"publish","type":"post","link":"https:\/\/www.k2ie.net\/blog\/2018\/01\/31\/update-monitoring-nextgen-atc-on-the-cheap\/","title":{"rendered":"Update: Monitoring NextGen ATC (on the cheap!)"},"content":{"rendered":"<p>Note: This article was originally published in March 2017. I&#8217;ve revisited and updated it in preparation for a talk that I&#8217;ll be giving at the 2018 <a href=\"http:\/\/www.swlfest.com\">Winter SWL Fest<\/a>. I&#8217;ve simplified the installation process. While doing so, I learned that Google now requires an <a href=\"https:\/\/developers.google.com\/maps\/documentation\/javascript\/get-api-key\">API key<\/a> for the application to have access to their maps. My github fork of the dump 1090 code has been updated to account for this development.<\/p>\n<p>A key component of next generation air traffic control is <a href=\"https:\/\/www.aopa.org\/advocacy\/advocacy-briefs\/air-traffic-services-brief-automatic-dependent-surveillance-broadcast-ads-b\">Automatic Dependent Surveillance &#8211; Broadcast<\/a> (ADS-B). The current FAA mandate is for all included aircraft to output ADB-B transmissions no later than January 1, 2020. But you don&#8217;t have to wait to receive and map ADS-B. There is a lot of air traffic to be seen.<\/p>\n<figure id=\"attachment_326\" aria-describedby=\"caption-attachment-326\" style=\"width: 1680px\" class=\"wp-caption alignright\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-326\" src=\"http:\/\/www.k2dls.net\/blog\/wp-content\/uploads\/2017\/03\/dump1090.png\" alt=\"\" width=\"1680\" height=\"1050\" \/><figcaption id=\"caption-attachment-326\" class=\"wp-caption-text\">dump1090 as viewed via a remote web browser.<\/figcaption><\/figure>\n<p>Some folks are using complete downloadable images that are set up to feed flight tracking services such as <a href=\"https:\/\/flightaware.com\/\">FlightAware<\/a>. If you&#8217;re interested in doing this, <a href=\"http:\/\/swling.com\/blog\/2017\/03\/making-a-flightaware-ads-b-feeder-with-a-raspberry-pi-3-and-rtl-sdr-dongle\/\">The SWLing Post<\/a> featured an article that you&#8217;ll enjoy. I wanted to explore whether I could use some items already on hand to see a map of overhead aircraft on any computer on my home network.<\/p>\n<p>I pulled out an older <a href=\"https:\/\/www.raspberrypi.org\/products\/model-b\/\">Raspberry Pi Model B<\/a> and a 4 GB SD-Card and installed a copy of <a href=\"https:\/\/www.raspberrypi.org\/downloads\/raspbian\/\">Raspbian Stretch Lite<\/a>. The Model B has been retroactively called a Raspberry Pi 1 Model B. It is equipped with 512 MB of RAM, two USB ports and a 100mb Ethernet port.<\/p>\n<p>I decided to use a spare older <a href=\"http:\/\/www.rtl-sdr.com\/\">RTL-SDR<\/a> stick based on the RTL2832U and R820T chips. This USB device comes with a small antenna that I hoped would be good enough to get me started. It is not in any way optimized for the 1090 MHz signals that are used by ADS-B and is roughly 19 parts per million (ppm) off frequency. It cost a bit over $10 at a hamfest a couple of years ago. The designs have improved since the early models were offered. Newer models include a TCXO (thermally compensated crystal oscillator) for stability and accuracy.<\/p>\n<p>I needed software to take signals from the RTL-SDR stick and plot them on a map. That software is &#8220;dump1090&#8221;, originally written by Salvatore Sanfilippo. I added an install stanza to the Makefile, along with a systemd service file, for a smooth system install. I also needed to install the RTL-SDR USB drivers. The complete installation runs &#8220;headless&#8221;, meaning no monitor, keyboard or mouse need be connected. Remote management can be done via ssh.<\/p>\n<p>There is a security change that comes along with Stretch. ssh is now disabled by default. After copying the initial Stretch image to the SD card and BEFORE removing it to place the Raspberry Pi, mount the boot partition and <a href=\"https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?t=191252\">create an empty file named &#8220;ssh&#8221;<\/a>. If you are not using ethernet, you could also pre-configure wifi settings.<\/p>\n<p>First, bring the Raspbian Stretch installation up to date.<\/p>\n<p><code>sudo apt-get update<br \/>\nsudo apt-get upgrade<\/code><\/p>\n<p>Add some needed packages.<\/p>\n<p><code>sudo apt-get install git cmake libusb-1.0-0-dev librtlsdr-dev rtl-sdr<\/code><\/p>\n<p>You may test by running <code>rtl_test -t<\/code>. If the device is properly seen by the driver you should see the following:<\/p>\n<pre>Found 1 device(s):\r\n  0:  Realtek, RTL2838UHIDIR, SN: 00000001\r\n\r\nUsing device 0: Generic RTL2832U OEM\r\nFound Rafael Micro R820T tuner\r\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 \r\n[R82XX] PLL not locked!\r\nSampling at 2048000 S\/s.\r\nNo E4000 tuner found, aborting.<\/pre>\n<p>Don&#8217;t be concerned by the &#8220;No E4000 tuner found&#8221; message. The E4000 is an older chipset that is no longer used by today&#8217;s RTL-SDR devices.<\/p>\n<p>Compile and install the dump1090 code.<\/p>\n<p><code>git clone https:\/\/github.com\/K2DLS\/dump1090.git<br \/>\ncd dump1090<br \/>\nmake<br \/>\nsudo make install<\/code><\/p>\n<p>Configure dump1090 options.<\/p>\n<p><code>cd \/etc\/default<br \/>\nsudo vi dump1090<\/code><\/p>\n<p>Here&#8217;s what I placed in the file.<\/p>\n<p><code># Default settings for dump1090.<br \/>\nDUMP1090_OPTS=\"--quiet --net --lat xx.xxxxx --lon -yy.yyyyy --ppm 19 --gain -10\"<\/code><\/p>\n<p>&#8211;quiet runs in the background<br \/>\n&#8211;net starts a webserver so that you can access via a web browser<br \/>\n&#8211;lat set to YOUR decimal latitude (negative for South)<br \/>\n&#8211;lon set to YOUR decimal latitude (negative for West)<br \/>\n&#8211;ppm if you know the ppm tolerance of your device (otherwise omit)<br \/>\n&#8211;gain -10 which sets gain automatically<\/p>\n<p>A full parameter list can be reviewed by typing <code>dump1090 --help<\/code>.<\/p>\n<p>With an antenna connected you can perform a quick device check by typing <code>dump1090 --interactive<\/code>. If all is well you&#8217;ll see a screen like this:<\/p>\n<pre><small>Hex     Mode  Sqwk  Flight   Alt    Spd  Hdg    Lat      Long   Sig  Msgs   Ti\/\r\n-------------------------------------------------------------------------------\r\nA39D11  S                                                         6     1    4\r\nA25D36  S                     1775                                7     4    3\r\nAAA593  S                     2575  205  075                      7     2    7\r\nA25238  S                                                         4     1   12\r\nA0480B  S                    19650                                8    28    3\r\nACF4DD  S                     3825                                7     2   14\r\nA41F61  S           FDX3018   2800  211  025   40.428  -74.332   23    83    0\r\nA6FFFE  S     1753  LXJ550   30475  371  226                      8    63    0\r\nC060B3  S                     4625                                6    14    1\r\nACF69B  S                    23250                                6    25    1\r\nA2D27C  S                    24000                               13    42    2\r\nA0BF90  S                     9500  249  257                      5     3    9\r\nA7D30A  S                    40000                                8   111    1\r\nAE0192  S           SPAR958  32675                               22    93    0\r\nACC040  S                     7825                                8   146    2\r\nACA5DF  S                    26600                                6    79    0\r\nA80C7B  S                     4550                                9   108    1\r\nA7CC00  S                     7825                               35   123    0\r\nACF841  S     1507           14425                               50   132    0\r\nA8C802  S           NKS149   23575  332  216   39.995  -74.262   12   160    0\r\nA61949  S           UAL1105   2725                               14    60    0\r\nAC2E20  S     1006           19925                               22   130    0\r\nAB766A  S           DAL1526   8525  216  038   40.444  -74.213   81   249    0\r\nAA4440  S                     5400  253  066                      6     6   13<\/small><\/pre>\n<p>Control-C exits this screen.<\/p>\n<p>Now start the dump1090.service.<\/p>\n<p><code>sudo systemctl start dump1090.service<\/code><\/p>\n<p>If all goes well, a <code>netstat -an<\/code> will show that there is a binding to port 8080.<\/p>\n<pre><small>tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN<\/small><\/pre>\n<p>Now you can start up a web browser from any computer on your home network and see a map of planes overhead. If your router supports internal dynamic DNS you can name the RPi and access via something like <code>http:\/\/skynet:8080<\/code>. Alternatively, use the IP address, which can be obtained via <code>ifconfig<\/code>.<\/p>\n<pre><small>eth0      Link encap:Ethernet  HWaddr b8:27:eb:12:34:56  \r\n          inet addr:192.168.1.123 Bcast:192.168.1.255  Mask:255.255.255.0\r\n          inet6 addr: fe80::1234:5678:8765:abcd\/64 Scope:Link\r\n          inet6 addr: fd68:bee:1f21:2221::5\/128 Scope:Global\r\n          inet6 addr: fd68:bee:1f21:2221:1234:5678:8765\/64 Scope:Global\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:990830 errors:0 dropped:418120 overruns:0 frame:0\r\n          TX packets:323700 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1000 \r\n          RX bytes:87491798 (83.4 MiB)  TX bytes:207659746 (198.0 MiB)\r\n\r\nlo        Link encap:Local Loopback  \r\n          inet addr:127.0.0.1  Mask:255.0.0.0\r\n          inet6 addr: ::1\/128 Scope:Host\r\n          UP LOOPBACK RUNNING  MTU:65536  Metric:1\r\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1 \r\n          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)<\/small><\/pre>\n<p>In this case, the URL would be <code>http:\/\/192.168.1.123:8080<\/code>.<\/p>\n<p>Once the map appears, re-position it to your part of the world and enjoy learning about what is flying overhead. You can enhance your enjoyment by listening to your closest airport tower or air traffic control frequencies on a scanner. These transmissions use amplitude modulation (AM) and can be monitored an another RTL-SDR stick or a scanner, even a relatively old model.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note: This article was originally published in March 2017. I&#8217;ve revisited and updated it in preparation for a talk that I&#8217;ll be giving at the 2018 Winter SWL Fest. I&#8217;ve simplified the installation process. While doing so, I learned that Google now requires an API key for the application to have access to their maps. &hellip; <a href=\"https:\/\/www.k2ie.net\/blog\/2018\/01\/31\/update-monitoring-nextgen-atc-on-the-cheap\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Update: Monitoring NextGen ATC (on the cheap!)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6,2],"tags":[33,32,35,34,37,36,18,12,31],"class_list":["post-550","post","type-post","status-publish","format-standard","hentry","category-radio","category-technology","category-travel","tag-ads-b","tag-adsb","tag-air-traffic-control","tag-atc","tag-dump1090","tag-flight-aware","tag-raspberry-pi","tag-raspbian","tag-rtl-sdr"],"_links":{"self":[{"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/posts\/550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/comments?post=550"}],"version-history":[{"count":16,"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":569,"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/posts\/550\/revisions\/569"}],"wp:attachment":[{"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/media?parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/categories?post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.k2ie.net\/blog\/wp-json\/wp\/v2\/tags?post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}