When compiling I get error: 'esp_sleep_enable_ext1_wakeup' was not declared in this scope"
From everything I read, this is the correct location. Here's the code:
void setup(void)
{
Serial.begin(115200);
esp_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ANY_HIGH);
Code snippets, suck.
Did you try to include the sleep library? #include "esp_sleep.h"
?
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/sleep_modes.html
Thank you responding. Unfortunately, I had tried that but it makes no difference.
Post the most extended complete compiler-log
post the complete sketch
best regards Stefan
I've pared this down to just the basics and it still gives the same compilation error. I've tried it on two different development boards which use the ESP32_C3 processor. I've tried different GPIO pins. The esp_sleep_enable_ext1_wakeup function has the same error.
#include <esp_sleep.h>
void setup(){
esp_sleep_enable_ext0_wakeup(GPIO_NUM_13,1);
esp_deep_sleep_start();
}
void loop(){
}
error: 'esp_sleep_enable_ext0_wakeup' was not declared in this scope
Have you looked at using an earlier version of the APi documentation? The Arduino ESP32's Core does not use the latest API. Sometimes I have to go to the older documentation for proper syntax.
Post an image of your ESP32.
I believe I found the answer. The person who wrote the program for me used a development board that had a ESP32S not a ESP32C processor. If I compile it for a ESP32S it compiles fine but I obviously can't load it. That doesn't explain why it won't compile for a ESP32C. So I believe your correct in that it's a problem lies with the API. Sorry for the lousy pic. The chip is a ESP32-C3-WROOM-02. The other wake functions like the timer wake up compile fine. It's the external interrupt wake functions that are the problem. Any suggestions?
Thank you very much for your response. That solves my problem.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.