-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arduino libraries not found #116
Comments
Hi @bernch1nv, Is there any other library that you are using with Arduino ? |
Hi @sanketwadekar , |
@SuGlider maybe you can provide some help. |
The libraries shall not go under /esp-idf/components. You should clone Matter in the /yourProject/components
|
I was reading the code from https://github.com/espressif/esp-matter/blob/main/examples/light/main/app_main.cpp and it does have already an Is that code that you want to use and add to it some Arduino API calls? |
My goal is to have the device operating (based on a hw-switch) in either Wifi AP-mode for configuration purposes, or in matter-"mode". As I have the AP-mode part already written using libraries like ESPAsyncWebserver, AsyncTCP etc. which are based on arduino-esp32 I somehow need the Arduino.h file in there |
How is the project structured in the folders? |
Matter has its own commissioning methods. @bernch1nv - What is AP-mode used for in your project? |
When I opened this issue, as described I installed arduino globally under {$home}/esp-idf/components (with the intention to being able to use it by multiple projects) Right now I just removed my existing esp-matter installation, and moved my project to {$home}/esp-projects/my_project There I now cloned the esp-matter repo into my_project/components/esp-matter, as suggested by @SuGlider I did not adapt the CMakeLists.txt file though, because i think the current set EXTRA_COMPONENTS_DIRS looks fine for me, as it uses the ESP_MATTER_PATH variable. With this setup, I now get the Error "Failed to resolve component 'app_reset'", because esp-matter does not contain a CMakeLists.txt file @RoCorbera AP-mode is hosting a webapp for configuration purposes, for variables that cannot be known in production yet. |
In the other Matter examples, the You may need to add this folder to your project and fix your project's |
@bernch1nv - I've built the In order to get it done, I followed these steps:
To fix this error there are a couple possibilitites:
//#include <lwip/inet.h>
#define INET6_ADDRSTRLEN 46
#define INET_ADDRSTRLEN 16 Finally, just run
|
It seems that the folders are not setup as I instructed. You should have something like this:
|
@bernch1nv - Please let me know if this issue is solved. Thanks, |
So the first time I tried this I didn't remove arduino under esp-idf/components, you're right. However now I just tried to establish a wifi in AP mode, to see if this is really working:
But I get this error:
|
OK, now it is another issue. This issue is related to the linker that can't find the function in the object files. For this specific issue with I added this line to my You shall have in mind that mixing Matter Code and Framework with Arduino Code and Framework won't be easy. |
Arduino has its own You can check the Arduino initialization in Plus all other system bring-up functions.... |
@bernch1nv - I made it work and start SoftAP with this code: extern "C" void app_main()
{
esp_err_t ard_err = nvs_flash_init();
if(ard_err == ESP_ERR_NVS_NO_FREE_PAGES || ard_err == ESP_ERR_NVS_NEW_VERSION_FOUND){
const esp_partition_t* partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, NULL);
if (partition != NULL) {
ard_err = esp_partition_erase_range(partition, 0, partition->size);
if(!ard_err){
ard_err = nvs_flash_init();
} else {
printf("ARDUINO :: Failed to format the broken NVS partition!");
}
} else {
printf("ARDUINO :: Could not find NVS partition");
}
}
if(ard_err) {
printf("ARDUINO :: Failed to initialize NVS! Error: %u", ard_err);
}
Serial.begin(115200);
Serial.println();
const char* ssid = "examplewifissid";
const char* password = "tenonezero";
Serial.print("Setting soft-AP ... ");
WiFi.mode(WIFI_AP); //Configure Access Point mode
Serial.println(WiFi.softAP(ssid, password) ? "Ready" : "Failed!"); //Password length minimum 8 char
Serial.print("Soft-AP IP address = ");
Serial.println(WiFi.softAPIP());
Serial.println("======================================");
} OUTPUT:
|
@SuGlider now this works, guess I can close this issue now. |
I'm trying to use Arduino based libraries within the light example.
I followed the install guide here: https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html , but installed the library globally under /esp-idf/components, and it seems to work as I can compile the sample_project in esp-idf/examples/get-started folder.
My project is located in esp-matter/examples, and when I try to include Arduino.h it says "fatal error: Arduino.h: No such file or directory"
I also set "CONFIG_FREERTOS_HZ" in sdkconfig to 1000 (as required by arduino-esp32)
I can find the Arduino Component now under menuconfig (and also tried ticking the box within compatibility options to "Include headers across components as before IDF v4.0" -> made no difference)
Still getting the error that Arduino.h can't be found.
Using ESP-IDF: v4.4.2
Any ideas how Arduino can be correctly added to an esp-matter project?
The text was updated successfully, but these errors were encountered: