WIFI to WPA2:

kkbbesp
Posts: 3
Joined: Tue Apr 30, 2019 7:19 pm

WIFI to WPA2:

Postby kkbbesp » Tue Apr 30, 2019 7:32 pm

Hello All,

I am just getting started with ESP32, and wish to join a WPA2 AP.

I tried out this example:
https://github.com/espressif/esp-idf/bl ... ise_main.c

and keep getting this error:

Code: Select all

 src/test.c: In function 'event_handler':
src/test.c:83:23: error: 'WIFI_EVENT' undeclared (first use in this function)
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
^
src/test.c:83:23: note: each undeclared identifier is reported only once for each function it appears in
src/test.c:83:49: error: 'WIFI_EVENT_STA_START' undeclared (first use in this function)
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
^
src/test.c:85:56: error: 'WIFI_EVENT_STA_DISCONNECTED' undeclared (first use in this function)
} else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
^
src/test.c:88:30: error: 'IP_EVENT' undeclared (first use in this function)
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
^
src/test.c:88:54: error: 'IP_EVENT_STA_GOT_IP' undeclared (first use in this function)
} else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {


I did include esp_wifi_types.h.
  • Platform : Linux
    IDE : PlatformIO
    Device: ESP32 Pico Kit V4.1
    IDF Version: 1.8.0


i did a system wide search for WIFI_EVENT_STA_DISCONNECTED and could not find anything that matches:
"#define WIFI_EVENT_STA_DISCONNECTED ..." (

Code: Select all

grep -Inr "#define.*WIFI_EVENT_STA_DISCONNECTED" ./*
)

How do I fix this? Thanks in advance.

Krish.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: WIFI to WPA2:

Postby WiFive » Wed May 01, 2019 10:59 am

You have to use a version that matches platformio

https://github.com/espressif/esp-idf/tr ... enterprise

kkbbesp
Posts: 3
Joined: Tue Apr 30, 2019 7:19 pm

Re: WIFI to WPA2:

Postby kkbbesp » Wed May 01, 2019 3:01 pm

Thank you.

I seems like my platformio framework-espidf version is 3.30200.190418 (3.2.0).
a.jpg
a.jpg (14.4 KiB) Viewed 3804 times
And when i look even at the v2.0 branch of the example on github, the referenced variables are the same ( SYSTEM_EVENT_STA_START , SYSTEM_EVENT_STA_GOT_IP , SYSTEM_EVENT_STA_DISCONNECTED etc).

After further digging I see the framework I download from github has a slightly different components/esp32/include/esp_wifi_types.h file from that installed in platformio's 3.3 version (.platformio/packages/framework-espidf/components/esp32/include/esp_wifi_types.h)

Maybe this is a question for platformio, but if anyone know of a way to fix this please let me know.

Who is online

Users browsing this forum: No registered users and 139 guests