METARs not decoding
 
Notifications
Clear all

10/18/2023 Map Stopped Working?
Visit this post for the fix

METARs not decoding

6 Posts
2 Users
0 Reactions
951 Views
(@zeroengineland)
Trusted Member
Joined: 4 years ago
Posts: 52
Topic starter  

I'm chasing another something in the map that causes a problem.  I noticed that my map was dark before the time it was supposed to go dark, so I looked in the log and the last lines were:

[I 200920 21:32:58 metar-v4:573] Internet Available

[I 200920 21:32:58 metar-v4:574] https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=2.5&stationString=KSBA,KCMA,KVNY,KBUR,KSMO,KLAX,KLGB,KFUL,KSLI,KAVX,KSNA,KCCB,KONT,KRAL,KRIV,KPSP,KTRM,KNXP,KDAG,KVCV,KEDW,KMHV,KPMD,KWJF

[I 200920 21:32:58 metar-v4:1108] Starting METAR Data Display

The "Starting METAR Data Display" line is normally followed by "Decoded METAR Data for Display" after it checks to see that the flight category came from the API, and if not, it processes cloud cover and visibility to find the flight category.  Unfortunately, I didn't have it doing debug logging, and when I noticed the map was dark I ran the script manually and it was fine, so I don't have a good diagnosis.


   
Quote
Mark Harris
(@markyharris)
Member Admin Registered
Joined: 5 years ago
Posts: 557
 

I haven't noticed this being a problem. But I'll try to play with it on my boards.

If you have a monitor connected, and its actually in the Sleep mode, then it will display 'Sleeping - zzzzzzzzzzzzzzzz' in green. You can also see 'Map Going to Sleep' in the logfile when its in the sleep mode. So take a look for those. If you don't find them, then its not a sleep mode issue. - Mark


   
ReplyQuote
(@zeroengineland)
Trusted Member
Joined: 4 years ago
Posts: 52
Topic starter  

It's not the map going to sleep.  I have my map set up to sleep from 10:30 pm to 8:30 am.  Here's the overnight log:

[I 200920 22:22:24 metar-v4:1199] Decoded METAR Data for Display

[I 200920 22:30:00 metar-v4:1226] Map Going to Sleep

[I 200921 08:30:03 wipes-v4:38]

    

    Startup of wipes-v4.py Script, Version v4.1

[I 200921 08:30:03 wipes-v4:39] Log Level Set To: 20

[I 200921 08:30:16 wipes-v4:696] maxlat = 35.07 minlat = 33.4 maxlon = -116.13 minlon = -119.1

[I 200921 08:30:16 wipes-v4:697] sizelat = 1.67 sizelon = 2.97 centerlat 34.23 centerlon = -117.61

[I 200921 08:30:17 wipes-v4:735] Executing Up/Down-Side to Side Wipe

[I 200921 08:30:20 wipes-v4:796] Turning Off all LEDs

[I 200921 08:30:20 metar-v4:528] Calling wipes script

[I 200921 08:30:20 metar-v4:540] Airports File Loaded

[I 200921 08:30:20 metar-v4:546] METAR Data Loading

[I 200921 08:30:20 metar-v4:573] Internet Available

[I 200921 08:30:20 metar-v4:574] https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=2.5&stationString=KSBA,KCMA,KVNY,KBUR,KSMO,KLAX,KLGB,KFUL,KSLI,KAVX,KSNA,KCCB,KONT,KRAL,KRIV,KPSP,KTRM,KNXP,KDAG,KVCV,KEDW,KMHV,KPMD,KWJF

[I 200921 08:30:21 metar-v4:1108] Starting METAR Data Display

[I 200921 08:30:21 metar-v4:1199] Decoded METAR Data for Display

[I 200921 08:45:23 wipes-v4:38]

    

    Startup of wipes-v4.py Script, Version v4.1

[I 200921 08:45:23 wipes-v4:39] Log Level Set To: 20

[I 200921 08:45:24 wipes-v4:696] maxlat = 35.07 minlat = 33.4 maxlon = -116.13 minlon = -119.1

[I 200921 08:45:24 wipes-v4:697] sizelat = 1.67 sizelon = 2.97 centerlat 34.23 centerlon = -117.61

[I 200921 08:45:25 wipes-v4:735] Executing Up/Down-Side to Side Wipe

[I 200921 08:45:27 wipes-v4:796] Turning Off all LEDs

[I 200921 08:45:28 metar-v4:528] Calling wipes script

[I 200921 08:45:28 metar-v4:540] Airports File Loaded

[I 200921 08:45:28 metar-v4:546] METAR Data Loading

[I 200921 08:45:28 metar-v4:573] Internet Available

[I 200921 08:45:28 metar-v4:574] https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=2.5&stationString=KSBA,KCMA,KVNY,KBUR,KSMO,KLAX,KLGB,KFUL,KSLI,KAVX,KSNA,KCCB,KONT,KRAL,KRIV,KPSP,KTRM,KNXP,KDAG,KVCV,KEDW,KMHV,KPMD,KWJF

[I 200921 08:45:28 metar-v4:1108] Starting METAR Data Display

[I 200921 08:45:28 metar-v4:1199] Decoded METAR Data for Display

[I 200921 09:00:28 wipes-v4:38]

    

    Startup of wipes-v4.py Script, Version v4.1

[I 200921 09:00:28 wipes-v4:39] Log Level Set To: 20

[I 200921 09:00:29 wipes-v4:696] maxlat = 35.07 minlat = 33.4 maxlon = -116.13 minlon = -119.1

[I 200921 09:00:29 wipes-v4:697] sizelat = 1.67 sizelon = 2.97 centerlat 34.23 centerlon = -117.61

[I 200921 09:00:30 wipes-v4:735] Executing Up/Down-Side to Side Wipe

[I 200921 09:00:32 wipes-v4:796] Turning Off all LEDs

[I 200921 09:00:32 metar-v4:528] Calling wipes script

[I 200921 09:00:33 metar-v4:540] Airports File Loaded

[I 200921 09:00:33 metar-v4:546] METAR Data Loading

[I 200921 09:00:33 metar-v4:573] Internet Available

[I 200921 09:00:33 metar-v4:574] https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=2.5&stationString=KSBA,KCMA,KVNY,KBUR,KSMO,KLAX,KLGB,KFUL,KSLI,KAVX,KSNA,KCCB,KONT,KRAL,KRIV,KPSP,KTRM,KNXP,KDAG,KVCV,KEDW,KMHV,KPMD,KWJF

[I 200921 09:00:33 metar-v4:1108] Starting METAR Data Display

Unfortunately, it's not in the room that I was in from 8:30-9 this morning, so I don't know if it lit up when it was supposed to.  But I can tell you that the sequence of events I observed last night is:

  1. I restarted the map from the Web UI around 9 pm.  It refreshed at 9:02, 9:17, 9:32, 10:06, and 10:22.  I verified a couple of these transitions by looking at the map.
  2. At 10:30, the map went to sleep as it was supposed to.
  3. (I was not in the room at 8:30 am to see if the map woke up as it was supposed to)
  4. At 9:15 am, I looked at the map and it was dark.
  5. There have been no transition wipes since 10 am.  The map is on - I am logged into the Pi - but there's no apparent effect from anything, and the log has been quiet for the last 2 hours.

I'm going to bump up the debug level (where I log all the LED color commands for every cycle to see what I can learn, though there will be some disk space cost).


   
ReplyQuote
Mark Harris
(@markyharris)
Member Admin Registered
Joined: 5 years ago
Posts: 557
 

There won't be any extra disk space used in debug mode, it just overwrites what's already in the logs. There are actually 4, the main one and 3 older versions. They just keep rolling over from the most current to the oldest.

The log is showing that the software is doing what its supposed to do. It is showing that the map woke up at 8:30 am. So not sure what's happening.

If you have a monitor connected, verify that the script didn't crash for some reason (while I doubt there is based on the log). - Mark


   
ReplyQuote
(@zeroengineland)
Trusted Member
Joined: 4 years ago
Posts: 52
Topic starter  

I don't have a monitor connected (and this is hanging on the wall, so it'd be hard to get a monitor connected for a variety of reasons).  Instead, I installed screen, so I can run the script from the command line (sudo python3 metar-v4.py) and have a terminal window that persists across SSH sessions.  It should be almost the same, if not exactly the same, as connecting a monitor to the Pi.

I do have a couple of extra debug messages that I'm printing out beyond what's in your image - I log what the API fetches for each airport, and I can tell whether the airport METAR is picked up from the API or inferred from the cloud cover and visibility.

I'm not sure what's going on yet, but it looks like it's getting hung up in the METAR decode.  Normally, you get a "Starting METAR Data Display" log when you fetch the data from the API, followed by a "Decoded METAR Data for Display" when that block of code finishes.  I see the "starting" log message when my map stopped working, but not a "decoded" message, indicating we got hung up in the decode block.  Normally, the API returns the flight category so there's no work for the "manual" decode part of that block.


   
ReplyQuote
(@zeroengineland)
Trusted Member
Joined: 4 years ago
Posts: 52
Topic starter  

I think I've got something, but it may relate to one of my added logging messages.  One of the current station reports I'm getting is for MHV (the Mojave Spaceport).  This is the current METAR:

<METAR>

<raw_text>KMHV 212100Z AUTO A2998 RMK A01</raw_text>

<station_id>KMHV</station_id>

<observation_time>2020-09-21T21:00:00Z</observation_time>

<latitude>35.07</latitude>

<longitude>-118.15</longitude>

<altim_in_hg>29.97933</altim_in_hg>

<quality_control_flags>

<auto>TRUE</auto>

<auto_station>TRUE</auto_station>

</quality_control_flags>

<metar_type>METAR</metar_type>

<elevation_m>841.0</elevation_m>

</METAR>
 

It doesn't have a flight category automatically reported, so the script was dying.

The stock debug scripts just printed out the airport code, and when I was chasing down some other bug, I added some debug code so the debug log would tell me whether the flight category was reported via the aviationweather.gov API or "calculated" from the sky condition (ceiling/viz).  However, since I'm not a good Python programmer, my additions were getting in the way.  I think I've fixed at least that problem now.

I'll let it run for a bit longer, and when it seems to be working I'll post a patch.


   
ReplyQuote
Share: