diff --git a/data.txt b/data.txt index db147e2..54f8349 100755 --- a/data.txt +++ b/data.txt @@ -1,9 +1,9 @@ -KFLG --2 +KSEZ +1 60 0 -2 -0 0 1 1 +0 +0 diff --git a/metar_main.py b/metar_main.py index df8f274..ebbee3f 100755 --- a/metar_main.py +++ b/metar_main.py @@ -54,8 +54,6 @@ # Layouts - add new layouts to this list as necessary layout_list = [layout0,layout1,layout2,layout3,layout4,layout5,layout6,layout7,layout8,layout9] # ,layout6 Add layout routine names here -global startup_flag -startup_flag = 0 # will be reset to 1 once the IP URL is displayed. # Check for cmdline args and use passed variables instead of the defaults # example ['/home/pi/metar/metar_main.py', 'metar', 'kabe', '1', '0', '1', '2', '0', '0', '1', '1'] @@ -83,15 +81,9 @@ def main(): global display,metar,remarks,print_table,use_remarks,use_disp_format,interval,wind_speed_units,cloud_layer_units,visibility_units,temperature_units,pressure_units,layout_list - global startup_flag - # Choose which layout to use. - if startup_flag == 0: #use_disp_format == -3: - disp_ip(display, get_ip_address()) - print('---> use_disp_format:',use_disp_format) # debug - print('---> interval:',interval,'\n') # debug - - elif use_disp_format == -1: + # Choose which layout to use. + if use_disp_format == -1: random_layout(display,metar,remarks,print_table,use_remarks,use_disp_format,interval,wind_speed_units,cloud_layer_units,visibility_units,temperature_units,pressure_units,layout_list) elif use_disp_format == -2: @@ -160,12 +152,8 @@ def main(): # The update interval can be selected via cmd line or web iterface # If Auto Interval is selected, then Flight Category dictates update # So the worse the weather, the more often it updates. - if startup_flag == 0: - startup_flag = 1 - print("sleep 1 min for Admin URL") - time.sleep(60) - elif interval != 0: # if not auto interval selected + if interval != 0: # if not auto interval selected print("sleep ",interval) # debug time.sleep(interval) # Sets interval of updates. 3600 = 1 hour diff --git a/metar_startup.py b/metar_startup.py new file mode 100644 index 0000000..6a78c69 --- /dev/null +++ b/metar_startup.py @@ -0,0 +1,34 @@ +from metar_layouts import * +from metar_routines import * +import time + +# epd7in5b_V2 = 3-color 7 by 5 display. Change this based on the display used. +# find 'epd = epd7in5b_V2.EPD()' towards bottom and change also if needed. +# These are located in the directory 'waveshare_epd' +from waveshare_epd import epd7in5b_V2 + + +if __name__ == "__main__": + epd = epd7in5b_V2.EPD() # Instantiate instance for display. + epd.init() + epd.Clear() + display = Display() # pass to routines + + disp_ip(display, get_ip_address()) + + # Print to e-Paper - This is setup to display on 7x5 3 color waveshare panel. epd7in5b_V2 + print("Updating screen...") + try: + epd.init() + time.sleep(1) + print("Printing METAR Data to E-Paper") + epd.display(epd.getbuffer(display.im_black), epd.getbuffer(display.im_red)) + print("Done") + time.sleep(2) + + except Exception as e: + print("Printing error", e) + + print("------------") + print("Done") + diff --git a/templates/metar.html b/templates/metar.html index 4759eea..4edaf63 100755 --- a/templates/metar.html +++ b/templates/metar.html @@ -23,11 +23,11 @@ } .myDiv span{ text-align: center; - background: #b1cafc; + background: #ffffff; padding: 6px 6px; display: block; - width: 400px; - border: 1px solid blue; + width: 120px; + border: 0px solid blue; margin: 8px auto; font-family: Arial, Helvetica, sans-serif; } @@ -72,7 +72,7 @@

METAR E-Paper Display Admin Page

- +
+
+
+

+

+ +

+
+

+

+ +

+
+

+

+ +

+
+

+

+ +

+
+

+

+ +

+
+

+

+ +

+
+

+

+ +

+
+

+

+ +

+
@@ -200,26 +242,32 @@

METAR E-Paper Display Admin Page

- - -

- - -


- -
- {% with messages = get_flashed_messages() %} - {% if messages %} -
- {% for message in messages %} -
{{ message }} - {% endfor %} + + + + + + + +
+ + + + +
+ {% with messages = get_flashed_messages() %} + {% if messages %} +
+ {% for message in messages %} +
{{ message }} + {% endfor %} + {% endif %} + {% endwith %} +
+
- {% endif %} - {% endwith %} -
-
+