How to PHP "alongside" PiAware

Thanks - I’ve come across that: it’s pretty full on eh?! This is a nice page that simple folk like me can understand, with a worked example. Formula to Find Bearing or Heading angle between two points: Latitude Longitude - My main concern on performance was tracking up to 160 planes and Node or something running, which would continuously cycle to calculate minimum distances for each of them. I’ve just gone for a PHP solution which, on page load, calcs distances, finds minimum and calculates bearing for just that one and then it is done. If you want an update you have to refresh the web page but that means minimal Pi loading and nothing changes that quickly anyhow. I’m sure that is only tickling the Pi, but maybe I’ll add other things on over time :slight_smile:

Thanks for the link!

Stage 1 “Rough” output for the page showing where the nearest plane is to my location (relative to North BTW) so if I hear something I can fire up the page and see what it is and where it is, roughly…

Shame there is no way to get aircraft type :frowning:

That’s not an issue and would not take significant resources on an RPi, even if you calculate it once a second for all planes.
I’m not sure how bad PHP is, in python for example it’s not an issue at all.
Or have you tested and it’s using significant resources?
I suppose if the PHP is executed for each page impression, that might be a different story compared to just running it server side every second and serving the static result.

https://raspberrypi.nerdcamp.net/export.php

The last one, “complete database”, should work well, it’s json format, i’m sure you can easily enough use that in PHP.
You’ll get the ICAO type short hand (A20N, B739, A388) and a full text model at least for some aircraft.

You’re probably right that the Pi has plenty of performance to handle continual calcs. PHP 7.3 should perform well enough even though I bet Python is slicker for something like this. I’ve got my head too much in a web development mind set (transmission delays, multiple user load, paranoia about what Google will think! etc). I can set it to auto-refresh the page and measure load perhaps. As you say only needs to be every second or so.

Thanks for DBs reference they look an exciting prospect! I had thrown mysql and phpmyadmin on the pi (db management tool good for development), but doing an old school look up by hand would make it far more portable if anybody else wanted to borrow the code.

I will report developments.

Really nice ‘community’ here on FlightAware that people are prepared to take time and help others. Thanks again.

Dump1090 MySQL Database Script - E-Mail-Alert Lat/Lon/Alt/Hex/Flight-Filter

Dump1090 MySQL Database Script with Alert and Filter

Daily Log/E-Mail Aircraft Report directly on your RaspberryPi

24 hour reports from my receiver

Excellent reference thanks. So many project ideas, so little time!