Does anyone know what sort of process would be required for me to add a function onto Piaware that would trigger an audio queue if a plane was within a given distance and below a certain altitude in relation to my ADS-B’s location?
I was hoping to add a mini speaker onto the Raspberry Pi board to notify me if there was an aircraft nearby without me having to look directly at the online visual map.
That’s what I was thinking but I’m not entirely sure how to access that file to add it in. Is there a github page with the master files somewhere? Or do I have to unpack the image file and repack? (Also yes cue! Thank you.)
It’s meant for use with collectd, but maybe you can figure out how to make a standalone script to query the json.
Programming can be learned by anyone i’d say, but you’ll have to invest some time.
Once you understand the python script i linked, it shouldn’t be too hard to build sth that can do sth when a plane comes closer than xyz nmi.
I am writing something to point to nearest plane on a web page served by the pi so I have all the code to look through relevant file and pick out closest (and tell you it’s bearing!) Still work in progress but I can share, if I can figure how to do so on the forum. Only problem is that it is in PHP. No, the advantage is that it is in PHP - for me anyway:-).
If I could get this pathetic Android tablet to screenshot o clipboard I’ll post a screenshot. Standby…
Anybody know best way to share code here? I’d post a file i guess but need to be on a proper computer, will try later. Btw the above page self refreshes so it animates, but you could run PHP on a cron job, or translate to python to trigger a noise or send an email.
That looks ace – I’ll sometimes just have the map zoomed out to 20 NMs and if something wanders in I can likely go outside and see it. Or if something buzzes past I can check the map to see what it is. Your mod looks great for those!
Some people use github and should be able to guide you if that’s suitable. I’ve posted someone’s code recently to Google Drive, shared it as read-only (the default when shared) and posted the link. That shows it as code in a text window with a download link for the file. It still needs an installer or install instructions though (on github that takes the form of a README.md file). If it’s relatively short you could post it as text and use 3 backticks above the first line to turn it into code-formatted text in your post.
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )
where φ1 , λ1 is the start point, φ2 , λ2 the end point ( Δλ is the difference in longitude)
Now that is an interesting topic to discuss! I know what you mean BUT I had the following in place and ran it against the naive/fast atan2 approach and for where I am I found the latter produced a result that if I looked in the sky it gave a better answer! Maybe magnetic deviation? Maybe because we’re looking at very short ranges here so curvature of earth actually is not the right way to go???
Would love to understand! At ranges of 20nm or less I was seeing deviations between the two of 10 or so degrees but agreement at compass “quarters” N E S W.
You need to convert your lat/lon values to radians. (Doesn’t matter for the simple atan2 case, since it’s just a scaling factor, but it does matter as soon as you start calling sin/cos)
I have piaware 7.1 up and running on a RPi (with flightaware receiver). I would like to set up a system exactly as described in the first post of this thread - an audio alarm sounds if an aircraft is within a certain distance and below a certain altitude. Any help greatly appreciated