Raspberry Pi project to visualize flight conditions on a map using WS8211 LEDs addressed via NeoPixel
I've created detailed instructions about the setup and parts used here: https://slingtsi.rueker.com/making-a-led-powered-metar-map-for-your-wall/
passwd
sudo raspi-config
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3
sudo apt-get install python3-pip
sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel
sudo python3 metar.py
LED_COUNT
(including NULLs if you have LEDS in between airports that will stay off) and LED_BRIGHTNESS
if you want to change itchmod +x filename
will grant execute permissionschmod +r filename
will grant write permissionscrontab -e
, after you are done with the edits, exit out by pressing ctrl+x and confirm the write operation
I recently expanded the script to also take wind condition into account and if the wind exceeds a certain threshold, or if it is gusting, make the LED for that airport either blink on/off or to fade between two shades of the current flight category color.
If you want to use this extra functionality, then inside the metar.py file set the ACTIVATE_WINDCONDITION_ANIMATION
parameter to True.
FADE_INSTEAD_OF_BLINK
- set this to either True or False to switch between fading or blinking for the LEDs when conditions are windyWIND_BLINK_THRESHOLD
- in Knots for normal wind speeds currently at the airportALWAYS_BLINK_FOR_GUSTS
- If you always want the blinking/fading to happen for gusts, regardless of the wind speedBLINKS_SPEED
- How fast the blinking happens, I found 1 second to be a happy medium so it's not too busy, but you can also make it faster, for example every half a second by using 0.5BLINK_TOTALTIME_SECONDS
= How long do you want the script to run. I have this set to 300 seconds as I have my crontab setup to re-run the script every 5 minutes to get the latest weather informationHIGH_WINDS_THRESHOLD
- If you want LEDs to flash to Yellow for particularly high winds beyond the normal WIND_BLINK_THRESHOLD
then set this variable in knots. If you only want normal blinking/fading based on WIND_BLINK_THRESHOLD
then set the value for HIGH_WINDS_THRESHOLD
to -1
After the recent addition for wind condition animation, I got another request from someone if I could add a white blinking animation to represent lightning in the area. Please note that due to the nature of the METAR system, this means that the METAR for this airport reports that there is Lightning somewhere in the vicinity of the airport, but not necessarily right at the airport.
If you want to use this extra functionality, then inside the metar.py file set the ACTIVATE_LIGHTNING_ANIMATION
parameter to True.
BLINKS_SPEED
- How fast the blinking happens, I found 1 second to be a happy medium so it's not too busy, but you can also make it faster, for example every half a second by using 0.5BLINK_TOTALTIME_SECONDS
= How long do you want the script to run. I have this set to 300 seconds as I have my crontab setup to re-run the script every 5 minutes to get the latest weather informationThis optional functionality allows you to run the LEDs at a dimmed lower level between a certain time of the day.
If you want to use this extra functionality, then inside the metar.py file set the ACTIVATE_DAYTIME_DIMMING
parameter to True.
Set the LED_BRIGHTNESS_DIM
setting to the level you want to run when dimmed.
For time timings of the dimming there are two options:
BRIGHT_TIME_START
- Set this to the beginning of the day when you want to run at the normal LED_BRIGHTNESS
levelDIM_TIME_START
- Set this to the time where you want to run at a different LED_BRIGHTNESS_DIM
levelsudo pip3 install astral
USE_SUNRISE_SUNSET
- Set this to True to use the dimming based on sunrise and sunsetLOCATION
- set this to the city you want to use for sunset/sunrise timingsThis optional functionality allows you to connect a small mini LED display to show the METAR information of the airports.
For this functionality to work, you will need to buy a compatible LED display and enable and install a few additional things.
I've written up some details on the display I used and the wiring here: https://slingtsi.rueker.com/adding-a-mini-display-to-show-metar-information-to-the-metar-map/
To support the display you need to enable a few new libraries and settings on the raspberry pi.
sudo raspi-config
sudo reboot
sudo apt-get install i2c-tools
sudo i2cdetect -y 1
- this should show something connected at 3Csudo pip3 install adafruit-circuitpython-ssd1306
sudo pip3 install pillow
sudo apt-get install fonts-dejavu
sudo apt-get install libjpeg-dev -y
sudo apt-get install zlib1g-dev -y
sudo apt-get install libfreetype6-dev -y
sudo apt-get install liblcms1-dev -y
sudo apt-get install libopenjp2-7 -y
sudo apt-get install libtiff5 -y
ACTIVATE_EXTERNAL_METAR_DISPLAY
parameter to True.DISPLAY_ROTATION_SPEED
to your desired timing, I'm using 5 seconds for mine.If you want an interactive Legend to illustrate the possible behaviors you can do so by adding an additional up to 7 LEDs after the last LED based on your number of LEDs of the airports in the airports file
SHOW_LEGEND
to True to use this featureOFFSET_LEGEND_BY
to the number of LEDs to skipACTIVATE_LIGHTNING_ANIMATION
, ACTIVATE_WINDCONDITION_ANIMATION
and HIGH_WINDS_THRESHOLD
variables.
To see a list of changes to the metar script over time, refer to CHANGELIST.md