Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 ESP32 Project Layout


🛠 1. Environment Setup

  1. Install Python 3 & Go-Task (Taskfile runner):

    • macOS: brew install go-task/tap/go-task python
    • Linux (Ubuntu/Debian): sudo snap install task --classic (or via official script)
    • Windows: winget install Task.Task (or choco install go-task)
  2. Create Virtual Environment & Install Dependencies:

    # macOS / Linux:
    python3 -m venv .venv
    source .venv/bin/activate
    
    # Windows (PowerShell):
    python -m venv .venv
    .venv\Scripts\Activate.ps1
    
    # Install mpremote & type stubs:
    pip install mpremote micropython-esp32-stubs esptool

⚡ 2. Flashing ESP32 Firmware

If your board is clean or needs a firmware update:

  1. Download MicroPython binary: https://micropython.org/download/esp32/
  2. Install esptool: pip install esptool
  3. Erase flash memory: esptool.py --chip esp32 --port /dev/tty.usbserial-* erase_flash
  4. Flash firmware: esptool.py --chip esp32 --port /dev/tty.usbserial-* --baud 460800 write_flash -z 0x1000 firmware.bin

📁 3. Project Structure

└── 📁.vscode
    ├── extensions.json
    ├── settings.json
    ├── tasks.json
└── 📁config
    ├── config.py
└── 📁data
    ├── some-data
└── 📁lib
    ├── bootstrap.py
└── 📁src
    └── 📁app
        ├── app.py
    └── 📁logger
        ├── setup.py
    └── 📁utils
        ├── system_info.py
├── .micropico
├── main.py
└── taskfile.yaml

⚙️ 4. Taskfile Commands (task)

All project workflows are managed via taskfile.yaml:

  • task dev : [Main] Uploads project files and immediately attaches REPL console
  • task upload : Uploads modified/all project files to the ESP32
  • task run : Uploads files and performs a soft reset (mpremote reset)
  • task repl : Opens interactive MicroPython REPL console
  • task clean : Removes all project files from the ESP32 filesystem
  • task ls : Lists all files currently stored on the chip

💡 5. Useful REPL Shortcuts (task repl / task dev)

  • Ctrl + C — Stop script execution.
  • Ctrl + D — Perform a soft reset.
  • Ctrl + ] (or Ctrl + X) — Exit REPL back to macOS terminal.

📊 6. Logging & System Diagnostics

On application startup, system metrics are automatically logged via SystemInfo.log():

  • CPU Frequency & Chip Temperature.
  • RAM Usage (Used / Total / Free %).
  • Flash VFS File System Storage stats.

Configure diagnostics in config/config.py:

LOG_LEVEL = logging.DEBUG
SYSTEM_INFO_LOG = True  # Enable/disable system info logs

Language / Язык:
English | Русский

About

ESP32 chip project layout

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages