10/18/2023 Map Stopped Working?
Visit this post for the fix
So, I've been troubleshooting a problem (that I'll post about momentarily), and I did some work on the way that the console log is generated in metar-v4.py. The script prints the cycle number to the stdout log, but it doesn't tell me what's going on inside the script. I added a few things to the console log and the debug log so I could tell what was going on. My console logs now look like this:
[I 200923 21:21:05 metar-v4:1110] Starting METAR Data Display
[D 200923 21:21:05 metar-v4:1169] KCCB is reporting VFR through the API
[I 200923 21:21:05 metar-v4:1120] KMHV Not Reporting Flight Category through the API.
[D 200923 21:21:05 metar-v4:1166] KMHV flight category determined by script processing as VFR
[D 200923 21:21:05 metar-v4:1169] KSLI is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KRIV is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KEDW is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KWJF is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KNXP is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KCMA is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KLAX is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KSNA is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KBUR is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KRAL is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KPSP is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KPMD is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KONT is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KFUL is reporting VFR through the API
[D 200923 21:21:05 metar-v4:1169] KLGB is reporting VFR through the API
[D 200923 21:21:06 metar-v4:1169] KVNY is reporting VFR through the API
[D 200923 21:21:06 metar-v4:1169] KAVX is reporting VFR through the API
[D 200923 21:21:06 metar-v4:1169] KDAG is reporting VFR through the API
[D 200923 21:21:06 metar-v4:1169] KVCV is reporting VFR through the API
[I 200923 21:21:06 metar-v4:1201] Decoded METAR Data for Display
0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #1: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #2: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #3: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #4: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #5: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #6: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #7: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #8: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
WX Display #77 Cycle Loop #9: 0/LED.. 1/LED.. 2/LED.. 3/LED.. 4/LED.. 5/LED..
I made a couple of changes that helped me understand what the script was up to:
- The debug log now prints out what's happening along with the airport code. Rather than just saying "KCCB", it will tell you that the API is reporting the flight category, or the script has processed the METAR to determine the category. (This is interesting to me because I'm trying to learn about what comes through the API vs what is deduced from the METAR.)
- I found the Cycle Num printout distracting, because it scrolled the screen rapidly and didn't do a good job of telling me where in the loop something was. So what I did was added a tiny bit of recordkeeping, so each cycle of 6 blinks is recorded individually, and then the number of times the script goes through the main loop is also recorded. At a glance, I can see the numbers going up on the console and it tells me the script is still happy. There's one additional bit of recordkeeping, which is that the cycle number (0-6) is printed out when you enter the loop, "LED." is printed out when the strip is updated, and the second period is printed out when the strip update returns. A complete cycle of six blinks is put on one line.
- I get an idea for how much uptime I have by looking at the number of weather fetches that have been performed (in the above case 77, which is about two days with my map's sleep schedule).
Not that I expect a lot of people will be posting patches here, but just in case... I've worked with Mark to get the software on github for version control, and the patch is in his master tree!
In case you want to see it, here's the link - https://github.com/markyharris/livesectional/commit/b0ebf95778a5588736bd989d6dbca684437dc81d But it's likely to be in the next rev of the software!
Thanks for all the help with this. It's still a learning experience but I can see the benefits. - Mark