ESP-IDF can't find Arduino components

lg.lindstrom
Posts: 48
Joined: Fri Sep 17, 2021 4:02 pm

ESP-IDF can't find Arduino components

Postby lg.lindstrom » Fri Sep 17, 2021 4:29 pm

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)

chegewara
Posts: 2375
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP-IDF can't find Arduino components

Postby chegewara » Sun Sep 19, 2021 5:58 am

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

Who is online

Users browsing this forum: No registered users and 45 guests