docker-nodemcu-build icon indicating copy to clipboard operation
docker-nodemcu-build copied to clipboard

Support for IDF 5

Open marcelstoer opened this issue 3 years ago • 15 comments
trafficstars

~~Ideally we can support both IDF 3 and 4 (i.e. the NodeMCU branches dev-esp32-idf3-final and dev-esp32).~~

NodeMCU firmware dev-esp32 is now on IDF ~4~ 5 (as per https://github.com/nodemcu/nodemcu-firmware/commit/6798f027f3eecb2fdda4e6544c5586cdbe8802d0 on that branch).

  1. https://github.com/marcelstoer/docker-nodemcu-build/blob/master/configure-esp32 does likely not need any changes.
  2. https://github.com/marcelstoer/docker-nodemcu-build/blob/master/build do we still need to check for sdkconfig.defaults?
  3. Adjust the build script https://github.com/marcelstoer/docker-nodemcu-build/blob/master/build-esp32

marcelstoer avatar Jan 02 '22 11:01 marcelstoer

Considering the current version of IDF is 5.0, supporting IDF 3 here is probably not worth the effort?

jmattsson avatar Jan 17 '23 08:01 jmattsson

True, a year ago it might have been. I'll rephrase the task.

marcelstoer avatar Jan 17 '23 08:01 marcelstoer

Some problems do go away when you procrastinate enough 🤣

jmattsson avatar Jan 17 '23 08:01 jmattsson

I haven't been using NodeMCU for quite some time. Due to the comments over at #104 I spent a little time trying to make this run - knowing that my outdated NodeMCU/ESP-IDF know-how will probably stop me half-way.

So, there's now a feat/idf-4 branch and a marcelstoer/nodemcu-build:esp32 image (<- note the tag!) with my WIP.

docker run --rm -ti -v $(pwd):/opt/nodemcu-firmware marcelstoer/nodemcu-build:esp32 configure-esp32 almost succeeds but it eventually crashes with

-- Project sdkconfig file /opt/nodemcu-firmware/sdkconfig
Traceback (most recent call last):
  File "/opt/nodemcu-firmware/sdk/esp32-esp-idf/tools/kconfig_new/confgen.py", line 33, in <module>
    import gen_kconfig_doc
  File "/opt/nodemcu-firmware/sdk/esp32-esp-idf/tools/kconfig_new/gen_kconfig_doc.py", line 27, in <module>
    import kconfiglib
ImportError: bad magic number in 'kconfiglib': b'\x03\xf3\r\n'
CMake Error at sdk/esp32-esp-idf/tools/cmake/kconfig.cmake:266 (message):
  Failed to run confgen.py
  (/root/.espressif/python_env/idf4.4_py3.8_env/bin/python;/opt/nodemcu-firmware/sdk/esp32-esp-idf/tools/kconfig_new/confgen.py;--kconfig;/opt/nodemcu-firmware/sdk/esp32-esp-idf/Kconfig;--sdkconfig-rename;/opt/nodemcu-firmware/sdk/esp32-esp-idf/sdkconfig.rename;--config;/opt/nodemcu-firmware/sdkconfig;--defaults;/opt/nodemcu-firmware/sdkconfig.defaults;--env-file;/opt/nodemcu-firmware/build/config.env).
  Error 1
Call Stack (most recent call first):
  sdk/esp32-esp-idf/tools/cmake/build.cmake:523 (__kconfig_generate_config)
  sdk/esp32-esp-idf/tools/cmake/project.cmake:384 (idf_build_process)
  CMakeLists.txt:10 (project)


-- Configuring incomplete, errors occurred!
See also "/opt/nodemcu-firmware/build/CMakeFiles/CMakeOutput.log".
cmake failed with exit code 1
make: *** [Makefile:21: menuconfig] Error 2

However, what's worse IMO is that I feel the whole approach of using a Docker image that way may no longer be feasible with IDF 4. We now have to call the IDF install.sh which installs loads of stuff.

On a standalone Linux installation that may be ok because you only do this once and whenever the IDF version changes. Doing this every time you create a Docker container isn't viable. We can't pre-load the Docker image with the required packages as they depend on the IDF version which is driven by the user environment rather than the build image. An obvious remedy might be to keep the container running once everything has been initialized (i.e. removing --rm from docker run). However, that doesn't really create a stable setup. An alternative might be to run install and then "Docker commit" the local changes.

Anyway, feel free to drive this forward by engaging here and - more importantly - by creating PRs for that feat/idf-4 branch.

marcelstoer avatar Jan 15 '24 22:01 marcelstoer

Is it feasible to pre-load the docker image with the IDF required bits? As in, effectively run the ./install.sh for each NodeMCU/IDF version the docker image is meant to support?

That said, there was some incompatibility with some IDF 4.x versions used together with IDF 5.x, so on closer thought it might not be a good path to go down.

jmattsson avatar Jan 30 '24 04:01 jmattsson