3 June 2012

ADS-B in Xastir with gr-air-modes


I find that while gr-air-modes is great for decoding ADS-B data, using Google Earth to view it in is a bit of a drag.  As I tend to have Xastir running on my laptop most of the time, I thought that it would be cool to plot aircraft tracks in that instead.   I decided on a very dirty hack to feed ADS-B data from gr-air-modes into Xastir. You can see, in the screen shot above, data received with a USRP B100 and WBX  with a discone in the loft and a cheap preamp.




In order to get this to work, you will have to edit the modified modes_kml.py file and replace mycall and mypass:

mycall = "MYCALL"
mypass="MYPASS"
with something suitable, typically generated with the callpass utility.  Then configure Xastir to Enable Server Ports, and you should see something like this in the output of uhd_modes.py

/usr/local/bin/xastir_udp_client localhost 2023 MYCALL MYPASS "4196473>ADS-B:=5247.99N/00139.38E^035/462/A=033350BAW768  "
Received: ACK
If you don't get an ACK, it isn't going to work.



The file is modified from vanilla upstream, not from the rtl-sdr fork.

You must enable the kml output in order to get this to work, something like this:

./uhd_modes.py -g 50 -K ~/adsb.kml -a

Please don't feed (igate) ADS-B data into the APRS-IS. I don't think it is wanted.  I'f I'm wrong in this regard please let me know.


If you need to get some maps in your Xastir, I recommend enabling Automaps for  Online/OSM_tiled_Mapnik.geo in the Map Chooser properties dialog.


4 comments:

g0hww said...

I've just updated the modified modes_kml.py on pastebin to fix a couple of bugs; 1) Badness with negative symbols in lat long strings 2) shortened duration of repeated reporting from 1 minute to 10 secs.

g0hww said...

To speed up Xastir's track drawing (trails in Xastir parlance) you can tweak main.c at or around line 27336, where it says:

next_redraw = sec_now()+60; // init redraw timing

I changed the 60 to a 2 and it is much faster at updating tracks now, and working well, at least with a limited number of tracks. YMMV!

g0hww said...

Another bodge posted to pastebin to stop the modes_kml worker thread from barfing due to a locked database. Rather than barfing, it balks now.

g0hww said...

Using Xastir to track aircraft can be pretty whizzy. I now have it configured to announce new tracks using Festival text-to-speech, and to make a sonar ping noise if any aircraft comes within the proximity distance, or if I'm tracking a specific aircraft, when new position updates for it are received. Cool, huh!