Jxck-S / plane-notify

Notify if a selected plane has taken off or landed using ADS-B data. Compares older data to newer data to determine if a landing or takeoff has occurred. As well as nav modes, emergency squawk and resolution advisory notifications. Can output to Twitter, Discord, Mastodon, and Telegram
GNU General Public License v3.0
2.5k stars 432 forks source link

No Output and Attibute Error Message #63

Closed CW120980 closed 2 years ago

CW120980 commented 2 years ago

Hi

Firstly, I'm very new to Python so forgive me.

I think I have the program running and it seems to be checking regularly as expected; however, as soon as the Plane takes off (I presume it then starts to output and thats when the error is triggered. I am using PushBullet to receive the output, the program stops with the following error below.

I am using OpenSky as the source currently.

C:\PythonPrograms\plane-notify-multi>python main.py Already have Roboto-Regular.ttf continuing Already have airports.csv continuing Already have regions.csv continuing Already have ADSBX_Logo.png continuing Already have Mictronics_db.zip continuing C:\PythonPrograms\plane-notify-multi Route lookup is disabled Source is set to OPENS Found the following configs ./configs\plane1.ini 1 Planes configured -------- 1 -------- 12:55:58 PM -------------------------------------------------------------------- ---BEGIN---------./configs\plane1.ini------------------------------------------------ICAO: 4006C2--- Traceback (most recent call last): File "C:\PythonPrograms\plane-notify-multi__main.py", line 217, in raise e File "C:\PythonPrograms\plane-notify-multi\main.py", line 165, in obj.run_opens(dataState) File "C:\PythonPrograms\plane-notify-multi\planeClass.py", line 83, in run_opens self.dict__.update({'icao' : ac_dict.icao24.upper(), 'callsign' : ac_dict.callsign, 'latitude' : ac_dict.latitude, 'longitude' : ac_dict.longitude, 'on_ground' : bool(ac_dict.on_ground), 'squawk' : ac_dict.squawk, 'track' : float(ac_dict.heading)}) AttributeError: 'StateVector' object has no attribute 'heading'

This error happens as I'm literally watching the flight from ADBS take off;

image

As soon as the plane takes off, I manually check the JSON for this plane and it returns the following;

image

This would show the plane as on the ground?? So that tells me their API has not updated?

I can see ADS-B API is preferred, but I cannot see where I can purchase a key (one that is not RapidAPI)? Or is there a test one I can use.

Any advise of what is happening here would be gratefully received!

Thank you in advance!

kyotometus commented 2 years ago

Edit:

There is a fix already: https://github.com/Jxck-S/plane-notify/pull/44

Just change headingto true_track.

Jxck-S commented 2 years ago

Fixed pushed to main branch update planeClass.py on your instance.