ESP32 Firmware

The ESP32 firmware can be compiled in multiple variations to be used on different devices:

The firmware is written and C/C++ and the source code is freely available on GitHub. The Arduino ESP32 projekt and PlatformIO are used as basis.

Preparation

First, PlatformIO (version 6 or newer), Node.js (version 14 or newer) and Git have to be installed according to their installation manuals. For PlatformIO we recommend using the PlatformIO IDE extension for Visual Studio Code, but you can also use PlatformIO Core instead. Node.js and Git have to be installed outside of Visual Studio Code, not as Visual Studio Code extension.

In general you should always use the latest version of PlatformIO and Node.js. For the Node.js package manager npm version 8 or newer is required.

For Windows the Silicon Labs CP210x Universal Windows Driver has to be installed. Linux and macOS have this driver already build in.

Next, download the esp32-firmware repository from GitHub as ZIP file and unpack it or clone the repository using git.

The platformio.ini file is located in the software/ directory. Make sure to open the software/ directory in Visual Studio Code as the PlatformIO project directory to build any of the environment environments.

Firmware Building

Choose the PlatformIO environment corresponding to the firmware variation you want to build:

  • ESP32 Brick: esp32 defined in esp32.ini
  • ESP32 Ethernet Brick: esp32_ethernet defined in esp32_ethernet.ini
  • WARP Charger Smart and Pro: warp defined in warp.ini
  • WARP2 Charger Smart and Pro: warp2 defined in warp2.ini

To build a specific firmware run its corresponding PlatformIO "Build" task. To build a firmware, upload it to a Brick and connect to its serial console all in one step you can run the PlatformIO "Upload and Monitor" task. This requires that the Brick is connected to USB beforehand. You can also upload the built firmware via the web interface.

The firmware file can be found in software/build and its name ends with _merged.bin The file name has the form [environment]_firmware_[version]_[build timestamp][extension]. For example warp2_firmware_2_0_7_62d7d0b1_merged.bin is a WARP2 Charger firmware version 2.0.7 that was built at the unix timestamp 0x62d7d0b1 = 1658310833, (i.e. 2022-07-20 13:27:02).

Firmware Structure

The functionality and the web interface of the firmware are put together from modules. The variations of the firmware differ mostly in their list of active modules. This list is specified per environment in the corresponding .ini file using the custom_backend_modules and custom_frontend_modules options.

The tutorial regarding the ESP32 firmware shows step by step how to add a custom module to the firmware.