/esp32_py

Primary LanguagePython

esp32_fun

Development Workflow

Prerequisites

  • ESP32 WROOM
  • MicroPython firmware downloaded

workflow

  • do work
    • Create main() within your app, placed in apps folder.
  • save work
  • run upload script (F5)
  • mpremote*
  • *import apps.<app_name> as app
  • *import app.main()

* Command is executed on ESP32 REPL.

Description

Files

main.py

This script is uploaded to the ESP32 when running the upload script. It is placed in the root directory, such that it will auto-load when the ESP32 is reset. By default, this file appends the libs/ directory to system PATH, that way files included in libs/ directory are able to be imported by applications.

Directories

libs/

Files placed in this directory are uploaded to the ESP32, into the /libs directory. This directory is added to PATH via main.py when the ESP32 is rebooted.

apps/

Files placed in this directory are uploaded to the ESP32, into the /apps directory. This is a directory for application code. It has access to modules within libs/.

tools/

This directory is NOT uploaded to the ESP32. The files in this directory are utilities for interacting with the ESP32, including uploading files to the device, flashing the device with given firmware, resetting the device, etc.

Utilities

pdm Scripts

Use pdm run to use the scripts provided in this section.

upload

Will upload all files from src/esp32/apps and src/esp32/libs onto the ESP32 into their resepective folder.

reset

Hard reset the ESP32.

connect

Connect to the ESP32.

Resources