Prerequisites for developing¶
Prerequisites are the prerequisites for deploying, plus:
- Visual Studio Code installed
- PlatformIO for Visual Studio Code installed
- CMake installed
- CMake Tools extension for Visual Studio Code installed
- In Visual Studio Code, open a PlaformIO Command Line Interface and enter
- If your user directory name contains a whitespace, you may need to change the platformio.ini file. To avoid the error message "Error: Detected a whitespace character in project paths" when building an ESP-IDF project with PlatformIO, add the following lines to the platformio.ini file, as documented in https://docs.platformio.org/en/latest/frameworks/espidf.html#limitations:
- This GitHub repository cloned
Refer to developing using a devcontainer should you prefer that way of developing.
Coding and uploading¶
We recommend using a device without secure boot for developing. Follow the steps below to build the firmware and flash it to a device:
- In the top-left corner, select File -> Open Folder.
- Select the folder where you cloned or extracted the repository.
- Wait for PlatformIO to finish initialization. This step is done until you no longer see "PlatformIO: Loading tasks..." in the VS Code status bar. > ⚠️ This step is important! This may take up to ±10 minutes. If you do not wait for this to finish, the project will not be able to build correctly.
- In the
srcfolder you will findmain.cpp; this is an example application. - In the
libfolder you will find the library that this repository contains. - To change between provisioning via BLE or SoftAP, in the
platformio.inifile, comment the line including-DCONFIG_EXAMPLE_PROV_TRANSPORT_BLEand uncomment the line including-DCONFIG_EXAMPLE_PROV_TRANSPORT_SOFTAPor vice versa. - Change the code in
src/main.cas you see fit. - Build the firmware. See also our documentation on how to build NeedForHeat firmware