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.
Install circuitpython on qtpy esp32-s2:
- download circuitpython uf2 (10.0 or later required)
- press reset button
- when RGB LED turns purple, press reset button again (about a half second later? almost a double-click)
- note QTPYS2BOOT mounted folder on success
- copy latest circuitpython uf2 to this folder
- qtpy will auto-disconnect and remount as CIRCUITPY
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
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.
cp code.py /Volumes/CIRCUITPY/code.py
CircuitPython reloads automatically on file write.
- 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
- boot+reset button sequence
- serial should appear in the web esptool
- connect
- erase
- choose file, combined.bin, program
- once finished, press reset button
- green LED should appear, and QTPYS2BOOT dir
- cp qtpy python uf2, it'll end with an I/O error