ScottSturdivant / rpi_metar

METAR LED Display for a Raspberry Pi
MIT License
26 stars 17 forks source link

AUS METARs causing failures when no US METARs in config file #6

Closed thommo17 closed 5 years ago

thommo17 commented 5 years ago

When the config file has only Australian METARs the program will freeze and all the LED's will show as yellow but if a US METAR is in the config file anywhere then it will work perfectly.

I have tried no US METARs in the list and also KDTW at positions 0, 23, 50 and 120 on a series of 100 lights and it always works when a US code is in the config file but never if it is just AUS METARs

Attached is a config file that causes it to fail

rpi_metar.conf.txt

ScottSturdivant commented 5 years ago

Thank you for the bug report!

The issue is that when the data sources are created, the Sky Vector one fails: https://github.com/ScottSturdivant/rpi_metar/blob/develop/rpi_metar/core.py#L55

The reason it fails is because this particular data source uses lat/long information to submit a query against Sky Vector's API that encompasses the entire region. I ship a file containing lat/long info for US airports, but this fails for AUS ones only.

I will make a change that initializes the data sources in such a way that successful ones will be utilized while failures are ignored.

It would still be nice to include Sky Vector as a source, just in case sky vector is being flaky so I will also look for a file containing AUS lat/long info.

In the interim, does setting KDTW = 120 function as a workaround for you?

ScottSturdivant commented 5 years ago

You should now be able to do the following:

# /opt/rpi_metar/bin/pip install -U rpi_metar
# systemctl restart rpi_metar

Please let me know if this works for you!

thommo17 commented 5 years ago

Thanks for looking into it so quickly!

Yes the work around did work when I set KDTW = 120

I have now updated to 0.3.4 after getting a few failed to build wheel messages which I got past by just rebooting and then using sudo

I can confirm it is now working and I have rebooted again just to make sure it starts up properly too.

As for the other source I might have a good one for you regarding Australian METARs. In Aus we don't have ForeFlight but we do have AvPlan and the dev is very active in the pilot community and I have emailed him a few times before. If I knew what format of data is needed I could shoot him an email and see if he can help as AvPlan already gets all METARs to show on the charts as a colour

ScottSturdivant commented 5 years ago

Thank you for the tip, I will look into AvPlan and see if I can't get that added. I appreciate your feedback!

thommo17 commented 5 years ago

I've found a code here that may give you some insight into adding Aussie METARs

http://hackage.haskell.org/package/metar

Please let me know if that is possible. Thanks :)