FlightAware > Discussions
http://discussions.flightaware.com/

Alert when "My aircraft" is picked up by my piaware
http://discussions.flightaware.com/feature-requests/alert-when-my-aircraft-is-picked-up-by-my-piaware-t37018.html
Page 1 of 1

Author:  palmerit [ Sun Apr 03, 2016 12:00 pm ]
Post subject:  Alert when "My aircraft" is picked up by my piaware

I'd love to see an option to get alerts when any aircraft I've added to "my flightaware" is being actively tracked via one of my ADSB recievers so I can watch it on my local piaware radar.


Would this be a feasible/useful feature?

Author:  cbw [ Tue Apr 05, 2016 2:05 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

palmerit wrote:
I'd love to see an option to get alerts when any aircraft I've added to "my flightaware" is being actively tracked via one of my ADSB recievers so I can watch it on my local piaware radar.


Would this be a feasible/useful feature?

What is your thoughts on the usefulness of it? You want to know when an aircraft you are "watching" is nearby?

Author:  palmerit [ Fri Apr 22, 2016 6:55 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

I just think it'd be cool to know when a plane I'm interested in is being tracked by my reciever. Luckily, I happen to be close enough that I could potentially watch it taxi and such, which isn't really an option via the website itself. And finally, pilots who are close enough to the airport could know when things like maintenance people have turned on the aircraft and similar. (I'm not a pilot personally, so this is more theory than anything.)


So really, other than the "that's cool" factor, probably not a lot of practicality for most users, I guess. Without knowing the infrastructure/backend, I just thought.. you already know which aircraft I have in "My FA" and additionally the tracking part of the site knows when my reciever is picking up an aircraft (since it shows in the track log when it's my reciever that reported it) so I figured it probably wouldn't take a whole lot to add such a feature. Admittedly, without knowing.. it may be more effort than it'd be worth.

*edited for clarity*

Author:  joelwiley [ Fri Apr 22, 2016 7:47 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

You could run PlanePlotter and use a conditional expression to post an alert when one is seen.
http://www.coaa.co.uk/planeplotter.htm

Author:  palmerit [ Fri Apr 29, 2016 3:07 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

joelwiley wrote:
You could run PlanePlotter and use a conditional expression to post an alert when one is seen.
http://www.coaa.co.uk/planeplotter.htm



While this is true, I'd either need to run it on my pi (which already complains often that it can't run MLAT) or another piece of hardware. Since this installation is outdoors running in my barn, the additional hardware option isn't really a viable option.


Eh, I guess it doesn't really matter. I thought it'd be a cool idea, but if there is no interest, then it's not worth the effort even if the data is already available.

Author:  YawString [ Sat Jun 03, 2017 2:59 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

I also think this feature would be useful. Having just setup a new piaware receiver I was just trying to figure out if it was already possible. I live in sight of a couple airports with a number of interesting planes that fly in and out. Would be great to get an alert when my piaware receiver picked one up so I could go outside and watch and maybe even get a photo of it in flight. Plane plotter would be an option, but I use laptop and don't currently have a computer running 24/7 to monitor. An example might be to alert for any "RA*" tail numbers for large Russian transports.

Author:  ericcarlson [ Mon Jun 05, 2017 8:49 am ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

The idea of alerts via PiAware/FligthFeeder Skyview is something we'd like to do. It is under consideration and dependent on the technical issues involved with implementing it.

Author:  Jranderson777 [ Mon Jun 05, 2017 10:10 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

I have this little piece of code running on my PiAware box. It will email me whenever a designated aircraft is picked up. It's not elegant code. In fact, it's my first attempt at Python, so don't use this as an example of good code, but it seems to work. It was built on some examples I found by googling around. You will need an STMP server. PiAware doesn't ship with one so you'll have to add that. I used PostFix and routed everything to my IPS's SMTP server using the "send outgoing mail via" option. There is no need to set it up to receive incoming mail because there won't be any if you block it from having internet access, which is actually a good idea for a mailserver in this situation. There are likely some python classes that will send email so that might be an option for you too.

Feel free to copy and use as you wish, at your own risk. It's unsupported code.

https://www.dropbox.com/s/2awljgkict5jjas/flights.py?dl=0

Author:  invergordon [ Sun Jul 09, 2017 10:30 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

ericcarlson wrote:
The idea of alerts via PiAware/FligthFeeder Skyview is something we'd like to do. It is under consideration and dependent on the technical issues involved with implementing it.


I would find this indispensable in daily life! I have tried many options but all fail except PlanePlotter BUT, that solution requires a Windows based PC to be powered up and running 24/7, which I do not want to have to have. A RPi solution would be perfect and would allow me to receive an email alert whenever an 'interesting' aircraft or flight was picked up on my receiver. The use of wildcards would be a necessary option as I don't always know the flight number of RCH flights for example so making it like RCH% would alert me to any aircraft with a callsign beginning with RCH, that sort of thing.

Anyway, I look forward to anything the Flightaware team can put together, I'm sure it woul be a hit with at least the 'spotters' amongst us with limited resource and funds.

Author:  invergordon [ Sat Jul 15, 2017 5:14 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

Jranderson777 wrote:
I have this little piece of code running on my PiAware box.
Feel free to copy and use as you wish, at your own risk. It's unsupported code.
https://www.dropbox.com/s/2awljgkict5jjas/flights.py?dl=0


I had a go with this python3 script and it works but as I was not familiar with nor able to set up a local smtp server I wanted to use GMail for that purpose. After some fluffing around and testing this is what I had to change to get the emails goings.

Replace:

Code:
server = smtplib.SMTP('localhost')
server.sendmail ('replace with your email@yourdomain.com', ['recipientsemail@goeshere.com'], msg_full)
server.quit


With:

Code:
username = 'yourgmailusername@gmail.com'
password = 'yourgmailpassword'
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail ('yourgmailusername@gmail.com', ['recipientemailaddress'], msg_full)
server.quit


Just add some aircraft or callsigns, startup the script and wait for the news!

I hope this helps someone.

Cheers,
Michael

Author:  Jranderson777 [ Sat Jul 15, 2017 7:40 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

Thanks Michael. This is a better solution than running an SMTP server on the Pi. I just didn't know how to do it. Thanks for the code. Much appreciated. ....John

Author:  invergordon [ Sun Jul 16, 2017 12:22 am ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

You're welcome John. I will need to spend some time looking to see if I can use wildcards for the flights.

Author:  invergordon [ Tue Jul 18, 2017 3:44 am ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

Found a little piece of useful info, the HEX codes in the watch list need to be in lower case! For a couple of days I only ever got alerts on callsigns so then converted all my HEX codes to lower case and then got alerts on those as well.

Cheers,
Michael

Author:  Jranderson777 [ Tue Jul 18, 2017 10:47 am ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

Of course the other issue is that you need to start this task, and restart it if it fails. I have just used a cron job to start it at boot. This works, until the task fails. It will fail if dump1090 fails, your internet goes down, a problem prevents it from connecting to gmail etc. There are many ways to monitor and restart a failed task in Linux. On the newer Debian versions, like Raspbian, Systemctl seems to be the new way to do this. I'm not familiar with Systemctl but I think I need to read up on it.

If anyone writes a Systemctl unit to start/restart a task which depends upon dump1090-fa and the network, like this one does, perhaps they could share it.

Author:  obj [ Tue Jul 18, 2017 11:08 am ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

Jranderson777 wrote:
If anyone writes a Systemctl unit to start/restart a task which depends upon dump1090-fa and the network, like this one does, perhaps they could share it.

The piaware systemd service might be a good starting point: https://github.com/flightaware/piaware/ ... re.service

Author:  Jranderson777 [ Tue Jul 18, 2017 5:19 pm ]
Post subject:  Re: Alert when "My aircraft" is picked up by my piaware

Thanks! This seems to work for me:
OK, you'll have to take my word for it. Every time I post the code, whether in a "code" block or not, I get an error saying I don't have permission to post. What the heck is with that!

change the titles etc and I needed to added/changed these lines, plus calling the flights.py program of course.

Environment=PYTHONUNBUFFERED=1
Restart=always

Page 1 of 1 All times are UTC - 6 hours [ DST ]