Notifications
Clear all

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

Map stuck during transitional wipe

13 Posts
4 Users
0 Reactions
1,497 Views
(@julien220)
Eminent Member
Joined: 4 years ago
Posts: 21
Topic starter  

Hi everyone,

I built a map for my aeroclub and on several occasions, it got stuck during the transitional wipe (rainbow). For it to be unstuck, I needed to manually reboot the system via the webapp. Difficult to say when it happened and under which circumstances as I was never there at the time.

What I do know, is that it must have been an auto refresh, as the buttons are not accessible to the public. The internet connection is also pretty slow.

Anybody have a similar issue?

 

- Julien


   
Quote
 Bill
(@liveadmin)
Member Admin Registered
Joined: 5 years ago
Posts: 0
 

Hi Julien,

Have you updated to the latest release of LiveSecitonal?  It should resolve some of the issues you are running into.

 

Thanks,

 

Bill


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

Hi Julien. This typically happens when there is an interruption in the internet. The software will continue looking for access and get stuck at the wipe. So the latest update includes a reboot every night to help with this issue. So download the latest image. Just be sure to download your config.py, airports and hmdata files from your board first (under Map Utilities) before you reburn your SD card so its quicker to get it up and running again. - Mark


   
ReplyQuote
(@julien220)
Eminent Member
Joined: 4 years ago
Posts: 21
Topic starter  

Thanks for your answers. A scheduled reboot was what I was looking for. I'll download it when I am home! 

-Julien


   
ReplyQuote
(@julien220)
Eminent Member
Joined: 4 years ago
Posts: 21
Topic starter  

Hi guys, the latest update seems to be helping. The map will now unfreeze itself once the program finds proper data to display.
Thanks for that!

 

Now, I think I might have found the reason (or maybe one of the reasons) for the frequent freezes of my map.
Here is an extract of the logfile when the map last froze. This parts keeps on looping:

Startup of metar-v4.py Script, Version v4.371
[I 210411 23:17:13 metar-v4:108] Log Level Set To: 20
[I 210411 23:17:13 metar-v4:316] Watching /NeoSectional/config.py For Change
[I 210411 23:17:13 metar-v4:347] metar-v4.py Settings Loaded
[I 210411 23:17:13 metar-v4:572] Airports File Loaded
[I 210411 23:17:13 metar-v4:578] METAR Data Loading
[I 210411 23:17:13 metar-v4:606] RPI IP Address = 192.168.0.43
[I 210411 23:17:14 metar-v4:610] Internet Available
[I 210411 23:17:14 metar-v4:611] https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&mostRecentForEachStation=constraint&hoursBeforeNow=2.5&stationString=LSZA,LSZL,LSZH,LSME,LSZC,LSMA,LSMM,LSZB,LSZG,LFSB,EDNY,LSZR,LSZS,LIME,LIMC,LSGS,LSMP,LSGC,LSGG,LFLP,LFLB,LIMW
[I 210411 23:17:14 metar-v4:1154] Starting METAR Data Display
[I 210411 23:17:14 metar-v4:1166] LSZG Not Reporting Flight Category through the API.
[I 210411 23:17:14 metar-v4:1173] FAA xml data is NOT providing the forecast field for this airport
[I 210411 23:17:24 check-display:68] -- killin metar-v4.py
[I 210411 23:17:27 check-display:71] -- Restarting metar-v4.py
[I 210411 23:17:28 metar-v4:107]

The airport LSZG seems to be the problem. Here is the METAR from AviationWeather:

<METAR>
<raw_text>LSZG 112050Z AUTO 22009KT 9999 -RA BKN/// 09/06 Q1015</raw_text>
<station_id>LSZG</station_id>
<observation_time>2021-04-11T20:50:00Z</observation_time>
<latitude>47.17</latitude>
<longitude>7.42</longitude>
<temp_c>9.0</temp_c>
<dewpoint_c>6.0</dewpoint_c>
<wind_dir_degrees>220</wind_dir_degrees>
<wind_speed_kt>9</wind_speed_kt>
<visibility_statute_mi>6.21</visibility_statute_mi>
<altim_in_hg>29.970472</altim_in_hg>
<quality_control_flags>
<auto>TRUE</auto>
</quality_control_flags>
<wx_string>-RA</wx_string>
<metar_type>SPECI</metar_type>
<elevation_m>428.0</elevation_m>
</METAR>

Seems like AviationWeather cannot / does not interpret the /// in the cloud layers part. Notice that the attributes sky_condition, as well as the flight_category are missing.

When taking a look into the METAR decode routine, it seems to me that there is no check to verify if the sky_condition attribute actually exists or not. In this case, a missing sky_condition would block the code from going any further in the decoding process, thus the program killing metar-v4.py and restarting it in a loop, until correct data is found and everything goes back to normal.

My idea would be to add a check to verify if sky_condition exists
1. if yes, the decoding proceeds as before
2. if no, this means the ceiling can't be found, therefore the weather cannot be decoded and the airport weather should be reported as missing.

What do you guys think? I hope my explanation is clear enough, it's sometimes difficult to put words on things I don't fully understand, like Python code!  🤯 

Thanks a lot,

 

- Julien


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

Very cool. I've not seen this issue before. I'll take a look to see what's happening. 

I'm out of town this week, so feel free to remind me next week. - Mark


   
ReplyQuote
(@julien220)
Eminent Member
Joined: 4 years ago
Posts: 21
Topic starter  

Hi Mark,

Just nudging again 😉 

- Julien


   
ReplyQuote
(@julien220)
Eminent Member
Joined: 4 years ago
Posts: 21
Topic starter  

So, as it turns out it might have been one of my code adaptations that might have made the maps freeze. The part I modified has now been corrected and the map does not freeze anymore!

One question though Mark, you mentioned in another post that you "tested the XML data", may I ask how you do it? Is there a way to point the whole system to specific weather data or test data for troubleshooting?

Thanks,

- Julien


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

Yes, I use the URL with all the airports to manually pull the XML data into a browser, then I copy it and save it to a file such as 'xmldata.xml' and store it in the /NeoSectional directory. Then I change the code in metar-v4.py to use this file instead of the URL for the FAA. So it would look something like this;

Around line 95 add
    import xmldata

Before line 615 (root = ET.fromstring(content)) add
    content = xmldata

NOTE: I'm doing this from memory so the actual format of the 'content = xmldata' may be different. I'd have to try it again to get the corrected syntax. But it should give you the idea.

The software will then ignore the FAA data and overwrite 'content' with the data saved in the 'xmldata.xml' file. Then I can change the values as necessary in 'xmldata.xml' to what I need to test.

Another way is to save the 'xmldata.xml' to a web server and point 'url' to the new web address and pull the xml data that way.

I've also saved the xmldata into a python list, i.e.
    content = [ xml data here ]

then save the file with the data in it, then delete it when I'm done.

So there are a few ways to do this.

Hope this helps. - Mark


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

Both my maps froze up during a wipe today because the wipe script died.  It looks like the script might not have a complete list of airports, since it appears the airport list to the wipe script is empty.

(This is a fairly old image, I'll update it and see if the error persists.)

 

Here's the backtrace, for the record, since I've already cut and pasted it:

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

[I 210427 14:19:12 wipes-v4:39] Log Level Set To: 20

.Traceback (most recent call last):

  File "/NeoSectional/metar-v4.py", line 542, in <module>

    exec(compile(open("/NeoSectional/wipes-v4.py", "rb").read(), "/NeoSectional/wipes-v4.py", 'exec')) #Get latest ip's to display in editors

  File "/NeoSectional/wipes-v4.py", line 687, in <module>

    maxlat = max(latlist)                       #Upper bounds of box

ValueError: max() arg is an empty sequence


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

I have updated the script to test for the lat/lon numbers in the returned FAA xml data. But it hasn't been uploaded to the web site yet. I can work on putting the image together so it can be posted, but if you want it sooner, I can send the script involved to see if it will fix the issue. 

For some reason, at times the FAA data isn't including the lat/lon for the airport and this will cause issues for the software. So the update tests for it and puts a dummy value of '0' into the list.

Let me know your preference. - Mark


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

@markyharris if you post/send either the script or a diff/patch with the fix, any of those work for me.  (Or just check it into github where I can pull it - I think I haven't updated the software since last fall, so I'm due for an update, and a git pull would be easy!)

The FAA seems to be returning null lat/long values a lot more often today.  I can tell when my LEDs don't update, and I've used the manual update button to test for the script dying because if you hit the refresh button and metar.py isn't running, it won't wipe. 😆 


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

Here's the change I made at (or around) line 1569 of webapp.py;

try:
    lat = led_map_info.find('latitude').text
    lon = led_map_info.find('longitude').text
except:
    lat = '0'
    lon = '0'

lat_list.append(lat)
lon_list.append(lon)

You can grab the file from github here;

sudo wget  https://raw.githubusercontent.com/markyharris/livesectional/master/webapp.py 

Be sure to rename or delete the original webapp.py in the /NeoSectional directory before downloading the new file from GitHub.

sudo mv webapp.py webapp.py.bkup

Let me know if this helps. - Mark

 


   
ReplyQuote
Share: