Get live updates from MTBA bus routes displayed on an LED board!
Adafruit MatrixPortal and a HUB75 LED board.
-
Make sure the ESP32 NINA firmware on your MatrixPortal is updated so it can handle HTTPS requests
a. Connect the MatrixPortal device to your computer
b. Double-click the RESET button to enter the bootloader mode
c. Copy over
firmware/MatrixPortal_M4_ESP32_Passthrough_TinyUSB_2023_07_30.uf2to the device's drive that appears on your computerd.
pip install esptoole.
ls /dev/tty.*to determine the usb-port your device is connected tof.
esptool.py --port /dev/tty.<insert_usb_port> --before no_reset --after no_reset --baud 115200 write_flash 0 firmware/NINA_ADAFRUIT-esp32-3.2.0.bin -
Format your MatrixPortal with a CircuitPython version found in
circuitpython-versions(verified as working), or whatever latest version is available onlinea. Copy the .uf2 file over to the MatrixPortal drive as it appears on your desktop
b. The drive will now appear as CIRCUITPY
-
Create a
settings.tomlfile, and include CIRCUITPY_WIFI_SSID, CIRCUITPY_WIFI_PASSWORD, and MBTA_API_KEY. Copy thesettings.tomlfile over to CIRCUITPY.a. Get an API key from the MBTA
b. The file should look like this:
CIRCUITPY_WIFI_SSID = "****" CIRCUITPY_WIFI_PASSWORD = "****" MBTA_API_KEY = "****" -
Copy over the
fonts/direcectory to the CIRCUITPY drive -
Replace the contents of the CIRCUITPY's
circuitpy-lib/directory with the one in this repo -
Replace the contents of the CIRCUITPY's
code.pywith thecode.pyfrom this repoa. If you are not using a 64x64 LED board with a fifth
Epin, you will need to modify the definition of thematrixobjectb. You can find the stop IDs of bus/T stops you prefer by clicking on the stop's icon in Google Maps on web (not mobile)
-
The code will now run whenever the board is connected to sufficient USB-C power :)
Alternative instructions for steps 1 and 2 from Adafruit.
4x6 font (it's really 3x5!) from Janne V. Kujala, converted to PCF thanks to Adafruit
Thanks to Adafruit for hardware.
Connect to board terminal: minicom -b 115200 -o -D /dev/tty.<insert_usb_port>
TODO: issue where board shuts off after being on for awhile (logic error? OOM?)