install esp-idf 4.4.2

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
RobH
Posts: 91
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

install esp-idf 4.4.2

Post by RobH » Thu Sep 01, 2022 9:41 am

I have been using the esp-idf without significant problems before, but installing it on a fresh Linux Mint 21 system fails. I followed the getiing started instructions carefully (several times after removing ~/esp and ~/.espressif). The install seems to preceed OK.
After starting './install.sh' I see:
Detecting the Python interpreter
Checking "python" ...
Python 3.10.4
"python" has been detected
Installing ESP-IDF tools
Current system platform: linux-amd64
WARNING: File /home/rob/.espressif/idf-env.json was not found.
Creating /home/rob/.espressif/idf-env.json
Then it starts installing xtensa tools, butat some point it fails with
Creating a new Python environment in /home/rob/.espressif/python_env/idf4.4_py3.10_env
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/distutils-precedence.pth'
Consider using the `--user` option or check the permissions.

RuntimeError: failed seed with code 1
What is the reason for the 'permission denied' (never saw it in previous installs)
The consideration to use of '--user' option is unclear: where?

Suggestions?

Regards, Rob.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: install esp-idf 4.4.2

Post by jimmo » Thu Sep 01, 2022 11:50 am

RobH wrote:
Thu Sep 01, 2022 9:41 am
What is the reason for the 'permission denied' (never saw it in previous installs)
The consideration to use of '--user' option is unclear: where?
That is very strange. It looks like `pip` (invoked from inside the IDF installer) isn't detecting the virtual environment, and is attempting to install a package globally.

(The hint about `--user` is if you were invoking the pip command directly. It's not useful here, because it _should_ be using the venv).

It's interesting that this looks identical to https://github.com/espressif/esp-idf/issues/9049 (although that's IDF 5.0) but unfortunately that was closed without really understanding what was going wrong.

I guess you could try making the suggested modification to tools/idf_tools.py and see if that makes it work... seems a bit dodgy though.

User avatar
RobH
Posts: 91
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

Re: install esp-idf 4.4.2

Post by RobH » Thu Sep 01, 2022 12:57 pm

Thanks for the quick response.
The 'getting started' info suggested to install v4.4.2 (probably because I selected esp32). I retied a clean install with the 'getting started' for esp32C3. This resulted in install of apparently v5.1 and did not give the above mentioned error with ./install.sh.
Unfortunately this gave other error messages:
CMake Error at /home/rob/esp/esp-idf/tools/cmake/build.cmake:245 (message):
Failed to resolve component 'esp_adc_cal'.
Call Stack (most recent call first):
/home/rob/esp/esp-idf/tools/cmake/build.cmake:281 (__build_resolve_and_add_req)
/home/rob/esp/esp-idf/tools/cmake/build.cmake:574 (__build_expand_requirements)
/home/rob/esp/esp-idf/tools/cmake/project.cmake:434 (idf_build_process)
CMakeLists.txt:58 (project)


-- Configuring incomplete, errors occurred!
See also "/home/rob/micropython/ports/esp32/build-LOLIN_S2_MINI/CMakeFiles/CMakeOutput.log".
HINT: The component esp_adc_cal has been moved to the IDF component manager or has been removed and refactored into some other component.
Please look out for component in 'https://components.espressif.com' and add using 'idf.py add-dependency' command.
Refer to the migration guide for more details.
So this didn't help me really! (the logs werent helpful)
Then I tried the 'hello_world' example as suggested in 'getting started'. This did not produce error messages during compile!
I do not know what to do with the 'add-dependency'.

User avatar
RobH
Posts: 91
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

Re: install esp-idf 4.4.2

Post by RobH » Fri Sep 02, 2022 10:15 am

@jimmo
I had a look in the espressif issue 9049 you mentioned, esp. in the proposed code change of 'idf_tools.py'. After a similar change:
subdir = 'bin' --> subdir = 'local/bin'

of line 1023 (with v4.4) of 'idf_tools,py' both the install was succesful and creating a .bin file from source was successful too! Thanks!

Post Reply