After 2 and a bit years working for Optus Sport constructing a CDN ( Content Delivery Network ) my contract finished up. With the Australian job market slowing down for Christmas I took the opportunity to learn some new skills and what better way than a project I always wanted to do 😊
For many years I had been watching aircraft using a software called Dump1090 to receive ADS-B transponder data. This was OK to start with as it had a very simplistic web interface that overlays the location and direction for the aircraft.
But I always found it lacking, no track data. I wanted more and so it was time to go on a bit of a software adventure.
Now I am no software dev ( yes I still say that even thought I write more code than most, just ask some of my old managers ).
The Radio
First was to setup an old laptop with the latest version of dump1090 and as I don't like installing lots of things I went with setting up a docker container.
FROM rockylinux:9 as builder RUN sed 's/https/http/g' -i /etc/yum.repos.d/* \ && dnf install epel-release -y \ && sed 's/https/http/g' -i /etc/yum.repos.d/* \ && dnf install rtl-sdr-devel git make gcc -y \ && git clone https://github.com/antirez/dump1090.git \ && cd dump1090 \ && make FROM rockylinux:9 COPY --from=builder /dump1090 /dump1090 RUN sed 's/https/http/g' -i /etc/yum.repos.d/* \ && dnf install epel-release -y \ && sed 's/https/http/g' -i /etc/yum.repos.d/* \ && dnf install rtl-sdr -y EXPOSE 8081 30003 WORKDIR /dump1090
This image was then pushed up to docker hub as dump1090
When this is installed with a volume to /dev/bus/usb it will have the ability to receive the ADS-B signals
Database connector
API's
Now to the real API's, there are on 3 and that could be shrunk more.
- api/adsb/position returns a list of aircraft seen in the last 10 seconds with latitude, longitude and altitude and is used for both the marker icon on the map and the table data for flights
- api/adsb/points/{flight}/{hex_ident} returns all the locations the aircraft was seen at over the last 2 hours used for displaying the track when an aircraft is selected
- api/adsb/track/{hex_ident} returns the current track of the aircraft use to set the rotation of the aircraft marker icon
Web UI
I the past I have used VueJS and it just kinda clicked for me and this was when I was working with a ReactJS dev team, still don't understand React
const row = this.$el.querySelectorAll("tr")
This gave me a way to find the height of each row and make the table dynamic
The first was easy, just call the api based on the aircraft call-sign and hex_ident. Then realise that I need to remove the layer when the flight disappeared.
Turns out the easiest way is to have the api return null if there are no point newer than 10 seconds, make for interesting watching when the flight is in a bad reception area and it keeps "flashing" but I can live with that
To fix this I changed over hex_idents as they are stable
Here is the result https://adsb.globelock.org/
Where to from here
My plan is to create a ADS-B transponder that will sent raw packets via LoRa to a base station. This should help as ADS-B is already a very compact communication protocol
No comments:
Post a Comment