Making a LED powered METAR map for your wall

While waiting for my airplane kit to arrive I got inspired to make a small crafty project after seeing someone post about it on reddit and showing it to my girlfriend who said we can make one together.

We did a bit more research and because I’ve made some projects with Raspberry Pi before, we decided to go that route. Here’s a picture of the finished project:

METAR Map

Supplies needed

Here’s a list of the things you will need:

Plotting your chart area

Unless you want to make your own frame, the dimensions of your project will be limited by what size shadow box frame you can easily purchase. The simplest size is 16 x 20 inch frames, so I used that as a guide of the area to size out.
This worked out great for the Puget Sound Area to cover the airports from Bellingham in the north to Olympia in the South and Hoquiam and Quillayute on the coast using my old expired sectional chart from my private pilot training.

Plotting out the area and using some wooden meeples to highlight the airports

To light up the airports with the flight category, we’re using the data reported from www.aviationweather.gov so we checked the airports we want to highlight via the API to ensure they are reporting data.

After we were satisfied with the area, we created a 16 x 20 inch transparent sheet by cutting up some sheet protectors and taping them together and then overlaying them onto the area and marking down the airports so we could transfer the locations onto the back of foam board for the LEDs to go into.

Transparent sheet with airport locations

Software and Wiring

Since the project is pretty simple, we used a Raspberry Pi Zero W, which has WIFI built in and can run the code to download the weather data using the above mentioned web API to pull the weather for all the airports in one go.

For the code, I’ve started by looking at some of the other projects people have done and the NeoPixel documentation for python.

We wrote an updated and optimized script and published it on Github, along with the instructions to set it up.

We ended up with a total of 22 lit up LEDs, so we wired it directly to the Raspberry as shown here. Before attaching the wires to the Raspberry headers, I soldered the header strip onto the Raspberry so it creates a good connection.

Raspberry Pi LED wiring (image courtesy of adafruit - https://learn.adafruit.com/assets/63929)

Here’s a picture of the wiring while I was testing out the code. I was using a breadboard while doing this since it made it easier to disconnect the wires during testing.

LED wiring in action

To finalize the order of the LEDs you will need to arrange them on the board and make changes to the airport list accordingly.

Another important note is to test the LEDs for all the colors in case there is a bad one, in our case the 5th LED couldn’t show RED light, so we skipped over that one.
The easiest way to test this once you’ve installed the software is to just manually control the colors of the LEDs by opening the python3 console:

sudo python3

Then entering the following to light up 30 LEDs at once (if you are using more, just replace the number below):

import board
import neopixel
pixels = neopixel.NeoPixel(board.D18, 30)
pixels.fill((0,255,0))

This will light up all LEDs in red, if you see a bad one, mark it with some tape so you don’t use it for an airport.
Repeat the step for green:

pixels.fill((255,0,0))

Blue:

pixels.fill((0,0,255))

Purple:

pixels.fill((0,125,125))

Once you’re done you can turn off the lights by typing

pixels.deinit()

and then pressing CTRL+Z to exit the python console.

Board Assembly

Once we figured out the software portion and what airports to light up it was time to drill some holes in the foam board for the LEDs to go into using the template made earlier.

Foam board holes drilled

After we had the holes made we tested it by temporarily affixing the sectional chart onto the board and sticking some of the LEDs into the holes and turning on the project, but we found that the LEDs created a lot of light and the LEDs were sticking out a bit, so we decided to double up the foam board, which made the light more defined and allowed the sectional chart to sit flush on the board, so we glued together the two foam boards.

We did a second quick test and pinned the sectional chart onto the board for the first complete light up test:

First light up test

After that it was time put everything together. we made the final cuts to the chart to fit perfectly onto the board and align with the lights and then glued it to the board using a glue stick.

Then it was time to glue the LEDs onto the board, as you can see from the picture below, some of the LEDs are not lit, one of them because the red light didn’t work and some others because the gap between two airports was too much and it was easier to just skip the light than to cut the lights and having to solder in some wires. at the end we just cut off the remaining LEDs we didn’t need (disconnect the Raspberry power when you do this).

Lit LEDs back of board

Once that was all done and good it was time to assemble it all into the frame – we drilled a hole into the bottom of the frame for the power cable to go through.

Raspberry assembly in frame

And here is the final picture of the completed project:

METAR Map

I hope this was helpful for you.

Some of the above links to Amazon may earn me a small commission to keep the site running.

I recently added a new functionality to show the complete METAR information for the airports on the chart on a small mini display.

Mini screen embedded in my METAR map

118 thoughts on “Making a LED powered METAR map for your wall

  1. Erick

    This looks great! Question, what are my options for dimmer lights? Something that glows less. Are they certain specifics I would need to meet? Can you recommend something? Cheers!

    Reply
    1. Dave

      Change the color to less intence

      COLOR_VFR= (67,0,0) # Green
      COLOR_MVFR= (0,0,67) # Blue
      COLOR_IFR= (0,67,0) # Red
      COLOR_LIFR= (0,34,34) # Magenta
      COLOR_CLEAR= (0,0,0)

      Thats 25% bright
      you could go (2,0,0) etc for really dim

      D

      Reply
  2. Bob Berlyn

    Looks like a great project and I would like to build. I am an analog electronics guy and pilot but not a programmer. I have discovered that PYTHON is a language but thats really all I know. Does the pi run PYTHON using the operating system (Rasberian) or do I have to get PYTHON software or just load the scrips you wrote into the pi and go.

    Thanks

    Reply
    1. Philip Rueker Post author

      You just need to load the scripts into the Raspberry file system, “install python” by running the scripts that I’ve documented here and and modify the airports file to have the name of the airports that are relevant to you.

      Reply
  3. Ulrich Pommer

    Hey Philip,
    First of all, this is a great project. I’m from Germany and would like to take German airports. Is that possible? Do I have to change only the names in the file (airports)? Sorry for my bad english:-(

    greetings Uli

    Reply
    1. Philip Rueker Post author

      Yes the web service I’m using does also support many international airports, you just need to use the 4 digit ICAO codes like EDDF for Frankfurt and EDDM for Munich.

      Reply
  4. Rick Sayles

    Philip,
    I saw a MetarMap at SUNnFUN last year and then seeing your project you inspired me to give it a go.

    Thanks for your excellent documentation. Made it work for a non-programmer. It all works now, but it doesn’t update, until you rerun the program, and the pi doesn’t automatically run the program. I have it now where the pi is connected to monitor so I can run the program. I assume you have automated both of those operations?

    Thanks!

    Reply
    1. Philip Rueker Post author

      Hi,

      Yes you can automate this using crontab.
      As I mention on the Github, here’s how you do it:

      If you’d like to have the script refresh in regular intervals, use crontab and set the appropriate interval. For an example you can refer to the crontab file in the GitHub repo (make sure you grant the file execute permissions beforehand). To edit your crontab type: crontab -e, after you are done with the edits, exit out by pressing ctrl+x and confirm the write operation
      The sample crontab will run the script every 5 minutes (the */5) between the hours of 7 to 21, which includes the 21 hour, so it means it will run until 21:55
      Then at 22:05 it will run the lightsoff.sh script, which will turn all the lights off

      Reply
  5. Sameer

    This is great! I’m working on this project now as well. I ran into a snag with the level shifter. Everything works great on the breadboard, but when I connect jumper wires to the level shifter directly the LEDs go rainbow colors instead of red or green etc. I just purchased some veroboard to solder the level shifter and create connections without jumper wires.

    How many LEDs are you able to light up directly off the 5v pin without risking the pi? Thx!

    Reply
    1. Philip Rueker Post author

      I’m running 22 active LEDs directly off the Pi 5v without issues.

      Reply
  6. Chris

    Using your command sequence for checking all the LED’s:
    import board
    import neopixel
    pixels = neopixel.NeoPixel(board.D18, 30)
    pixels.fill((0,255,0))
    I am presented with Attribute Error ‘neopixel’ has no attribute ‘Neopixel’
    Any solutions for this? I am not a code literate.

    Reply
    1. Philip Rueker Post author

      Make sure that prior to this you have successfully installed the neopixel library by running the following command as listed in the github instructions:
      sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel
      After that command, you open python3 by entering:
      sudo python3
      and then enter the commands and it should work:
      Testing pixels screenshot

      Reply
    1. Bob

      I changed the corntab file by just adding

      */5 7-21 * * * /home/pi/refresh.sh
      05 22 * * * /home/pi/lightsoff.sh

      I guess I am not understanding root permission. I did run sudo chmod +x corntab

      Thanks for the project just wish I knew more about pi but working on it.

      Reply
      1. Philip Rueker Post author

        Ah, you need to grant the files that are being executed inside the crontab execute permissions, so you should run the chmod command for the refresh.sh and the lightsoff.sh file.

        After you have done that you can check that you’ve done it correctly by running "ls -al" and you should see “x” for the files 3 times, similar to this:
        executepermissions

        Also just to be clear, you have to edit your system crontab by typing "crontab -e", not by copying my sample file into the folder.

        Reply
  7. Bob

    looks like it is working, I was doing “sudo nano crontab -e”. Thanks for your help and thanks for the program. I had a thought and it is way above my knowledge with pi. I was thinking could you add a screen somewhere on a chart with 5/10 day forecast or scrolling local weather. Again thanks now I need to start on my frame.

    Reply
  8. Ron Heberlein

    Thanks for the instructions! I was able to get metar.py running manually, but I can’t get it to start on power-up.
    Here’s what the statrup.log shows:

    Thu 07 May 2020 06:46:43 AM PDT
    /home/pi/startup.sh: 2: /home/pi/startup.sh: echo
    : not found
    Running metar.py
    /home/pi/startup.sh: 4: /home/pi/startup.sh:
    : not found
    /usr/bin/python3: can’t open file ‘/home/pi/metar.py
    ‘: [Errno 2] No such file or directory

    And here is my ls -al:
    pi@raspberrypi:~ $ ls -al
    total 132
    drwxr-xr-x 17 pi pi 4096 May 7 06:46 .
    drwxr-xr-x 3 root root 4096 Feb 13 07:55 ..
    -rw-r–r– 1 pi pi 244 May 6 06:50 airports
    -rw——- 1 pi pi 905 May 7 06:46 .bash_history
    -rw-r–r– 1 pi pi 220 Feb 13 07:55 .bash_logout
    -rw-r–r– 1 pi pi 3523 Feb 13 07:55 .bashrc
    drwxr-xr-x 7 pi pi 4096 May 5 22:11 .cache
    drwx—— 11 pi pi 4096 May 6 07:20 .config
    drwxr-xr-x 2 pi pi 4096 Feb 13 08:17 Desktop
    drwxr-xr-x 2 pi pi 4096 Feb 13 08:17 Documents
    drwxr-xr-x 2 pi pi 4096 May 6 20:42 Downloads
    drwx—— 3 pi pi 4096 Feb 13 08:17 .gnupg
    -rwxr-xr-x 1 pi pi 53 Apr 19 14:48 lightsoff.sh
    drwxr-xr-x 3 pi pi 4096 Feb 13 08:03 .local
    drwxr-xr-x 2 pi pi 4096 Feb 13 08:03 MagPi
    drwxr-xr-x 3 pi pi 4096 May 7 06:46 METARMAP
    -rwxr-xr-x 1 pi pi 2568 May 5 22:51 metar.py
    drwxr-xr-x 2 pi pi 4096 Feb 13 08:17 Music
    drwxr-xr-x 2 pi pi 4096 Feb 13 08:17 Pictures
    -rw-r–r– 1 pi pi 108 Apr 19 14:48 pixelsoff.py
    drwx—— 3 pi pi 4096 May 5 21:41 .pki
    -rw-r–r– 1 pi pi 807 Feb 13 07:55 .profile
    drwxr-xr-x 2 pi pi 4096 Feb 13 08:17 Public
    -rwxr-xr-x 1 pi pi 48 Apr 19 14:48 refresh.sh
    -rw-r–r– 1 pi pi 74 May 7 06:44 .selected_editor
    -rw-r–r– 1 root root 264 May 7 06:46 startup.log
    -rwxr-xr-x 1 pi pi 107 Apr 19 14:48 startup.sh
    -rwxr-xr-x 1 pi pi 129 May 6 20:48 startup.sh_test
    drwxr-xr-x 2 pi pi 4096 Feb 13 08:17 Templates
    drwxr-xr-x 2 pi pi 4096 Feb 13 08:17 Videos
    -rw——- 1 pi pi 56 May 7 06:46 .Xauthority
    -rw——- 1 pi pi 2425 May 7 06:47 .xsession-errors
    -rw——- 1 pi pi 2425 May 7 06:35 .xsession-errors.old

    Any thoughts as to what is going on?
    Thanks! Ron

    Reply
    1. Philip Rueker Post author

      Hi,
      I just updated the instructions on the github and removed the step about setting up rc.local since it seems to cause strange issues with startup.
      I found it easier to just rely on the crontab instead to automatically run the script regularly, so I suggest you just forget the rc.local startup and instead use the crontab.

      Reply
      1. Ron Heberlein

        That did it. It took a minute to start after a restart, but it came on automatically!
        50 lights setup, now I have to get the sectionals. Thanks for the help!

        Reply
        1. Spencer Hamons

          Ron…I am going to do this project at Christmas with my son. Did you run into any problems running 50 LEDs off the 5v pin directly on the Pi?

          Reply
  9. Steve Peck

    there is no startup.sh file in github now… and can you please update the instructions about what you’re saying about cron?

    Reply
    1. Philip Rueker Post author

      Correct, I removed the startup.sh file, since for the crontab I just used refresh.sh (which basically does the same).
      The instructions about crontab have been on the Github all this time:

      To have the script start up automatically and refresh in regular intervals, use crontab and set the appropriate interval. For an example you can refer to the crontab file in the GitHub repo (make sure you grant the file execute permissions beforehand to the refresh.sh and lightsoff.sh file). To edit your crontab type: crontab -e, after you are done with the edits, exit out by pressing ctrl+x and confirm the write operation
      The sample crontab will run the script every 5 minutes (the */5) between the hours of 7 to 21, which includes the 21 hour, so it means it will run until 21:55
      Then at 22:05 it will run the lightsoff.sh script, which will turn all the lights off

      Reply
  10. Ron Heberlein

    Phillip,

    Have you tried to incorporate blinking lights into the program?
    I’d like to be able to have a light blink if the wind speed (or gust) exceeds a certain value. I’ve been searching on the internet for this and haven’t seen anything that seemed like it would plug into your code. That being said I’m not a programmer…

    Reply
    1. Philip Rueker Post author

      I felt inspired by your question and since I am a programmer, I expanded the script to support blinking for windy conditions.

      I just uploaded the updated version of the script that now supports animation for wind conditions, if you go to the github, please use the updated refresh.sh, metar.py and lightsoff.sh with the latest version I just uploaded (it makes sure that any currently running scripts will be closed when the next one runs).

      I also added some information to the Readme instructions about the new parameters that I’ve added to the metar.py script that you can adjust as needed.

      Reply
      1. Ron Heberlein

        How awesome!!!
        I found one error in your code. On line 22 and 23, both variables were named “COLOR_IFR_FADE”. I updated line 22 to remove the “_FADE” and everything worked perfectly!

        Reply
  11. Jordan

    Hi Philip,

    Thanks so much for the tutorial, build a huge map to go in my work area and everyone loves it. Ive seen now the commercial Maps have the ability to flash white when there is lightning reported in the area? Is there any way we could add a line in the script to run this kind of like how you ran the wind one? That would be super cool!

    Reply
    1. Philip Rueker Post author

      Hey,
      Sure, I just added this functionality in the script, it will flash to white to represent lightning in the vicinity as reported by that airports METAR.
      You can get the latest version with the updated changes from the github.

      Reply
  12. Kit

    Hi Philip.

    I have an issue where only the first led lights up. I have a strand of 50, the ones you suggested. I can issue “pixels = neopixel.NeoPixel(board.D18, 30)” or use 20, or 10, or 50, I still only get the first led to light up after issuing “pixels.fill()”. Do you think I have a bad strand of leds?

    Reply
    1. Philip Rueker Post author

      I think there’s two possibilities.
      1) Yes maybe the strand is bad
      2) Did you make sure that you connect the correct ends to the Raspberry? On the LEDs you will find a small arrow on one side like this, this is the side that you have to connect the wires to the Raspberry. direction on LEDs.

      Reply
      1. Kit

        I did connect the pi to the input end of the led strand. After some testing, the strand is defective. Will give it a try again when the new strand arrives! Thanks for the help.

        Reply
        1. Colin

          I’m also having issues with the strand. I got about half of them to light up red (not seeming to be talking to the code?), but now none are lighting up. I’ve triple checked the connections. Is it possible the LEDs got fried? I noticed in the link you provided it mentioned that as a possibility I recall reading or seeing any level shifting in your setup.

          “Powering NeoPixels from Raspberry Pi Without Level Shifting”
          https://learn.adafruit.com/neopixels-on-raspberry-pi/raspberry-pi-wiring

          Reply
          1. Colin

            Ok, I was able to get the lights working with the python commands you provided to others. Now I can’t seem to get it to light up to the metars. Maybe its a permissions/executable issue?
            When you enter the “chmod +x lightsoff.sh” etc. command are you suppose to see some message after? I just enter it and it cycles down to a new line.
            I’ve also noticed that when I run “ls -al” some files are in “root” and some in “pi” like “airports”.

          2. Philip Rueker Post author

            Yes sounds like a permissions issue.
            You can fix to take over the file ownership by running this:
            sudo chown pi:pi FILENAME

            This will make pi the owner and then it should hopefully work.

          3. Jonathan

            Collin,
            How did you finally get them to light up? I have an issue where none of mine light up. I had thought that I needed to order a new strand. Was that you solution?

        2. Jonathan

          Kit,
          Did the new strand work? I am having an issue where none of mine light up either.

          Reply
  13. Chuck

    I just finished making one of these, i love it! thanks for putting together this guide, and the upkeep with the code!

    Reply
  14. Ron Heberlein

    I wanted to see if anyone else was having issues with the map not refreshing?
    For about the past week, I have to turn the Pi off and then back on to get the map to refresh with the latest weather data. It then will refresh for a while (maybe a few hours), and then gets stuck again.

    Is there a way to plug in a monitor and see how the program is running (other than manually starting the program)?

    Reply
    1. Philip Rueker Post author

      Maybe your WIFI connection is weak and it fails at some point randomly? I’m not quite sure how the raspberry PI handles that.

      In any case, you could write to a logfile every time the script gets executed.
      If you just want to see if the script get’s started at all you could add something like this to the start of the refresh.sh script:
      echo $(date) - running metar script >> myfile.txt
      This will write the current date/time into a new text file called myfile.txt

      And if you want to just print the entire output of every time the script gets executed automatically, you can modify your crontab to something like this and it will print the entire output that would usually be seen on the console:
      * 7-21 * * * /home/pi/refresh.sh > /home/pi/outputlog.log 2>&1
      This will print everything that happens in the script into a new file called outputlog.log

      Reply
  15. Randy

    Great post. I frequently visit Aero Maintenance at Pearson airport and have always liked the METAR chart they have in their office. I was looking for different addressable LED products to make my own METAR chart and, bam!, full build instructions and parts list!

    My plan is to combine this with a previous (insanely over-designed) project of mine: https://github.com/slakpi/piwx. Basically, I’m thinking about building the METAR chart, then cutting out a part of the sectional for the PiTFT screen so it can also display METAR details.

    Reply
  16. Tony

    Philip, fantastic project. I noticed there is a guy in the US (Metarmaps) selling these so i was curious to see if the code/project existed and found you. A couple of hours work and it was up and running. The VNC charts in Canada are paper only and huge so I discovered the US charts are free and downloadable so I am going to have a poster shop print up the size I want ( 2′ x 3′) and then complete the LED install. Bought you more than a coffee 🙂 Thanks for the project.

    Tony Varga
    C-FFOM
    CYKF

    Reply
  17. Scott

    You may not know this for sure but I’m about to start a very large map and I’m up to 81 LEDs so far. Can this project use more than 50? Do you happen to know the limit?

    Reply
    1. Philip Rueker Post author

      Yes you can, but you will have to wire an external power supply to the LEDs as the internal power coming from the Raspberry Pi won’t be enough to power that many LEDs.

      Reply
      1. Scott

        Just got my 5050 LEDs and the code works great. The fading confused me a bit because I was expecting a fade but found that it just blinks with a set brightness. I’m using 107 5050 LEDs and the current draw is 0.81A.

        Reply
  18. Anthony Varga

    Philip, to conserve the lifetime of the LEDs (they are long but really only about 5 years on 24/17) I purchased a micro PIR sensor that I am going to flush mount into my map to trigger the lights on when motion is detected. I am planning to put a 60 minute countdown in Python that when triggered, would start counting and when t=0 the lights would go off. I am not an adept Python programmer but will figure it out but just wondering if you have any thoughts about placement of the timer in the code ?

    Reply
    1. Philip Rueker Post author

      So the script will just turn on the light and will keep them lit when the script finishes by default.
      So you could just add a sleep timer and then deinit the LEDs which turns them off at the end. So you can just add this to the bottom of the metar.py script and it will wait for 3600 seconds and then pixels.deinit() will turn off the LEDs until the next time the script starts and turns them back on.

      time.sleep(3600.0)
      pixels.deinit()

      Reply
  19. Anthony Varga

    I think the problem with that is that during the sleep, the metars will not update every five minutes like they do now ?

    Reply
    1. Philip Rueker Post author

      Yes in that case, what you’ll need to do is make use of a temporary file where you store the time when you started the timer after motion was triggered.
      You can insert the code just after the initialization of the LEDs.
      Here’s a sample that should work, there are 2 new imports in line 9 and 10 and you need to replace the sensor piece of code in line 59 with your reading of your actual motion sensor to return True when motion is detected: https://gist.github.com/prueker/12945cbf4220ce0221e79174db7c5cc9

      Reply
  20. Anthony Varga

    Really appreciate the code insert. I will play this weekend and report back.

    Reply
  21. Anthony Varga

    Hi Philip, I was looking at and playing with the code you created. I am not a strong Python programmer at all but more an old guy C++ programmer so I can follow it somewhat. When I look at metar.py it looks like the code runs every 5 minutes via cron and when it does, the first part of the code captures the web metar data and then at the bottom there is a loop that cycles for the time set to do the flashing lights. So, my understanding is that when the python script runs, it is only testing the PIR input once so it must be triggered to 1 exactly when the script is run by cron. Is my understanding correct ? If that is correct, the chances of it pickup up a motion trigger are slim to none. I know the code allows flexibility to define the duration of the ‘flashing’ loop which is 300 by default so basically the script runs for 5 minutes, exits, reruns via cron immediately, updates the metar data and then loops at the bottom until exit. Python is somewhat new to me so I am playing with a side script that is detecting the PIR and running a 60 minute countdown timer and setting a global variable. Metar.py would then test that variable and if 1 would operate as it does now but if zero would deinit() and exit. My other thought is to just have Metar.py running all the time, jumping to the top to do an update every 5 minutes but managing the PIR detector and timing within.

    Sorry, long comment. Basically want to confirm my understanding on how the script is operating and the reason for exiting every five minutes and rerunning immediately to ensure I am not on a wrong track here.

    Thanks !

    PS : I am following your Sling build as well. I own a Commander 112 but contemplating building an RV-10 as a retirement project in a few years.

    Reply
  22. Scott Moody

    Is there a way to run this without using file PID? The reason I ask, I want to make the file system read-only and this won’t run that way.

    Reply
    1. Philip Rueker Post author

      You could, but you’d need to make sure that the runtime of the script is less than the trigger time in order to make sure that there are no race-conditions in accessing the LEDs.

      So if you set the script to run for say 270 seconds (4 1/2 minutes) and trigger the script every 5 minutes using the cronjob, then you should be okay (usually the weather fetching and all takes about 5-10 seconds) and you could remove the file PID action.

      It’s basically just a protective layer to make sure only one instance of the script is running at any given time.

      Reply
  23. Phil Lightstone

    Hi Gang,

    I’m working on a map as well. I was wondering if anyone has sourced a ws2811 string that had more wire in between the LEDs? I believe that most have 3” of wire.

    P …

    Reply
    1. Philip Rueker Post author

      I have not seen premade strings with longer distances as you said, but you can buy individual LEDs and solder your own custom wire lengths, or use of the premade ones and cut and solder in longer wire where needed.

      Reply
  24. Phil Lightstone

    Hi Philip,

    I built one for my son’s birthday in October (PS it was a hit), collaborating with Tony. Bought the Alitov on Amazon. Lots of soldering to get the inter LED lengths right. I’ve sent an email out to a few vendors. We’ll see what they come back with.

    Reply
  25. Nicholas

    Just before I begin, I wanted to make sure I get the airports right. Is there anyway to confirm the airport LED in the code is physically in the correct position on the map? I saw another example and they had some blinking setup tutorial.

    Thanks!

    Reply
    1. Philip Rueker Post author

      When you run the code it will print out the statement saying that it have a message showing which LED is set for which airport, so you can use that to reference to make sure it’s in the right spot.
      LEDs message
      It will count starting from 0 for the first LED and if you have some LEDs that you are skipping and use NULL in the airports file for them it will just skip over them, but the LED count includes them, so like you can see in the image above, I have some gaps for example it goes from LED 0 to LED 2 and skips over the LED 1.

      Reply
      1. Nicholas

        Got it – I managed to do exactly that and the code appears to be working (just like you said it would). Unfortunately, I incorrectly wired something because I fried the pi and I found the error. I had a spare pi and tried to get it to work and the pi/code works fine but the lights wont turn on. I’m just not sure how to check if the lights are working or if it’s the pi again.

        Reply
        1. Philip Rueker Post author

          So if you’ve wired them correctly, then you can test just the lights by themselves if you open python and run the following:
          To open python:
          sudo python3
          Then entering the following to light up 30 LEDs at once (if you are using more, just replace the number below):
          import board
          import neopixel
          pixels = neopixel.NeoPixel(board.D18, 30)
          pixels.fill((0,255,0))

          That will fill 30 LEDs with one color.
          If that doesn’t work, then either the Pi is bad, or something is wrong with the wiring.

          Reply
          1. Nicholas

            I figured it out – thanks for the help!

            I’m getting this error with your new code you made:

            Traceback (most recent call last):
            File “metar.py”, line 67, in
            ast = astral.Astral()
            AttributeError: module ‘astral’ has no attribute ‘Astral’

            I’ve attempted it numerous times with no avail. I just set it to false for now.

          2. Philip Rueker Post author

            My apologies, my new code for Astral had an unintended sideeffect in that it only worked for older Raspberries running an older version of the library.
            I just checked in the fix, so please take the newer version of metar.py and everything should be working again.

          3. Nicholas

            No need to apologize. Everything is working perfectly now! However, I am just trying to get the code to start up basically as soon as I power the pi. I have done the crontab and I am still running into a bit of a roadblock. All permissions are set properly.

            Thanks for your help with these replies man. You’ve definitely done a great project.

          4. Philip Rueker Post author

            This article helps troubleshoot the crontab https://garyhall.org.uk/troubleshooting-cron-raspberry-pi.html
            If you just set it up, then chances are it might just not be running yet, you can restart the crontab with this command:
            sudo /etc/init.d/cron restart

            If it’s running ok, then you should see something like here in the last line saying that it triggered the refresh.sh file:
            crontab

  26. Chris

    This project just rocks. Got me excited about my crappy programming skills. I have much better woodworking skills. And decent Photoshop skills. Just a couple of suggestions that have worked out for me and some that didn’t.

    You can download a sectional (or area maps) for free from the FAA website:
    https://www.faa.gov/air_traffic/flight_info/aeronav/digital_products/vfr/

    Crop and size it as you like and print it at your local Wal-Mart. I suggest matte finish and no frame.
    https://photos3.walmart.com/category/332

    I used 1/4 inch plywood for better durability. Spray mount is great stuff that is more forgiving than many spray adhesives. I have a dozen art projects still holding 25 years later and still used the same can. Worth the money.
    https://amzn.to/3gFqkfX

    Use a 5/16 Forstner bit to cut your paper + plywood. This is a very nice bit and cuts a perfect hole in the plywood and also doesn’t tear the chart paper. Make sure to put some wood behind your hold so it doesn’t splinter the plywood when the bit exits. https://amzn.to/37RixY8

    My mistakes:
    * Trying to save 10 bucks and solder more length in between bulbs. OMG, it was a not worth it. Just NULL the bulbs and buy another set. I wired some in reverse, which you can’t do, and wasted more of my life. I also tried to find longer lengths as above but to no avail.
    * Make sure your paper and plywood is clean and wiped before adding spray mount. I got too much junk in between and is noticeable in the right light. Presentation is everything.
    * I made my own frames. Well, this wasn’t as hard and turned out real nice, but a pre-made from would be much easier.
    * I’m not good at instructions. Read where each file goes during init and during setup. Make sure you have a K in front of all airports. Mine still doesn’t start at boot, so I have to figure that one out.

    Reply
  27. Randy

    Almost done with my build: https://1drv.ms/u/s!Ar5QrtP9ZYyWkp05MZCKMqjXnKjiag?e=if99aE

    Totally did what Chris above did. I used the FAA’s TIFF’s to combine the Seattle and KFalls sectionals to cover Astoria, OR down to Roseburg, OR and east to Redmond, OR. Basically my regular range for drilling holes in the sky. I had FedEx Office print them on foam board. Kind of expensive for a 22×28 poster, but looks pretty great.

    Biggest mistake I made was using a wood drill bit to make the holes for the LEDs. It worked, but more or less tore into the lamination and required a lot of cleanup with an Xacto knife.

    Mounting the screen in the poster worked out pretty nicely. Cut it just right so that the screen fits tightly in the foam board and does not need any extra support in the back.

    Reply
      1. Randy

        Ha! Very cool!

        Forgot to mention the Yellow lights are mine are airports where the wind or gust exceeds 25 knots. Thought about doing blinking lights like you did, but didn’t want to spend the time implementing it.

        Reply
      2. Anthony Varga

        If anyone is interested, I designed a nice front/flush mounted bezel for the display. You can cut a hole in the map and drop it in. If interested PM me at ve3zav63@gmail.com

        I also did a spinoff from a published light block for these LEDs that enables you to pop the led into the block sideways and a ‘light pipe’ protrudes through a hole in the map. This allows the long LED units to be side mounted and much shallower shadow box.

        These are .STL files that you can slice with Cura or your favourite slicer and 3D print. Whichever colour you want for the display bezel and clear for the light blocks.

        Reply
  28. Isaac

    Thanks for the very cool project write up! I’ve never used rasberry pi, linux, python, or any of that business before so it has been quite the learning curve.

    I wanted the lights to also light up a little sooner than the 5 minute mark when I first booted the project up, so I did some googling and added

    @rebooth sleep 30 && /pi/home/refresh.sh

    and that seemed to get the job done! Without the sleep 30 seconds it didn’t seem to want to work.. maybe because it was running the script too soon after boot, before it connected to the WiFi?

    I haven’t touch coding since high school (15 years probably!) and that was C++.. I tried a little Python right after that class and it was way over my head. So I’m very happy to be able to learn so much on a project like this now.

    Cheers.

    Reply
    1. Jeff

      Phillip, anyone
      I have read all the data here on how to get the Crontab to work and I’m still having issues with it starting up without me telling it to. Im a noob at programming, so any helpful tips or tricks you might have would be greatly appreciated. thanks
      Jeff

      Reply
      1. Philip Rueker Post author

        Hey,

        hopefully this article might help with troubleshooting the cron tab https://garyhall.org.uk/troubleshooting-cron-raspberry-pi.html

        Usually it’s around permissions, so you can try and make sure that your normal “pi” user account owns the file and that they have read and execute permissions.
        You can check that by typing “ls -al” and seeing that “pi” is listed as the owner and not root.
        To change ownership you can run “sudo chown pi:pi FILENAME” and “sudo chmod +x FILENAME” for execute and “sudo chmod +r FILENAME” for read permissions and that should *usually* help.

        The article I just referenced above has a couple of other tips to troubleshoot it.

        Reply
  29. Colin

    Troubleshooting tip I encountered when setting up the wifi connection.
    The Raspberry Pi Zero W only supports 2.4 GHz networks, not 5 GHz. In other words, if you are having trouble connecting to wifi with the wpa_supplicant.conf file described, make sure the network you’re trying to connect to is 2.4 GHz.

    Reply
  30. Anthony Varga

    Phil, the mini display is a great add. What would I do to keep the display static on one airfield ? I would like to mount it by my home field and only report on that field.

    Reply
    1. Philip Rueker Post author

      Hey,

      In the metar.py file, instead of looping through the airports towards the bottom of the file (there’s a comment “Rotate through airports METAR on external display”)
      Remove the indented code under:
      if disp is not None:
      and replace it with this (replace “KPAE” for whatever airport you want to show it for, just make sure that airport is present in the airports file for the LEDs):
      displaymetar.outputMetar(disp, "KPAE", conditionDict.get("KPAE", None))

      Reply
  31. Phil benyo

    Food for thought out there for people that might be struggling with getting the lights to start automatically- remember to set the timezone for your raspberry pi…keeping in mind time off times set in crontab as well…. pulled my hair out for a few hours this afternoon when I got it working for a brief moment then it wouldn’t work for the life of me… 5 hours later I had the epiphany. Im not smart- just persistent.

    just ordering my map now and will update later!

    Reply
  32. Adam

    Hi Phillip! Great project – has been a lot of fun so far.
    We got most of the PI/LED/Screen stuff working today – and it has been great.

    Any idea on how to make the Screen show a subset of METARs? I have 45 airports on the map – but only want the screen to show 5-10 of the most important to me.

    Reply
    1. Philip Rueker Post author

      That’s a neat idea.
      I just updated the script to support this, so you just need to take the updated metar.py file and add a new file “displayairports” into the folder with the list of airports you want to show on the LED display.

      Reply
  33. Andre

    What a wonderful project – thank you Philip for posting! Can you answer what are the maximum number of addressable LED’s the Raspberry Pi can support?

    Reply
    1. Philip Rueker Post author

      It depends a bit on how bright you set them.
      But using the ones that I’ve used, they are rated to use 0.3W per LED at full power and I have mine set to 50% power, so with using 50% power and assuming that draws 0.15W per LED then you can probably safely power about 40-50 from the direct 5v pin as that would draw about 1.5 amps.
      If you want to control more LEDs than that, then I suggest you use a higher rated external power supply like this one https://amzn.to/3aUem14 to power the LEDs.
      You can find some details on the wiring for this here: https://learn.adafruit.com/neopixels-on-raspberry-pi/raspberry-pi-wiring

      Reply
      1. Andre

        So the limiting factor is the power supply current to the LED’s and not the number of LED addresses available?

        Reply
        1. Philip Rueker Post author

          Correct, addressing wise there’s no real limit (that I know of) and some people have built maps of the entire US with 200 LEDs.

          So the power supply is the only limit, so for bigger maps you just use a larger separate power supply to provide power to the LEDs.

          Reply
          1. Philip Rueker Post author

            They are addressed in sequence from the IO pin through the communications wire from the raspberry.

      2. Anthony Varga

        FYI my current map (v2) has 60 LEDs powered directly from the Pi Zero W with no issues and does not get hot.

        Reply
  34. Spencer Hamons

    I am building this project and would like to put a “Legend” in the lower left of my sectional. Would like to have four LEDs, one each for LIFR, IFR, MVFR, VFR. Is there a way to add-in this details in the AIRPORTS.py file to have it statically display these?

    Reply
    1. Philip Rueker Post author

      The easiest would be to just add a small bit of code to the metar.py file for this right before the “pixels.show()” on line 239:
      pixels[i] = COLOR_VFR
      pixels[i+1] = COLOR_MVFR
      pixels[i+2] = COLOR_IFR
      pixels[i+3] = COLOR_LIFR

      This will illuminate the 4 LEDs after looping through all the airports in the respective colors. If you needed to add a gap from the last airport to where your legend LEDs are then just increment the distance to the “i” variable.

      Reply
      1. Spencer Hamons

        Forgive my ignorance here, but when I try to add the code listed above, I get an error that says:

        IndentationError: unindent does not match any outer indentation level

        I am hitting “tab” and picking the colors from the declarations, but not sure what is causing the script to error.

        Reply
        1. Spencer Hamons

          Disregard my comment Philip. I made the change in a plain text editor instead of the Python editor and it worked fine.

          Reply
          1. Spencer Hamons

            Yeah, that was the problem I was running into with the Python editor in the Pi, all looked indented correctly but the editor would generate an error. I defaulted back to just doing it in a plain text editor and it worked fine. Not really sure what the Python editor was expecting.

            Appreciate your quick response. Building this out with my son now, hopefully will have it built and mounted by the middle of the week. Will post pictures.

  35. Ted

    Phillip,

    Amazing project, I learned so much by making this.

    I’m having issues when I change the airport list, I’ve populated the list with 15 ICAO codes and changes the metar.py configuration LED_COUNT=15. It worked fine with the airport list provided but with my new list I get this error:

    Setting LED 0 for CYQG to MVFR (0, 0, 255)
    Setting LED 1 for CYCK to MVFR (0, 0, 255)
    Setting LED 2 for CYZR to MVFR (0, 0, 255)
    Setting LED 3 for CYXU to MVFR (0, 0, 255)
    Setting LED 4 for CYKF to MVFR (0, 0, 255)
    Setting LED 5 for CYHM to MVFR (0, 0, 255)
    Setting LED 6 for CYYZ to MVFR (0, 0, 255)
    Setting LED 7 for CYSN to MVFR (0, 0, 255)
    Setting LED 8 for CYOO to MVFR (0, 0, 255)
    Setting LED 9 for CYBN to MVFR (0, 0, 255)
    Setting LED 10 for CYPQ to MVFR (0, 0, 255)
    Setting LED 11 for CYQA to MVFR (0, 0, 255)
    Setting LED 12 for CYTR to VFR (255, 0, 0)
    Setting LED 13 for CYOW to IFR (0, 255, 0)
    Setting LED 14 for CYND to IFR (0, 255, 0)
    Setting LED 15 for CYMX to LIFR (0, 125, 125)
    Traceback (most recent call last):
    File “metar.py”, line 235, in
    pixels[i] = color
    File “/usr/local/lib/python3.7/dist-packages/adafruit_pypixelbuf.py”, line 314, in __setitem__
    self._set_item(index, r, g, b, w)
    File “/usr/local/lib/python3.7/dist-packages/adafruit_pypixelbuf.py”, line 280, in _set_item
    raise IndexError
    IndexError

    Reply
    1. Philip Rueker Post author

      I count 16 in there (note that the first LED is LED 0).

      So if you give it LED_COUNT 15 then you’re one short, hence the error.

      Reply
  36. Julius

    I think this is so cool. I decided to build one. When I test run it I get these errors and cannot figure out how to correct the error. My manual test of the lights is good. Can you help? Here are the errors:
    File “metar.py”, line 226, in
    pixels[i] = color
    File “/usr/local/lib/python3.7/dist-packages/adafruit_pypixelbuf.py”, line 314, in __setitem__
    self._set_item(index, r, g, b, w)
    File “/usr/local/lib/python3.7/dist-packages/adafruit_pypixelbuf.py”, line 280, in _set_item
    raise IndexError

    Reply
    1. Philip Rueker Post author

      An IndexError usually means that you are trying to address more LEDs than you’ve specified in the LED_COUNT, so make sure you increase the LED_COUNT variable to be at least as big as the amount of LEDs you are using (including NULLS if used).

      Reply
    2. Julius

      Never mind! It was a problem between the table and the chair. When I checked the airports file I found there were two blank lines after the last airports files. I spent hours years ago with a BASIC program that was failing when it got to a point in the program reading a file. After having another set of eyes look at my data file, he spotted a missing comma right away.

      Reply
  37. Alex

    Hello. First of all congratulations and thanks to Philip Rueker for putting this together and inspiring the res to us.

    I have and odd issue my ALITOVE WS2811 12mm Diffused Digital RGB LED Pixel Light seems to be
    pixels.fill((0,255,0)) Blue
    pixels.fill((255,0,0)) RED
    pixels.fill((0,0,255)) Green

    Not like on the tutorial, Is this common..?
    So I simply changed the metal file.
    But then found that when tested I get for example my first ten led all do
    All red
    All blue
    All green
    Just fine
    I but when I setup the airports, after an airport that is IFR ( red) the next led will glow purple, regardless of the metal code . I can see the code saying the correct color but it glows differently.

    Is there a test code sequence that runs the pixels thru a color range? Or any ideas on how to test my leds?

    Reply
    1. Philip Rueker Post author

      That’s very strange. May be a faulty string of lights.

      If you scroll up in the article I explain how you can test all the LEDS for the colors.
      Basically connect to the py, then enter sudo python3 and then you can just initialize the LEDS with one color at a time to test like this:
      import board
      import neopixel
      pixels = neopixel.NeoPixel(board.D18, 30)
      pixels.fill((0,255,0))

      Reply
  38. Andre

    On your GitHub page, the 1st Software Setup instruction is to download Raspberry Buster Lite. That link takes me to a Raspberry Pi 404 error page. Where can I find Buster Lite?

    Reply
  39. Andre

    Thanks Philip. After successfully downloading Raspberry Pi OS Lite and unzipping, I tried flashing my SD card with the .img file using Etcher and receive the error message: “Something went wrong. If it is a compressed image, please check that the archive is not corrupted. ENOENT: No such file or directory, open ‘C:\Users\Andre\AppData\Local\Temp\balena-etcher-electron–752-to2cuXRb9arS-.cmd’
    As mentioned, has been unzipped/not compressed. How can I flash this file?

    Reply
    1. Philip Rueker Post author

      Not sure about etcher.

      I used the Raspberry Pi imager last time, which will let you select the image, it’s available at the same link.

      Reply
  40. Andre

    I added the wpa_supplicant.conf (with my WiFi’s network & password names included) and ssh files as instructed but my Zero is not connecting to my WiFi – it doesn’t appear in my router/modem’s Device Table list. When I remove the SD card after it’s been in the Pi, it appears the Pi is removing the SSH file when viewed on my Win 10 machine.

    With every step I’ve so far had issues – is this the best way for us to communicate?

    Reply
    1. Philip Rueker Post author

      Here’s some tips to get the wifi working: https://raspberrytips.com/raspberry-pi-wifi-setup/ or alternatively you could try to use this image called BerryLan that has an app to hook up the wifi, though I have no experience with it.

      Yes I believe the ssh file goes away once it’s been absorbed by the raspberry pi if you put the sd card back into the pc.

      Sharing problems via the comments here is helpful for others who run into issues.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.