MAKER:markyharris/Translated by:趣无尽
This retro METAR (Meteorological Aerodrome Report) tri-color e-ink display not only has a strong nostalgic feel but can also display more than a dozen types of information simultaneously. Although such small devices are primarily needed by pilots, it does not stop aviation enthusiasts from DIYing one to place on their desks.
Project Features
1. The e-ink display has three display modes: intermittent loop update display, random display, and automatic interval display. Taking weather changes as an example, set the weather change to VFR, and update once every hour. Weather changes, especially severe weather changes, can be very fast, so updating too frequently is meaningless. 2. The script can run from the command line without cmd line parameters. At the same time, it can also be managed through a web interface.
In the web interface, you can clear the display, restart or shut down the host, and adjust the layout and update interval at any time. I recommend managing the display this way. 3. Uses Python 3 programming. The library provided by Waveshare drives the display, such as PIL, Numpy, and Flask. 4. The e-ink display may be a bit slow, especially the tri-color screen. (Is this also a feature?)
Component List
Raspberry Pi Zero W x 1 (other Raspberry Pi boards are also acceptable) MicroSD card x 1 Waveshare 7×5 tri-color e-ink screen x 1 Frame x 1
Introduction to METAR
METAR https://en.wikipedia.org/wiki/METAR, it provides dynamic reports for airport environments and serves as a platform for pilots to obtain information about airport weather and conditions. It conveys critical information to pilots entering and exiting the airport to enable them to make informed decisions.
For pilots, the flight categories of the airport are very important. The choices include: VFR, MVFR, IFR, and LIFR. These categories are determined by cloud cover or visibility.
VFR: Visual Flight Rules, cloud heights exceed 3,000 feet or visibility exceeds 5 miles.
MVFR: Marginal Visual Flight Rules, cloud heights between 1,000 and 3,000 feet AGL, or visibility between 3 and 5 miles.
IFR: Instrument Flight Rules, cloud heights between 500 and below 1,000 feet AGL, or visibility between 1 mile and below 3 miles.
LIFR: Low Instrument Flight Rules, cloud heights at 500 feet AGL, or visibility less than 1 mile.
AGL means above ground level.
Typically, these categories will have specific colors, such as VFR being green. Since this display can show limited colors, as shown in the figure, I used the following colors to represent.
VFR: White background with black text. MVFR: Black background with white text. IFR: White background with red text. LIFR: Red background with white text.
METAR is essentially a string of mysterious characters and numbers that need to be decoded. Below we will decode the raw METAR text.
The METAR text format is: KFPK (Charlotte/Beach Fld, MI, US) For example: KFPK 271935Z AUTO 32012G17KT 10SM BKN044 M02/M13 A3005 RMK AO2 T10211133, the decoded information is as follows.
M02 – Temperature: -2.1°C (28°F) M13 – Dew Point: -13.3°C (8°F) [RH=42%] A3005 – Pressure (altimeter): 30.05 inches Hg (1017.7 mb) 32012G17KT – Wind Speed: from NW (320 degrees) 14 MPH (12 knots) gusting to 20 MPH (17 knots) 10SM – Visibility: 10 or more miles (16+ kilometers) BKN044 – Cloud Height: Broken clouds at 4,400 feet AGL AO2 – QC Flag: Automated observation without human enhancement RMK – Remarks: Additional information
For more interpretations of METAR, you can refer to https://www.thinkaviation.net/understanding-metars-part-1/.
The e-ink screen files can be downloaded from the project repository: https://make.quwj.com/project/429
Installing Hardware
Connect the 7×5 tri-color e-ink screen HAT to the Raspberry Pi Zero W. The boot and update time of the Raspberry Pi Zero W is slightly slower but convenient for installation in the frame.
There are two ways to connect the display to the motherboard.
1. As shown, connect the HAT directly to the pins of the Raspberry Pi.
2. As shown, use connectors to connect the HAT to the pins of the Raspberry Pi. This method does not occupy the motherboard pins, leaving space for other functions; ensure a secure connection during installation.
The HAT has two toggle switches, both located on the right side and facing up. The “Display Config” switch is in the “B” position, and the “Interface Config” switch is in the “0” position.
Optionally, add a power switch. Power the motherboard, and you can restart it by connecting pin 5 to 6 (GPIO 3 to ground); the pin interface can refer to https://pinout.xyz/.
If you directly connect the HAT to the pins, you need to solder a wire to the pins 5 and 6 on the underside of the motherboard. Be careful not to short-circuit the wires on another pin during connection. The power switch is convenient to use; I installed the switch on the back cover of the casing.
If this switch is too troublesome for you, you can add a switch on the USB plug as shown in the figure.
Install the display in the frame and keep the motherboard running normally.
Installing Software
There are two ways to install the software.
1. The first method is to download the software from Dropbox https://www.dropbox.com/s/u8zt8nw22mxvta8/7in5e-inkMetar.zip?dl=0 and copy it to the SD card without installation. The latest version is stored on GitHub, and you can copy the required software to install it here.
The software cannot always ensure normal use, but you can download and unzip the saved files. Please follow the method in the link https://www.how2shout.com/how-to/balenaetcher-how-to-create-a-bootable-usb-flash-drive-using-etcher.html to copy the software to the SF card.
Berrylan https://berrylan.org/ Please download the Berrylan application to your phone to set up the WiFi network. Access the Apple Store or Android Play Store.
The hostname and password for the application have been changed to “epaper”.
Note: If you want to update to the latest version from github.com after installing the image, please enter the following:
cd metarsudo git reset --hardsudo git pull
2、Second Method
Please download the software from this link https://github.com/markyharris/metar, the README.md file contains detailed installation instructions, please follow the instructions to correctly set the image.
Download Required Applications
Balena Etcher https://www.balena.io/etcher/. Berrylan Unix Bullseye image https://berrylan.org/. Download the Berrylan App to your phone from the Apple App Store or Android Play Store.
Note: Berrylan image requirements are not strict. It provides a simple way to set up WiFi and enables SSH on systems without desktop Raspberry Pi.
Of course, you can also connect a temporary keyboard and display to the Raspberry Pi and boot it.
However, changing WiFi via the Berrylan mobile application is the most convenient. If you do not need Berrylan, please visit https://www.raspberrypi.com/software/operating-systems/ to download the latest image.
If Berrylan cannot be used, please refer to https://desertbot.io/blog/headless-raspberry-pi-4-ssh-wifi-setup for steps to set up WiFi on systems without a desktop.
Writing the Image to the SD Card
Use Balena Etcher to write the image to the Micro SD card. Visit here https://www.how2shout.com/how-to/balenaetcher-how-to-create-a-bootable-usb-flash-drive-using-etcher.html for information on using Belena Etcher.
Insert the SD card into the Raspberry Pi and boot it. Wait 1-2 minutes and observe the feedback from the LED after the SD card boots the Raspberry Pi. It will stop blinking when it starts (in most cases).
Using BERRYLAN to Set Up WIFI
Open the Berrylan application on your phone and select “BT WLAN Settings” or “BT WLAN” or “raspberrypi”. The most common is “BT WLAN”.
If there are multiple choices, select the first one and complete the following steps. If you cannot connect to the Raspberry Pi, restart and try again.
Select the WiFi SSID Enter the WiFi password, note the IP address displayed by Berrylan, you will use it later.
Log in Using SSH Client
Open the SSH client and enter “pi@IP address” and then log in, for example, “[email protected]”.
Log in with username “pi” and password “raspberry”. If you are using a regular image, you must enable SSH first for the client to work.
Berrylan automatically enables SSH. If it does not work, connect the display and keyboard to the Raspberry Pi and use “raspi-config” to execute.
For information on “raspi-config”, click to check https://www.raspberrypi.com/documentation/computers/configuration.html
Here are some SSH clients:
KiTTYPuTTY and other PuTTY versionsMobaXtermWinSCPSmarTTYBitvise SSH ClientTerminal (for Mac)Chrome SSH extension
Setting Up the SPI Interface
Connect to the display and execute the following command. Please enter the following on the “pi@raspberrypi:~ $” line
sudo raspi-config 3 - Interface Options I4 SPI Enable this? Yes
Note:You can change the hostname and password as needed (optional).
Click “Yes”, exit “raspi-config”, and then restart the Raspberry Pi.
Setting Up GitHub on Raspberry Pi
After the Raspberry Pi starts, log in via SSH client and enter:
sudo apt update sudo apt-get install git git --version
If you receive a git version number, you can start.
Copying Files from GITHUB:After entering, type
sudo git clone https://github.com/markyharris/metar.git cd metar ls -la
This will list the files copied to the “metar” directory from GitHub, verifying that it is working correctly.
Dependencies
Most dependencies for the software have been installed along with the image. However, a few still need to be installed manually, such as PIL, Numpy, and Flask.
Necessary dependencies required for software installation
sudo apt-get install python3-setuptools sudo apt install python3-pil sudo apt-get install python3-numpy sudo pip3 install Flask
Fonts
The code is written using “NotoMono-Regular.ttf” and “LiberationMono-Bold.ttf,” which need to be installed in the “/usr/share/fonts/truetype/” directory. Please enter the following on the cmd line:
cd /usr/share/fonts/truetype/ sudo mkdir noto sudo mkdir liberation2 cd noto sudo wget https://github.com/markyharris/metar/raw/f1858d85ad3b79864fb6e082cd083346828661ef/fonts/noto/NotoMono-Regular.ttf cd .. cd liberation2 sudo wget https://github.com/markyharris/metar/raw/f1858d85ad3b79864fb6e082cd083346828661ef/fonts/liberation2/LiberationMono-Bold.ttf
Testing METAR Display
Now is the key moment, run the main script manually from the cmd line. Enter
cd ~ cd metar sudo python3 metar_main.py
If everything is normal, the cmd line will display debugging data, including the original meta string. Please observe the display to see if it starts flashing during updates; a complete refresh may take a few seconds, so please be patient.
If the default airport appears in “metar_settings.py,” then you have succeeded.
Now edit the “metar_settings.py” file as needed. If no other parameters are passed on the cmd line, these values are the defaults that the script falls back on.
The following shows a portion of the “metar_settings.py” file. You can make airport changes, such as the preferred airport ID.
# Default User Settings airport = "KFLG" # enter default airport identifier to display. Be sure to use quotes interval = 1800 # enter default time in seconds between METAR updates - 3600 = 1 hour, no quotes use_disp_format = 7 # Choose which display layout to use. -1 = Random layout, -2 = Cycle layouts use_remarks = 1 # 0 = display airport information, 1 = display metar remarks info random_airports = ["KEYW","KDFW","KSEA","KORD", "KLAS","KCMR","KABQ","KDEN", \