Development for ESP32-based pax-devices

This document specifies the development configuration ESP32 based pax-devices

Compiling with esp-idf

I am compiling in Linux, Debian 10 to be precise.

Locations for code and application

  • ESP-IDF is installed in the default path, ~/esp/esp-idf .
  • The pax-devices project is in the CFG_Projects_Path directory
  • The Visual Studio Code workspace is saved with the name CFG_Projects_Path/pax-devices/pax-devices.code-workspace
  • Additional ESP-IDF components are in CFG_CodeLib_Path/ESP32 and CFG_CodeLib_Path/Generic directories

Create the ~/vscode-pax-devices with the following content:

#!/bin/bash

ProjectPath="CFG_Projects_Path/pax-devices"
ProjectName="pax-devices"

export CodeLib_PATH=CFG_CodeLib_Path

cd $ProjectPath
. ~/esp/esp-idf/export.sh
code $ProjectPath/$ProjectName.code-workspace

Source that file with . vscode-pax-devices and it will launch Visual Studio Code and a terminal. From that terminal, to compile, flash and test (for example pax-Gateway), use:

cd CFG_Projects_Path/pax-Gateway/SW
idf.py menuconfig
idf.py build
idf.py flash
idf.py monitor

Example directory structure

  • ESP-IDF is installed in the default path, ~/esp/esp-idf .
  • The pax-devices project is in the /data/Projects/pax-devices directory
  • The Visual Studio Code workspace is saved with the name CFG_Projects_Path/pax-devices/pax-devices.code-workspace
  • Additional ESP-IDF components are in /data/Projects/CodeLibrary directories:
    • Debouncer is located in /data/Projects/CodeLibrary/Generic
    • ESP32DLEDController, ESP32RMT, … esp-idf components are located in /data/Projects/CodeLibrary/ESP32

The /data/Projects/pax-devices/pax-devices.code-workspace file is:

{
    "folders": [
        {
            "path": "."
        },
        {
            "path": "/data/Projects/pax-Gateway"
        },
        {
            "path": "/data/Projects/pax-DLED"
        },
        {
            "path": "/data/Projects/pax-DLEDGrid"
        },
        {
            "path": "/data/Projects/CodeLibrary"
        }
    ],
    "extensions": {
        "recommendations": [
            "ms-vscode.cpptools",
            "editorconfig.editorconfig",
            "lextudio.restructuredtext",
            "ms-python.python",
            "gruntfuggly.todo-tree"
        ]
    }
}

The vscode-pax-devices file is:

#!/bin/bash

ProjectPath="/data/Projects/pax-devices"
ProjectName="pax-devices"

export CodeLib_PATH=/data/Projects/CodeLibrary

cd $ProjectPath
. ~/esp/esp-idf/export.sh
code $ProjectPath/$ProjectName.code-workspace