Page 1 of 1

ESP-IDF can't find Arduino components

Posted: Fri Sep 17, 2021 4:29 pm
by lg.lindstrom
Hi
I have installed ESP-IDF addon on VsCode.

Then I select ESP-IDF create new project.
VsCode show a form asking for project name, location etc.

After filling the form I click on "chose template"
I select Extensions and select "arduino-as-component"

When the project is created I follow this instruction: https://docs.espressif.com/projects/ard ... onent.html

As I have said in another thread,, idf.py menuconfig don't work form me.

After setup is finished I compile my newly created project.

It compiles with a minor error that is easy to fix.

I slightly modifies the code so it looks like this.

Code: Select all

#include "Arduino.h"
#include "WiFi.h"

static WiFi wifi  ; 

extern "C" void app_main()
{
    initArduino();
    pinMode(4, OUTPUT);
    digitalWrite(4, HIGH);
    // Do your own thing
} 
Then I compile again and get the following error


Code: Select all

FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj 
...
...
...
 ../main/main.cpp
../main/main.cpp:4:8: error: 'WiFi' does not name a type
 static WiFi wifi  ;



So,, which "step" am I missing ??? (As far I know, WiFi should be a valid component)

Re: ESP-IDF can't find Arduino components

Posted: Sun Sep 19, 2021 5:58 am
by chegewara
lg.lindstrom wrote:
Fri Sep 17, 2021 4:29 pm
As I have said in another thread,, idf.py menuconfig don't work form me.

So,, which "step" am I missing ??? (As far I know, WiFi should be a valid component)
Who told you idf.py menuconfig wont work? Maybe it is misunderstanding and it was about plain arduino project?
The idf.py menuconfig has some Arduino options.
On Autostart Arduino setup and loop on boot.
If you enable these options, your main.cpp should be formated like any other sketch.
https://docs.espressif.com/projects/ard ... stallation

I am not using VS code extension, i prefer full manual configuration, but instruction seems to be easy and complete to start with arduino as component.

EDIT from your other topic i can see that you can run menuconfig in arduino as component project