problem setting up esp-idf

VosperD
Posts: 8
Joined: Tue Aug 11, 2020 7:19 pm

problem setting up esp-idf

Postby VosperD » Wed Aug 12, 2020 8:09 am

I'm trying to install esp-idf on a Linux Mint pc.
I have followed the Get Started instruction at espressif.com.
All went well until I entered " . $HOME/esp/esp-idf/export.sh"
Then I get:-
"Setting IDF_PATH to '/home/vosper/esp/esp-idf'
Adding ESP-IDF tools to PATH...
Using Python interpreter in /usr/bin/python
Checking if Python packages are up to date...
The following Python requirements are not satisfied:
click>=5.0
future>=0.15.2
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
gdbgui>=0.13.2.0
pygdbmi<=0.9.0.2
reedsolo>=1.5.3,<=1.5.4
bitstring>=3.1.6Please follow the instructions found in the "Set up the tools" section of ESP-IDF Getting Started Guide
Diagnostic information:
IDF_PYTHON_ENV_PATH: (not set)
Python interpreter used: /usr/bin/python
Warning: python interpreter not running from IDF_PYTHON_ENV_PATH
PATH: /home/vosper/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin:/home/vosper/.espressif/tools/xtensa-esp32s2-elf/esp-2020r2-8.2.0/xtensa-esp32s2-elf/bin:/home/vosper/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/home/vosper/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/home/vosper/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin:/home/vosper/esp/esp-idf/tools:/home/vosper/bin:/home/vosper/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/microchip/xc16/v1.35/bin:/opt/microchip/xc16/v1.35/bin"

I would welcome any advice.
Don

VosperD
Posts: 8
Joined: Tue Aug 11, 2020 7:19 pm

Re: problem setting up esp-idf

Postby VosperD » Fri Aug 14, 2020 9:33 am

Started from scratch.
Installed prerequisites, got esp-idf and Set up tools.
Situation is the same.
The message says to "follow the instructions found in the "Set up the tools" section" but there are only two instructions there for Linux :-

cd ~/esp/esp-idf
./install.sh

Is there possibly something that I am missing out?
Don

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: problem setting up esp-idf

Postby ESP_krzychb » Fri Aug 14, 2020 11:03 am

Hi VosperD,

You may be getting the message "The following Python requirements are not satisfied: ...", if there are issues installing required software by "./install.sh" script.

Please execute again the installation script:

Code: Select all

cd ~/esp/esp-idf
./install.sh
and post the log to see if there are any issues reported.

VosperD
Posts: 8
Joined: Tue Aug 11, 2020 7:19 pm

Re: problem setting up esp-idf

Postby VosperD » Fri Aug 14, 2020 12:37 pm

thanks for the reply

Is this what you mean?




vosper@vosper-HP-G61-Notebook-PC ~ $ cd ~/esp/esp-idf
vosper@vosper-HP-G61-Notebook-PC ~/esp/esp-idf $ ./install.sh
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32
Skipping xtensa-esp32-elf@esp-2020r2-8.2.0 (already installed)
Skipping xtensa-esp32s2-elf@esp-2020r2-8.2.0 (already installed)
Skipping esp32ulp-elf@2.28.51-esp-20191205 (already installed)
Skipping esp32s2ulp-elf@2.28.51-esp-20191205 (already installed)
Skipping openocd-esp32@v0.10.0-esp32-20200709 (already installed)
Installing Python environment and packages
Creating a new Python environment in /home/vosper/.espressif/python_env/idf4.3_py3.6_env
Installing virtualenv
Collecting virtualenv
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting six<2,>=1.9.0 (from virtualenv)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting importlib-metadata<2,>=0.12; python_version < "3.8" (from virtualenv)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting importlib-resources>=1.0; python_version < "3.7" (from virtualenv)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting distlib<1,>=0.3.1 (from virtualenv)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting appdirs<2,>=1.4.3 (from virtualenv)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting filelock<4,>=3.0.0 (from virtualenv)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting zipp>=0.5 (from importlib-metadata<2,>=0.12; python_version < "3.8"->virtualenv)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Installing collected packages: six, zipp, importlib-metadata, importlib-resources, distlib, appdirs, filelock, virtualenv
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 360, in run
prefix=options.prefix_path,
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/usr/lib/python3/dist-packages/pip/locations.py", line 153, in distutils_scheme
i.finalize_options()
File "/usr/lib/python3.6/distutils/command/install.py", line 351, in finalize_options
self.create_home_path()
File "/usr/lib/python3.6/distutils/command/install.py", line 581, in create_home_path
os.makedirs(path, 0o700)
File "/usr/lib/python3.6/os.py", line 210, in makedirs
makedirs(head, mode, exist_ok)
File "/usr/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/vosper/.local/lib/python3.6'
Traceback (most recent call last):
File "/home/vosper/esp/esp-idf/tools/idf_tools.py", line 1201, in action_install_python_env
import virtualenv # noqa: F401
ModuleNotFoundError: No module named 'virtualenv'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/vosper/esp/esp-idf/tools/idf_tools.py", line 1492, in <module>
main(sys.argv[1:])
File "/home/vosper/esp/esp-idf/tools/idf_tools.py", line 1488, in main
action_func(args)
File "/home/vosper/esp/esp-idf/tools/idf_tools.py", line 1205, in action_install_python_env
stdout=sys.stdout, stderr=sys.stderr)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'pip', 'install', '--user', 'virtualenv']' returned non-zero exit status 2.
vosper@vosper-HP-G61-Notebook-PC ~/esp/esp-idf $

VosperD
Posts: 8
Joined: Tue Aug 11, 2020 7:19 pm

Re: problem setting up esp-idf

Postby VosperD » Mon Aug 17, 2020 9:48 am

Hi.
My reply took a little while to appear.
In the meantime someone suggested using sudo ./install.sh from the esp-idf directory and it seems to have worked.
On to the next step.
Don

VosperD
Posts: 8
Joined: Tue Aug 11, 2020 7:19 pm

Re: problem setting up esp-idf

Postby VosperD » Thu Aug 20, 2020 6:37 pm

Hi
I've made some progress.
I can build the examples, blink and hello_world, and successfully flash the esp32devC board.
However, when I come to build the program I want, which is a stepper motor controller, I get the following error message after it has gone through idf.py build:-

undefined reference to `app_main'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
The only difference I can see between the examples and the code I have it that the examples are in C and my code is C++

Don

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: problem setting up esp-idf

Postby ESP_krzychb » Thu Aug 20, 2020 8:15 pm

Hi Don,

Check example ESP-IDF projects written in C++
https://github.com/espressif/esp-idf/tr ... or_mcp9808

VosperD
Posts: 8
Joined: Tue Aug 11, 2020 7:19 pm

Re: problem setting up esp-idf

Postby VosperD » Fri Aug 21, 2020 8:22 am

Hi ESP_krzychb
Thanks for the reply.
I had a look and I see the additional line in the CMakeList and Makefile files:-

set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/examples/cxx/experimental/experimental_cpp_component")

I added this to my files together with the sdkconfig file but it makes no difference.
Does this line need to be modified for my project?
Don

ESP-Marius
Posts: 74
Joined: Wed Oct 23, 2019 1:49 am

Re: problem setting up esp-idf

Postby ESP-Marius » Fri Aug 21, 2020 8:26 am

VosperD wrote:
Fri Aug 21, 2020 8:22 am
Hi ESP_krzychb
Thanks for the reply.
I had a look and I see the additional line in the CMakeList and Makefile files:-

set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/examples/cxx/experimental/experimental_cpp_component")

I added this to my files together with the sdkconfig file but it makes no difference.
Does this line need to be modified for my project?
Don
Did you remember to do this?

Code: Select all

extern "C" void app_main(void)

VosperD
Posts: 8
Joined: Tue Aug 11, 2020 7:19 pm

Re: problem setting up esp-idf

Postby VosperD » Fri Aug 21, 2020 9:33 am

I have this line in my main coilwinder.cpp file:-

extern "C" void app_main()
{

I changed it to: extern "C" void app_main(void)
{

Was that correct?

But I still get the same result.
Thanks for your help and advice.

Don

Who is online

Users browsing this forum: Google [Bot] and 69 guests