A light-weight web client for plane spotting using dump1090.
git clone https://github.com/Slord6/1090webclient.git
- Update the url variable in
getNewData
inmap.js
to point at your data source - Either Just open
index.html
or host with you favourite web server - if you don't have one, I'm using Fenix.
Super, super simple (plain js/css/html) dump1090 web client using Leaflet for maps.
Currently set up to use Open Street Maps for map tiles but any leaflet-supported map tile service should work (see the list of tile servers).
Note: This is not 'production-ready' code - it works, but it's also, for example, consuming the server's data as HTML in places - don't just throw this on the internet if you don't know what you're doing.
Once you're serving the website, just navigate to it in a web browser (only tested in Chrome, so that's your best bet) and then wait for planes to appear.
Hover over a plane on the map for more info.
Depending on the version of dump1090 you have and your setup, there might be a slight modification you need to make in order not to get cross-origin errors. (Or you can install my fork, where I did this already but it's not too hard to do)
I've tried to write the following instructions so someone who's never written code in their life can fix it, but if you have problems feel free to open an issue and I'll try and help you out.
The following instructions assume:
- You have
git clone
d the dump1090 repository as the instructions there explain - You are running a linux system (in my case raspbian). However, the instructions should be fairly similar for other setups.
- You are
ssh
-ing into the system or only have a command line (if not and you have a GUI, then you can open the file with any text editor and start at #3)
- Navigate to the cloned directory on the command line
- Open the
net_io.c
file -nano ./net_io.c
- Now we need to edit the headers sent in the HTTP responses
- Find the function with the name
handleHTTPRequest
and the section commented// Create the header and send the reply
(In nano you can search withCtrl-W
) - After
"Content-Length: %d\r\n"
add"Access-Control-Allow-Origin: *\r\n"
on a new line - Save the file (in nano this is
Ctrl-X
and thenY
to save)
- Find the function with the name
- Run
make
in the same directory to rebuild dump1090 - Run
./dump1090 --net --interactive
and open or refresh the client - the issue should be resolved (if not, open an issue)
If you don't see any planes, check the console to see if your problem reveals itself there. If not, open an issue.
Edit the lat/lon + zoom values passed to setView
on the first line of map.js
You want the dataFetchBreakTime
variable
See separate file (but its MIT)