Notifications
Clear all

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

[Sticky] Airport Editor Introduction

4 Posts
2 Users
0 Reactions
1,501 Views
Mark Harris
(@markyharris)
Member Admin Registered
Joined: 5 years ago
Posts: 557
Topic starter  

One of the barriers to building this project is dealing with the Raspberry Pi's (RPI) command line syntax. This can be intimidating for some. So the Airport Editor was set-up to allow the building of the 'airports' file that is used by the software. This utility is accessible from a browser run directly on the RPI, or a browser on any other computer that has access to the RPI. So use on a headless system is quite easy.

The 'airports' file is simply a text file with a 4 character airport ID in capital letters/numbers on a separate line with a carriage return (new line) after each. Other than airport ID's, 'NULL' and 'LGND' are used to designate unused LED positions and Legend positions respectively. Here's a short example of what the 'airports' file looks like;

NULL
NULL
LGND
LGND
KPHX
KSEZ
KFLG
KSOW

The screen is setup into 5 major areas.

  • The top most is the banner which reports the IP address that the RPI is assigned. 
  • The next area is a sticky table that will remain at the top of the screen even while the rest of the screen is scrolled.
    • This area contains buttons that allow the user to turn on and off individual LED's.
    • It also provides a button that will allow the user to search for an airport by ID, name or city.
    • Finally provides a button that allows all edits to be erased and restored to its original state.
  • The third area includes;
    • A text box that will display the total number of LED's being used in the project. This number can be changed to add or subtract the total number LED's needed for the project.
    • Import Airports button. This is helpful if there is another airports file that the user would like to start with. Note; these imported airports will not be save until the 'Save Airports' button is clicked.
  • The fourth area is the working area that allows the user to match the pin number to the appropriate 4 character airport ID.
  • The fifth and final area is a sticky table that will remain at the bottom of the screen regardless of the scrolling. This area contains buttons that allow for saving the airport data along with controlling the map itself.

Lets discuss each area in more detail.

Banner 
The banner provides the IP address that the RPI has been assigned. The web address for the airport editor will then be 'address:5000/apedit'. The user can run this utility from any web browser that has access to this address. For instance, 192.168.254.54:5000/apedit. The user can utilize port forwarding to the IP address and utilize this utility from outside the local network. Visit https://portforward.com/ for information on how to set up a router with port forwarding.

LED Control
One of the most tedious parts of building the map is correctly matching the airport ID to the proper LED pin number. This utility will allow the user to turn on 1 LED at a time and determine which airport it is representing, then fill out the proper pin with the appropriate airport ID.

There is a text box that the user can enter the desired pin number, then hit 'LED On' to see where it is on the map. The 'Next' and 'Previous' button will increment/decrement through the LED string one at a time. The main portion of the screen will reposition so that the appropriate pin is at the top of the screen, making it easy for the user to enter the proper airport ID.

There are two more buttons which will allow the user to turn on/off all the LED's all at once. This is helpful to ensure that the string of LED's is properly wired.

This section also includes a button that will load a web page that allows the user to lookup an airport by ID, Name or City. This is helpful if the user is not sure of the proper airport ID.

This section includes a button that will reset any edits made and restore the airports from the latest saved version. This is done by reloading the 'airports' file and erasing any edits made. So its important to remember to click the 'Save Airports' button whenever you want to save your work.

Finally, this section will NOT save any airport ID edits made when any of the buttons are pressed. So it's important to edit the airport ID, and use the 'Enter' key (or click 'Save Airports' button) before moving to the next airport. On the other hand, if the LED control feature is not being used, the builder can simply enter each airport, and tab between textboxes, then click 'Save Airports' when compete. 'Enter' will save an edit, 'Tab' will not.

LED Number/Import Airports
A sample 'airports' file is included with the Live Sectional image, but invariably it won't include the proper number of LED's used for a particular build. So the LED number textbox allows the user to specify the number of LED's needed for the build. If extra LED's are added, they will be populated with 'NULL'. The changed number of LED's will not automatically save. The user must click 'Save Airports' to save the newly sized number of LED's.

The Import Airports 'Choose File' button allows the user to select a file that is structured properly and fill in all the boxes at once with airport ID's. Keep in mind, that there is no limitation made on the file type, nor structure. So selecting a file that is not in proper format will fill in the text boxes with gibberish. If this happens, click the 'Restore Airports' button to start over. This feature will not save the airports automatically. The user must click 'Save Airports' to save any changes.

Working Area
This is where each airport ID is placed next to the proper pin number of the LED string. Keep in mind that the first LED in the string is number zero. So a string of 50 LED's will be numbered from 0 through 49.

A few rules will be enforced by this editor;

  • Each airport must be 4 characters in length.
  • Airport ID must be capitalized. Editor will force capitalization.
  • If an airport ID is 3 characters in length, then the user must include the appropriate regional code. For instance, 'K' for continental US. So airport P52 needs to be entered as; KP52. If less than 4 characters are entered, an alert will pop up.
  • There are 2 special entries that can be used;
    • NULL - is used if an LED will not be used. This is common due to build variations. A bulb is just not needed, so it should remain off.
    • LGND - This must be entered at the appropriate LED pin number that will be representing a Legend. The use of a legend is optional and is set up in the configuration editor.

Finally, there is a description of the entered data. When an airport is entered, a link to an FAA site is created so the user can double check to be sure the proper airport ID is being used. This site will open in a new window.

Note: every time focus is put on an airport textbox, the entry that was there will be erased allowing for a new entry. Once a new airport is entered and focus is changed away from that textbox, the script will automatically save that new airport to the data file. Pressing Tab, or Enter is recommended when editing the airports. The other option is to click the 'Save Airports' button at the bottom after each edit.

Save and Map Control Buttons
The bottom of the screen contains a number of buttons that allow the user to save and control the map.

  • 'Save Airports' - Any changes made must be stored in the 'airports' file by clicking this button. No changes are saved until this button is pressed.
  • 'Shutoff Map' - As the name suggests, if the map is running this button will turn it off. It does not reboot or power down the RPI.
  • 'Edit Settings' - This will take the user to the configuration editor. Be sure to click 'Save Airports' first to save any changes made.
  • 'Reboot Map' - This button will cause the RPI to go through the reboot process. This is a good option if things are not working as expected.
  • 'Startup Map' - This will run the Live Sectional map and turn on the LED and displays if used. 
  • 'Help' - Brings the user to this help page.
  • 'Shutdown RPI' - This will shutdown the raspberry pi safely.
  • 'DL airports' - This will download the 'airports' file from the RPI to the local computer. Good for backup, or editing outside of this editor.

The goal is to marry the airport ID to the proper Pin number on the LED string/strip. This file can be created manually using a text editor then imported into this editor to verify all is good, or the user can manually enter each airport into the individual text boxes. The added benefit is the ability to light up each airport one at a time to verify that the airport ID is matched properly with the LED pin.

apedit2

 

This topic was modified 5 years ago by Bill

   
Quote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

Hi Mark, why is there a limitation of 500 airports maximum? Can it be increased to unlimited?


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

I'm sure it can, but from a practical standpoint its hard to believe a board could be built that would support more than 500. If you would like more, let me know what number you are looking for and I'll see what it takes to increase the limit. - Mark

Note: Please visit post https://www.livesectional.com/community/postid/1147/. This shows that I was absolutely wrong regarding the upper limit of LED's that can be built. As you will see from this post, the map he built has over 1800 LED's on it, and it is a sight to behold.


   
ReplyQuote
Bogdan
(@bogdan)
Active Member
Joined: 3 years ago
Posts: 12
 

Got it, thanks! I will need more if we will be able to make it happen with autotaf thing. For now waiting the folk to update his database and produce API. Will let you know.


   
ReplyQuote
Share: