Undeclared variables error

reneprins
Posts: 3
Joined: Sat Jan 04, 2020 1:15 pm

Undeclared variables error

Postby reneprins » Tue Feb 11, 2020 8:47 am

Hi,

I'm running into an issue and I got stuck, this takes me a few days. I'm using the code from this github repo:
https://github.com/jonathanmuller/ESP32 ... ation-CSI-

The github repo contains a few folders for the esp32. I flashed the esp32 with the files in gather_csi_in_promiscuous succesfully.
Currently I want to flash the files in create_STA_and_AP/AP or STA, when I'm using the command make flash or make build I'm running in an issue:

Code: Select all

CC build/lwip/port/esp32/freertos/sys_arch.o
CC build/lwip/port/esp32/netif/ethernetif.o
CC build/lwip/port/esp32/netif/dhcp_state.o
CC build/lwip/port/esp32/netif/wlanif.o
CC build/lwip/port/esp32/debug/lwip_debug.o
AR build/lwip/liblwip.a
CC build/main/scan.o
C:/msys32/home/rfpri/esp/esp-idf/AP/main/scan.c: In function 'wifi_event_handler':
C:/msys32/home/rfpri/esp/esp-idf/AP/main/scan.c:36:21: error: 'WIFI_EVENT_AP_STACONNECTED' undeclared (first use in this function)
     if (event_id == WIFI_EVENT_AP_STACONNECTED)
                     ^
C:/msys32/home/rfpri/esp/esp-idf/AP/main/scan.c:36:21: note: each undeclared identifier is reported only once for each function it appears in
C:/msys32/home/rfpri/esp/esp-idf/AP/main/scan.c:39:9: error: unknown type name 'wifi_event_ap_staconnected_t'
         wifi_event_ap_staconnected_t* event = (wifi_event_ap_staconnected_t*) event_data;
         ^
C:/msys32/home/rfpri/esp/esp-idf/AP/main/scan.c:39:48: error: 'wifi_event_ap_staconnected_t' undeclared (first use in this function)
         wifi_event_ap_staconnected_t* event = (wifi_event_ap_staconnected_t*) event_data;
                                                ^
C:/msys32/home/rfpri/esp/esp-idf/AP/main/scan.c:39:77: error: expected expression before ')' token
         wifi_event_ap_staconnected_t* event = (wifi_event_ap_staconnected_t*) event_data;
                                                                             ^
In file included from C:/msys32/home/rfpri/esp/esp-idf/components/freertos/include/freertos/FreeRTOSConfig.h:120:0,
                 from C:/msys32/home/rfpri/esp/esp-idf/components/freertos/include/freertos/FreeRTOS.h:99,
                 from C:/msys32/home/rfpri/esp/esp-idf/AP/main/scan.c:11:
C:/msys32/home/rfpri/esp/esp-idf/AP/main/scan.c:40:69: error: request for member 'mac' in something not a structure or union
         ESP_LOGI(TAG, "station "MACSTR" join, AID=%d", MAC2STR(event->mac), event->aid);
                                                                     ^
C:/msys32/home/rfpri/esp/esp-idf/components/esp32/include/rom/ets_sys.h:623:21: note: in definition of macro 'MAC2STR'
 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
File: https://github.com/jonathanmuller/ESP32 ... ain/scan.c

It looks like the project can't find the esp32 modules, I tried to compare a few configuration settings from the projects that are working but it looks all equal. I'm stuck at this issue for the last days, hope someone can help me with this.

Machine: Windows 10
ESP32 version: 3.3.1

Thanks.

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Undeclared variables error

Postby ESP_igrr » Tue Feb 11, 2020 1:20 pm

Hi reneprins,

The repository you are referring to seems to be written for IDF v4.0 or later. This is the reason why you are getting the errors: the code uses the new event handling mechanism introduced in v4.0 and not present in the earlier versions.
You may try updating your IDF to v4.0, which was released today.

reneprins
Posts: 3
Joined: Sat Jan 04, 2020 1:15 pm

Re: Undeclared variables error

Postby reneprins » Thu Feb 13, 2020 7:16 pm

Many thanks for your answer ESP_igrr. Your solution worked for me!

Who is online

Users browsing this forum: No registered users and 113 guests