Prediction App That Displays Transit Predictions on a Display Panel
- A display (this example uses the 64x32 RGB LED Matrix - 5mm pitch)
- A controller board (this example uses the Adafruit Matrix Portal S3)
- A USB-C data cable
- A USB-C 5V power plug (and optional power-only USB-C cable if preferred for running)
Be sure to have the CircuitPython 10.x UF2 firmware installed on the Matrix Portal S3 before doing this. The instructions to do this can be found here.
- Connect the board to the LED display as shown here.
- Follow the instructions here to install CircuitPython on the Portal S3, using the USB-C data cable.
- Download the Adafruit 10.x CircuitPython bundle here.
- Download the font to be used from here backup in bundle here.
- Go to the 511.org website and request an API token using the form here, and this shouldn't take long.
- Open the
settings.tomlfile and input the following values (the rest can be left as a working example for San Francisco's Powell station predictions for now):CIRCUITPY_WIFI_SSIDthe 2.4GHz network to which the board will connectCIRCUITPY_WIFI_PASSWORDthe network password511_API_KEY(obtained from step 4)
- Make a
fontsfolder in the root directory of the board and copy the font file into it. - Make a
libfolder (if it does not exist yet) in the root directory of the boardCopy the following Adafruit 10.x CircuitPython libraries into it:adafruit_bitmap_font(copy the folder)adafruit_display_shapes(copy the folder)adafruit_display_text(copy the folder)adafruit_matrixportal(copy the folder)adafuit_connection_manager.mpy(copy the file)adafruit_datetime.mpy(copy the file)adafruit_requests.mpy(copy the file)
- Copy all the python files from this repo as well as the toml file onto the board's root directory and approval overwrite when asked.
- Safely eject the board from the computer and move the cable from the computer to the USB-C power plug (or use the power USB-C cable instead).
The example could also be changed to support more transit lines per LED display to look like this:
- It's sometimes the case the board will not go into bootloader mode. Follow the instructions here to factory reset the unit and try the 'double tap' trick again to flash CircuitPython onto the board.
- Transit examples do not run 24/7 so if no results are displayed this might be run too late at night, and it's best to come back to it the next day.
- The
config.pyfile has aDEBUG_MODEto enable logging and the console output instead of the sign itself when set toTrue.
- The values in the
settings.tomlfile can be changed based on the stop, direction(s) (OB and/or IB), and routes that are of interest now that the board and sign are up and running using comma-delimited separation where appropriate. - The rate limit can be changed in the
settings.tomlfile as well per API in case a plan allows a higher frequency, with the default set to avoid this limit if not provided. - Other displays can be used and appearances can be customized in the
transit_predictions_app_io.pyfile for the display. - Other APIs or regions can be used in the
transit_predictions_app_io.pyfor sources.


