GitHub - BJap/CircuitPython_TransitPredictionsApp: Prediction App That Displays Transit Predictions on a Display Panel · GitHub
Skip to content

BJap/CircuitPython_TransitPredictionsApp

Folders and files

Repository files navigation

CircuitPython_TransitPredictionsApp

Prediction App That Displays Transit Predictions on a Display Panel

Materials

Prerequisites

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.

Instructions

  1. Connect the board to the LED display as shown here.
  2. Follow the instructions here to install CircuitPython on the Portal S3, using the USB-C data cable.
  3. Download the Adafruit 10.x CircuitPython bundle here.
  4. Download the font to be used from here backup in bundle here.
  5. Go to the 511.org website and request an API token using the form here, and this shouldn't take long.
  6. Open the settings.toml file 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_SSID the 2.4GHz network to which the board will connect
    • CIRCUITPY_WIFI_PASSWORD the network password
    • 511_API_KEY (obtained from step 4)
  7. Make a fonts folder in the root directory of the board and copy the font file into it.
  8. Make a lib folder (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)
  9. 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.
  10. 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 final result should look like this:

TransitPredictionsAppExample

The example could also be changed to support more transit lines per LED display to look like this:

TransitPredictionsAppExample_Expanded

Troubleshooting Steps

  • 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.py file has a DEBUG_MODE to enable logging and the console output instead of the sign itself when set to True.

Next Steps

  • The values in the settings.toml file 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.toml file 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.py file for the display.
  • Other APIs or regions can be used in the transit_predictions_app_io.py for sources.

References

About

Prediction App That Displays Transit Predictions on a Display Panel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages