Tuesday 10 November 2015

Raspberry Pi PiAware Aircraft Radar

After creating the PiAware Flight Indicator LED I was keen to see what else I could do with the aircraft data my PiAware setup was retrieving for me.

I thought I would see if I could make an 'old fashioned' radar to show what aircraft were being picked up so I could have my own desk based radar.



I found an example of a radar written in pygame, which became the basis of my code (although I am pretty sure the original author wouldn't recognise it now) and created a radar class.

I plugged in the GPS coordinates of the aircraft using the PiAware flight data class I created to produce a pretty swanky, even if I say so myself, radar of all the aircraft I am picking up signals from.

Setup PiAware
If you want to have a go, first you need to setup a PiAware server to receive data - you don't need a lot of equipment and its really easy to do.

Download my project
The code is on github at github.com/martinohanlon/PiAwareRadar.
git clone https://github.com/martinohanlon/PiAwareRadar
Run the program
The program expects a number of command line parameters, the mandatory being the latitude and longitude of your PiAware server, which will be the centre of the radar.
cd PiAwareRadar/piawareradar
python3 piawareradar.py mylat mylon
You can set other parameters for the IP address of the PiAware server, if your radar is running on a different machine, whether you want it to run full screen and the layout of your screen (normal or touch).

Usage
    usage: piawareradar.py [-h] [--piawareip PIAWAREIP] [--screen SCREEN] [--fullscreen] lat lon
    
    PiAware Flight Radar
    
    positional arguments:
      lat                   The latitude of the receiver
      lon                   The longitude of the receiver

    optional arguments:
      -h, --help            show this help message and exit
      --piawareip PIAWAREIP The ip address of the piaware server
      --screen SCREEN       The screen config to use [normal / touch]
      --fullscreen          Fullscreen radar
The plus and minus buttons in the top right allow you to zoom in and out, if you click on a dot, the data about that flight will be display in the bottom right hand corner.


14 comments:

  1. Nice creative work. Delighted that you extended PiAware. Thx.

    ReplyDelete
  2. very cool, still have a pi2 stuck to a 5 inch screen so it might have to be turned into one of these for my coffee table!

    ReplyDelete
    Replies
    1. It looks really cool on the official raspberry touch screen.

      Delete
  3. Thanks for this, Martin.

    Do you know if there is an online source for the PiAware/Flightaware data for those who want to have a quick dabble with the code?

    ReplyDelete
  4. it's possible to share this radar view live as personal webpage? like Dump1090?

    ReplyDelete
  5. it's possible to share this radar view live as personal webpage? like Dump1090?

    ReplyDelete
    Replies
    1. Not easily! Its written using pygame which is a fat client.

      Delete
  6. Is there a way to populate parameters like altitude, speed, tail number, speed ?

    ReplyDelete
  7. Will be nice if can get linked with Stratux instead...

    ReplyDelete
  8. Looks great. As a bit of a Rpi newbie I'm unclear if I can do this WITH the Rpi thats receiving the ADSB (running headless ATM) or on another Rpi which I am slowly building various radio apps on (SDR stuff and ham radio apps) but which is on the same network. I'd be glad for a little more guidance... :-)

    ReplyDelete
    Replies
    1. Yes, you can run this on the same Pi which ADSB is running on. This is exactly what I did.

      Delete
  9. This comment has been removed by the author.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete

Note: only a member of this blog may post a comment.