tedder/tedder-metar-map

livesectional/metar map

★ 1Forks 0PythonGitHub ↗Compare

README

tedder's METAR map

There are many like it, but this one's mine.

Goals:

  • reasonably sane code
  • should run on a microcontroller (eg esp32)
  • can possibly run on a Pi
  • should be able to run it locally for testing, no need to upload to a microcontroller every time.
  • hopefully unit tests to catch regressions
  • configure in text files or in a web server.
  • easy for an end user to configure- this is why it uses text files vs toml or yaml or json.
  • not too many custom configurations. just a dead-simple.
  • 'phone home' so I can help friends with weird configurations

Future:

  • use the light sensor on the carrier board
  • calculate/approximate the LED power consumption so it can run off USB power
  • fall back to 'wifi AP mode' on failed connect
  • OTA updates
  • regression tests in github actions

The v1 hardware for this is about $25 ($10ish for the carrier board, $12 for the qtpy). It's simpler than a Pi, it doesn't have as fussy of power requirements as a Pi, and it's much thinner, making it easier to wall-mount.

how to build

how to install

bootstrap

Install circuitpython on qtpy esp32-s2:

  1. download circuitpython uf2 (10.0 or later required)
  2. press reset button
  3. when RGB LED turns purple, press reset button again (about a half second later? almost a double-click)
  4. note QTPYS2BOOT mounted folder on success
  5. copy latest circuitpython uf2 to this folder
  6. qtpy will auto-disconnect and remount as CIRCUITPY

install libraries

Install circup if you don't have it:

pip install circup

Then install the required libraries:

circup install neopixel adafruit_requests adafruit_datetime adafruit_httpserver adafruit_ssd1306 adafruit_ntp adafruit_framebuf adafruit_pixelbuf adafruit_bus_device adafruit_connection_manager

configure

Copy settings.toml.example to settings.toml and fill in your WiFi credentials:

cp settings.toml.example /Volumes/CIRCUITPY/settings.toml

Create an airports.txt file on the device with one ICAO code per line, in LED order. Use OFF for unused LEDs, OFF_LEGEND for legend LEDs. See airports.txt.ted for an example.

deploy

cp code.py /Volumes/CIRCUITPY/code.py

CircuitPython reloads automatically on file write.

troubleshooting

circuitpython boot states:

  • One green flash - code completed without error.
  • Two red flashes - code ended due to an exception.
  • Three yellow flashes - safe mode. May be due to CircuitPython internal error.

mu editor, mode->circuitpython, serial, CTRL-D in lower window, watch output

bricked device recovery

  1. boot+reset button sequence
  2. serial should appear in the web esptool
  3. connect
  4. erase
  5. choose file, combined.bin, program
  6. once finished, press reset button
  7. green LED should appear, and QTPYS2BOOT dir
  8. cp qtpy python uf2, it'll end with an I/O error