<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>flightradar24 &#8211; The Blog of Lee</title>
	<atom:link href="https://lee.smallbone.com/tag/flightradar24/feed/" rel="self" type="application/rss+xml" />
	<link>https://lee.smallbone.com</link>
	<description>Technical. Philosophical. Photographical. All-Sorts-ical.</description>
	<lastBuildDate>Tue, 25 Mar 2014 19:25:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>ADS-B (dump1090) with MySQL Support on the Raspberry Pi using a DVB-T (R820T) USB Stick</title>
		<link>https://lee.smallbone.com/2014/03/ads-b_via_dvb-t/</link>
					<comments>https://lee.smallbone.com/2014/03/ads-b_via_dvb-t/#comments</comments>
		
		<dc:creator><![CDATA[Lee]]></dc:creator>
		<pubDate>Tue, 25 Mar 2014 19:25:20 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[dump1090]]></category>
		<category><![CDATA[flightradar24]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">http://lee.smallbone.com/?p=381</guid>

					<description><![CDATA[The Raspberry Pi is an amazing piece of kit. There&#8217;s little it cannot do with sufficient tweaking. I have a passing interest in planes, and love FlightRadar24 (iPad app and website).  I started to wonder how they got this data. A quick rummage around their website reveals they mostly rely on a world wide network <a href='https://lee.smallbone.com/2014/03/ads-b_via_dvb-t/' class='excerpt-more'>[...]</a>]]></description>
										<content:encoded><![CDATA[<p>The Raspberry Pi is an amazing piece of kit. There&#8217;s little it cannot do with sufficient tweaking. I have a passing interest in planes, and love <a href="http://www.flightradar24.com" target="_blank">FlightRadar24</a> (iPad app and website). </p>
<div id="attachment_378" style="width: 705px" class="wp-caption aligncenter"><a href="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/fr24.jpg"><img aria-describedby="caption-attachment-378" class="size-large wp-image-378" alt="fr24" src="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/fr24-1024x616.jpg" width="695" height="418" srcset="https://lee.smallbone.com/blog/wp-content/uploads/2014/03/fr24-1024x616.jpg 1024w, https://lee.smallbone.com/blog/wp-content/uploads/2014/03/fr24-300x180.jpg 300w, https://lee.smallbone.com/blog/wp-content/uploads/2014/03/fr24.jpg 1298w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-378" class="wp-caption-text">FlightRadar24 screenshot</p></div>
<p>I started to wonder how they got this data. A quick rummage around their website reveals they mostly rely on a world wide network of volunteers to collect and then feed them data. You need &#8216;line of sight&#8217; to an aircraft to be able to query the information, and no one entity can afford to do this globally. So, a network of volunteers run &#8216;feeder radar stations&#8217; (ok, it isn&#8217;t really &#8216;radar&#8217; but, more the Next Generation version of). </p>
<h2>Hardware I Use</h2>
<p>I use a &#8216;stock&#8217; Raspberry Pi model B, connected via ethernet to my home network ordered via RS Components (fwiw, they&#8217;re slow as heck&#8230; order one from somewhere else&#8230;!). My Pi is strapped up under my desk out of the way. It has a 4 port (unpowered) USB hub connected to it (the black blob underneath) but otherwise it is entirely unremarkable. I&#8217;m even still using the original RS Components 4Gb SD card. </p>
<p>Excuse my camera charger lurking underneath it all &#8211; it&#8217;s entirely unrelated!</p>
<div id="attachment_380" style="width: 705px" class="wp-caption aligncenter"><a href="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/raspberry.jpg"><img aria-describedby="caption-attachment-380" class="size-large wp-image-380" alt="raspberry" src="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/raspberry-1024x768.jpg" width="695" height="521" srcset="https://lee.smallbone.com/blog/wp-content/uploads/2014/03/raspberry-1024x768.jpg 1024w, https://lee.smallbone.com/blog/wp-content/uploads/2014/03/raspberry-300x225.jpg 300w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-380" class="wp-caption-text">My Raspberry Pi, mounted under my desk</p></div>
<p>Hardware wise, to receive the <a href="http://en.wikipedia.org/wiki/Automatic_dependent_surveillance-broadcast" target="_blank">ADS-B</a> broadcasts from planes overhead, I use a <a href="http://www.flightradar24.com/dvbt-stick" target="_blank">DVB-T (R820T) Stick</a> with an external aerial attached to it. I ordered mine from <a href="http://h2204566.stratoserver.net/SmartStore.NET/en/ads-b-dongle-r820t#.UzHKv60ni2w" target="_blank">1090mhz.com</a> (based in Germany) and it arrived in the UK about 4 days later in perfect condition, and even had an adaptor and external aerial included in the package &#8211; thanks guys! This is the &#8216;best&#8217; stick to use &#8211; apparently &#8211; as it is based on the R820T chipset.</p>
<h2>Software I Use</h2>
<p>I use a modified version of <a href="https://github.com/MalcolmRobb/dump1090" target="_blank">dump1090</a>, originally installed using instructions from <a href="http://www.satsignal.eu/raspberry-pi/dump1090.html" target="_blank">David Taylor&#8217;s SatSignal.eu website</a>. dump1090 is fantastic. Using the <a href="http://zr6aic.blogspot.co.uk/2013/02/setting-up-my-raspberry-pi-as-sdr-server.html" target="_blank">sdr-rtl drivers</a> (also documented on David&#8217;s site) to re-tune my <a href="http://www.flightradar24.com/dvbt-stick" target="_blank">DVT-B Stick</a>  from digital TV to the 1090MHz used by ADS-B, allows it to receive the &#8216;next gen&#8217; radar data right from the planes in the sky themselves. </p>
<p>dump1090 then takes this feed and decodes the data into something human rather than machine readable. Using the &#8211;interactive mode, you can see the output as the planes fly by.</p>
<div id="attachment_382" style="width: 705px" class="wp-caption aligncenter"><a href="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/interactive.jpg"><img aria-describedby="caption-attachment-382" class="size-large wp-image-382" alt="interactive" src="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/interactive-1024x768.jpg" width="695" height="521" srcset="https://lee.smallbone.com/blog/wp-content/uploads/2014/03/interactive-1024x768.jpg 1024w, https://lee.smallbone.com/blog/wp-content/uploads/2014/03/interactive-300x225.jpg 300w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-382" class="wp-caption-text">dump1090 &#8211;interactive</p></div>
<p>&nbsp;</p>
<p>Perhaps even more exciting than that though, is the &#8211;net option, which enables not only all the data sockets so that FlightRadar24&#8217;s software can pull the information out of dump1090 (<a href="http://ferrancasanovas.wordpress.com/2013/09/27/fr24-feeder-software-installation-on-the-rpi/" target="_blank">setup instructions here</a>), but also enables a built-in web server so you can run and view your own miniature version of FR24:</p>
<div id="attachment_383" style="width: 705px" class="wp-caption aligncenter"><a href="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/dump1090.jpg"><img aria-describedby="caption-attachment-383" class="size-large wp-image-383 " alt="dump1090" src="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/dump1090-1024x614.jpg" width="695" height="416" srcset="https://lee.smallbone.com/blog/wp-content/uploads/2014/03/dump1090-1024x614.jpg 1024w, https://lee.smallbone.com/blog/wp-content/uploads/2014/03/dump1090-300x180.jpg 300w, https://lee.smallbone.com/blog/wp-content/uploads/2014/03/dump1090.jpg 1299w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-383" class="wp-caption-text">Screenshot of my own &#8216;dump1090&#8217; FlightRadar24-style output (&#8211;net option)</p></div>
<h2> </h2>
<h2>MySQL Support</h2>
<p>You may remember I said I use a modified version of dump1090. That is because as well as everything above, I also wanted to store a local copy of all the data I receive in a MySQL database so I can do my own manipulations and calculations. While there is a MySQL&#8217;d branch of dump1090 on github, it is dozens of commits behind the main branch and missing out on a lot of the hard work Malcolm Robb has put in to his master branch and fork of antirez&#8217; original work. </p>
<p>So, rather than forego either mysql, or using the latest version of dump1090, I hacked them together and re-introduced mysql support into the latest version of dump1090. </p>
<div>To keep updates to future versions easy, there are very minimal changes to all other source code/header files of the official dump1090 branch. 95% of mysql support code is contained within mysql.h and mysql.c with pretty much the only main branch changes being the inclusion of mysql headers and a new struct in dump1090.h, the &#8211;mysql switch handler in dump1090.c, and a call to modesFeedMySQL() in mode_s.c (that could even be moved to mysql.h I suppose to separate it even more .. but I just put it with all the other structs for consistency). </div>
<div> </div>
<div>This should make it relatively simple for me/you to upgrade each time a new version comes out. </div>
<div> </div>
<div>MySQL authentication credentials are now in mysql.h rather than buried deep in the codebase. If it&#8217;s something lots of people show an interest in, the database credentials could even be supplied on the command line for even greater simplicity and portability. We&#8217;ll see&#8230; </div>
<div> </div>
<div>If you&#8217;d like the latest version (1.08.1003.14) of dump1090 <em><strong>with mysql support</strong></em>, you can <a href="http://lee.smallbone.com/blog/wp-content/uploads/2014/03/dump1090-1.08.1003.14-mysql.tar.gz">get it here</a>. </div>
<div> </div>
<div>Happy flying!</div>
]]></content:encoded>
					
					<wfw:commentRss>https://lee.smallbone.com/2014/03/ads-b_via_dvb-t/feed/</wfw:commentRss>
			<slash:comments>15</slash:comments>
		
		
			</item>
	</channel>
</rss>
