kraxor's boilerplate framework

Bence Balint cefc4cce2a Merge branch 'kbf-41' of kraxor/kbf into develop 2 years ago
doc 9d5a4de7a8 add doxygen.conf 3 years ago
include 8150b4710c KBF-41 implement SSL support in WebService 2 years ago
lib ac0cd14fe8 KBF-9 add lib/esp-idf-lib 3 years ago
src b90b48ebd0 KBF-41 increase stack size for httpd with SSL 2 years ago
test 8150b4710c KBF-41 implement SSL support in WebService 2 years ago
test_app 3fd2a3870a KBF-41 make SSL certificates configurable in http::Server 2 years ago
.gitignore dac12c5059 KBF-19 implement HTTPS support 3 years ago
.gitmodules ac0cd14fe8 KBF-9 add lib/esp-idf-lib 3 years ago
CMakeLists.txt 4bd1be9f6b KBF-32 create new wifi.h and tests 2 years ago
README.md c2022cd72b KBF-13 update sdkconfig for esp-idf/v4.3 3 years ago
doxygen.conf ca5aaeec96 reorganise project 3 years ago

README.md

Kraxor's Boilerplate Framework

A collection of useful things in the form of an esp-idf component.

Tested with esp-idf/v4.3.

Using as a component

To use kbf as an esp-idf component, clone it into the components subdirectory of your project:

cd /path/to/project/components
git clone https://git.kraxor.net/kraxor/kbf.git
cd kbf
git submodule update --init

Then you can REQUIRE it in idf_component_register in your app's CMakeLists.txt:

idf_component_register(
        SRCS "app_main.cpp"
        REQUIRES "kbf"
        INCLUDE_DIRS "."
)

Checkout as standalone project

For a standalone checkout, in order for the test application to compile, the parent directory of the project root (test_app/../..) is included in EXTRA_COMPONENT_DIRS. This is fine when used as a component, but will cause issues if this directory contains other projects that are not esp-idf components.

Therefore, if you want to setup kbf as a standalone project, it is recommended to clone the project into a subdirectory:

mkdir ~/src/kbf
cd ~/src/kbf 
git clone https://git.kraxor.net/kraxor/kbf.git
cd kbf  # ~/src/kbf/kbf/
git submodule init && git submodule update

CLion setup

The smoothest way is to open the test_app as a project, e.g. following the above example:

clion ~/src/kbf/kbf/test_app

Next, you need to setup cmake. In File / Settings / Build, Execution, Deployment / CMake, add the following to CMake options:

-DIDF_PATH=/path/to/esp-idf

Then you need to add IDF_PATH again, this time as an environment variable, along with the PATH variable updated by /path/to/esp-idf/export.sh. In my case, it looks like this:

IDF_PATH=/home/kraxor/src/esp-idf;PATH=/home/kraxor/src/kbf/esp-idf/components/esptool_py/esptool:/home/kraxor/src/esp-idf/components/espcoredump:/home/kraxor/src/esp-idf/components/partition_table:/home/kraxor/src/esp-idf/components/app_update:/home/kraxor/.espressif/python_env/idf4.4_py3.8_env/bin:/home/kraxor/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin:/home/kraxor/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin:/home/kraxor/.espressif/tools/xtensa-esp32s3-elf/esp-2020r3-8.4.0/xtensa-esp32s3-elf/bin:/home/kraxor/.espressif/tools/riscv32-esp-elf/1.24.0.123_64eb9ff-8.4.0/riscv32-esp-elf/bin:/home/kraxor/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/home/kraxor/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/home/kraxor/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin:/home/kraxor/src/esp-idf/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

After this, CLion should be able to parse test_app/CMakeLists.txt and add the parent directory (i.e. kbf root) and esp-idf to the project.