'esp_wifi_get_inactive_time' was not declared in this scope

digsub
Posts: 14
Joined: Sat Apr 22, 2017 9:17 am

'esp_wifi_get_inactive_time' was not declared in this scope

Postby digsub » Mon Dec 28, 2020 10:36 am

ESP-IDF function esp_wifi_get_inactive_time() is found in esp_wifi.h, but code below won't compile in Arduino IDE 1.8.13 due to 'esp_wifi_get_inactive_time' was not declared in this scope

other functions in esp_wifi.h e.g. esp_wifi_set_bandwidth() are fine.

Checked spelling, conflicts, etc & I can't find the cause. Thanks!


Code: Select all

#include <WiFi.h>
#include "esp_wifi.h"

void setup() {
  ESP_ERROR_CHECK(esp_wifi_set_bandwidth(ESP_IF_WIFI_STA, WIFI_BW_HT20));
  ESP_ERROR_CHECK(esp_wifi_set_bandwidth(ESP_IF_WIFI_AP, WIFI_BW_HT20));

  uint16_t sec;

  ESP_ERROR_CHECK(esp_wifi_get_inactive_time(ESP_IF_WIFI_AP, &sec));  
}

void loop() {}

ESP_Jan
Posts: 42
Joined: Tue Dec 01, 2020 10:56 am

Re: 'esp_wifi_get_inactive_time' was not declared in this scope

Postby ESP_Jan » Wed Dec 30, 2020 2:08 am

Hi digsub,

you are experiencing this issue because the arduino-esp32 is not the same as ESP-IDF.

The header file esp_wifi.h from arduino-esp32 can be found here:
https://github.com/espressif/arduino-es ... esp_wifi.h

To use the function esp_wifi_get_inactive_time you may want to consider to moving your development to the ESP-IDF.

Feel free to post any follow-up questions.

Jan

Who is online

Users browsing this forum: noweare and 120 guests