Skip to content
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

Vriable or field 'onStationDisconnected' declared void #1

Open
jovovich82 opened this issue Apr 4, 2024 · 12 comments
Open

Vriable or field 'onStationDisconnected' declared void #1

jovovich82 opened this issue Apr 4, 2024 · 12 comments

Comments

@jovovich82
Copy link

Hi i am trying your code on an esp8266, but keep getting this error. 'Variable or field 'onStationDisconnected' declared void'. Any ideas?

Also, I cannot find esp_wifi.h

any help would be great

Thanks

@sepp89117
Copy link
Owner

sepp89117 commented Apr 5, 2024

Hi, I'm sorry, but the code is written for ESP32. To use it on an ESP8266, it would have to be adjusted extensively... Why not use one of the many different ESP32 models? You can also create a fork of my repository and convert it to ESP8266.

Maybe you'll find what you need here:
https://github.com/sepp89117/GoPro-Multiple-Smart-Remote-ESP8266

But be warned, these programs only work for Hero8 and older models.

@jovovich82
Copy link
Author

jovovich82 commented Apr 5, 2024 via email

@jovovich82
Copy link
Author

Hello! trying esp32, but not recognising esp_wifi.h. Keeps throwing "esp_wifi.h: No such file or directory"

Any help would be great!

@jovovich82
Copy link
Author

Hello, it look like I had a duplicate of the esp_wifi.h file. However, the 'Variable or field 'onStationDisconnected' declared void is still appearing. Any ideas?

`Arduino: 1.8.16 (Windows 10), Board: "ESP32S2 Dev Module, Disabled, Disabled, Disabled, Disabled, UART0, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi), QIO, 80MHz, 4MB (32Mb), 921600, None, Disabled"

GoPro_TFT_RC:358:28: error: variable or field 'onStationDisconnected' declared void

void onStationDisconnected(WiFiEvent_t evt, WiFiEventInfo_t info) {

                        ^~~~~~~~~~~

GoPro_TFT_RC:358:28: error: 'WiFiEvent_t' was not declared in this scope

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:358:28: note: suggested alternative: 'ip_event_t'

void onStationDisconnected(WiFiEvent_t evt, WiFiEventInfo_t info) {

                        ^~~~~~~~~~~

                        ip_event_t

GoPro_TFT_RC:358:45: error: 'WiFiEventInfo_t' was not declared in this scope

void onStationDisconnected(WiFiEvent_t evt, WiFiEventInfo_t info) {

                                         ^~~~~~~~~~~~~~~

GoPro_TFT_RC:375:17: error: variable or field 'onIpAssign' declared void

void onIpAssign(WiFiEvent_t evt, WiFiEventInfo_t info) {

             ^~~~~~~~~~~

GoPro_TFT_RC:375:17: error: 'WiFiEvent_t' was not declared in this scope

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:375:17: note: suggested alternative: 'ip_event_t'

void onIpAssign(WiFiEvent_t evt, WiFiEventInfo_t info) {

             ^~~~~~~~~~~

             ip_event_t

GoPro_TFT_RC:375:34: error: 'WiFiEventInfo_t' was not declared in this scope

void onIpAssign(WiFiEvent_t evt, WiFiEventInfo_t info) {

                              ^~~~~~~~~~~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino: In function 'void setup()':

GoPro_TFT_RC:80:8: error: 'class WiFiClass' has no member named 'mode'

WiFi.mode(WIFI_AP); // Set WiFi in AP mode

    ^~~~

GoPro_TFT_RC:80:13: error: 'WIFI_AP' was not declared in this scope

WiFi.mode(WIFI_AP); // Set WiFi in AP mode

         ^~~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:80:13: note: suggested alternative: 'WIFI_IF_AP'

WiFi.mode(WIFI_AP); // Set WiFi in AP mode

         ^~~~~~~

         WIFI_IF_AP

GoPro_TFT_RC:82:45: error: cannot convert 'esp_interface_t' to 'wifi_interface_t'

esp_wifi_set_mac(ESP_IF_WIFI_AP, &rcMac[0]);

                                         ^

In file included from C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:2:

C:\Users\Rodrigo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h:679:45: note: initializing argument 1 of 'esp_err_t esp_wifi_set_mac(wifi_interface_t, const uint8_t*)'

esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]);

                        ~~~~~~~~~~~~~~~~~^~~

GoPro_TFT_RC:84:8: error: 'class WiFiClass' has no member named 'onEvent'

WiFi.onEvent(onIpAssign, WiFiEvent_t::SYSTEM_EVENT_AP_STAIPASSIGNED);

    ^~~~~~~

GoPro_TFT_RC:84:16: error: 'onIpAssign' was not declared in this scope

WiFi.onEvent(onIpAssign, WiFiEvent_t::SYSTEM_EVENT_AP_STAIPASSIGNED);

            ^~~~~~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:84:16: note: suggested alternative: 'copysign'

WiFi.onEvent(onIpAssign, WiFiEvent_t::SYSTEM_EVENT_AP_STAIPASSIGNED);

            ^~~~~~~~~~

            copysign

GoPro_TFT_RC:84:28: error: 'WiFiEvent_t' has not been declared

WiFi.onEvent(onIpAssign, WiFiEvent_t::SYSTEM_EVENT_AP_STAIPASSIGNED);

                        ^~~~~~~~~~~

GoPro_TFT_RC:85:8: error: 'class WiFiClass' has no member named 'onEvent'

WiFi.onEvent(onStationDisconnected, WiFiEvent_t::SYSTEM_EVENT_AP_STADISCONNECTED);

    ^~~~~~~

GoPro_TFT_RC:85:16: error: 'onStationDisconnected' was not declared in this scope

WiFi.onEvent(onStationDisconnected, WiFiEvent_t::SYSTEM_EVENT_AP_STADISCONNECTED);

            ^~~~~~~~~~~~~~~~~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:85:16: note: suggested alternative: 'esp_netif_action_disconnected'

WiFi.onEvent(onStationDisconnected, WiFiEvent_t::SYSTEM_EVENT_AP_STADISCONNECTED);

            ^~~~~~~~~~~~~~~~~~~~~

            esp_netif_action_disconnected

GoPro_TFT_RC:85:39: error: 'WiFiEvent_t' has not been declared

WiFi.onEvent(onStationDisconnected, WiFiEvent_t::SYSTEM_EVENT_AP_STADISCONNECTED);

                                   ^~~~~~~~~~~

GoPro_TFT_RC:87:23: error: no matching function for call to 'WiFiClass::disconnect(bool)'

WiFi.disconnect(true);

                   ^

In file included from C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:130:9: note: candidate: 'int WiFiClass::disconnect()'

 int disconnect(void);

     ^~~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:130:9: note: candidate expects 0 arguments, 1 provided

GoPro_TFT_RC:88:8: error: 'class WiFiClass' has no member named 'softAPdisconnect'; did you mean 'disconnect'?

WiFi.softAPdisconnect(true);

    ^~~~~~~~~~~~~~~~

    disconnect

GoPro_TFT_RC:94:7: error: 'class TFT_eSPI' has no member named 'setTouch'

tft.setTouch(calData); //comment for touch calibration

   ^~~~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino: In function 'void checkTouch()':

GoPro_TFT_RC:135:7: error: 'class TFT_eSPI' has no member named 'getTouch'; did you mean 'getColor'?

tft.getTouch(&x, &y);

   ^~~~~~~~

   getColor

GoPro_TFT_RC:137:22: error: 'class TFT_eSPI' has no member named 'getTouchRawZ'

if (y > 208 && tft.getTouchRawZ() >= 800) { //is in buttons hight

                  ^~~~~~~~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino: In function 'void calibrateTouch()':

GoPro_TFT_RC:198:7: error: 'class TFT_eSPI' has no member named 'calibrateTouch'

tft.calibrateTouch(calData, TFT_MAGENTA, TFT_BLACK, 15);

   ^~~~~~~~~~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino: In function 'void startAP()':

GoPro_TFT_RC:320:8: error: 'class WiFiClass' has no member named 'mode'

WiFi.mode(WIFI_AP); // Set WiFi in AP mode

    ^~~~

GoPro_TFT_RC:320:13: error: 'WIFI_AP' was not declared in this scope

WiFi.mode(WIFI_AP); // Set WiFi in AP mode

         ^~~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:320:13: note: suggested alternative: 'WIFI_IF_AP'

WiFi.mode(WIFI_AP); // Set WiFi in AP mode

         ^~~~~~~

         WIFI_IF_AP

GoPro_TFT_RC:327:8: error: 'class WiFiClass' has no member named 'softAPConfig'

WiFi.softAPConfig(rcIp, gateway, subnet);

    ^~~~~~~~~~~~

GoPro_TFT_RC:330:8: error: 'class WiFiClass' has no member named 'softAP'

WiFi.softAP(ssid, NULL, wifiChannel, 0, maxCams ); //.softAP(const char* ssid, const char* password, int channel, int ssid_hidden, int max_connection)

    ^~~~~~

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino: In function 'void stopAP()':

GoPro_TFT_RC:342:8: error: 'class WiFiClass' has no member named 'softAPdisconnect'; did you mean 'disconnect'?

WiFi.softAPdisconnect(true);

    ^~~~~~~~~~~~~~~~

    disconnect

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino: At global scope:

GoPro_TFT_RC:358:28: error: variable or field 'onStationDisconnected' declared void

void onStationDisconnected(WiFiEvent_t evt, WiFiEventInfo_t info) {

                        ^~~~~~~~~~~

GoPro_TFT_RC:358:28: error: 'WiFiEvent_t' was not declared in this scope

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:358:28: note: suggested alternative: 'ip_event_t'

void onStationDisconnected(WiFiEvent_t evt, WiFiEventInfo_t info) {

                        ^~~~~~~~~~~

                        ip_event_t

GoPro_TFT_RC:358:45: error: 'WiFiEventInfo_t' was not declared in this scope

void onStationDisconnected(WiFiEvent_t evt, WiFiEventInfo_t info) {

                                         ^~~~~~~~~~~~~~~

GoPro_TFT_RC:375:17: error: variable or field 'onIpAssign' declared void

void onIpAssign(WiFiEvent_t evt, WiFiEventInfo_t info) {

             ^~~~~~~~~~~

GoPro_TFT_RC:375:17: error: 'WiFiEvent_t' was not declared in this scope

C:\Users\Rodrigo\Downloads\GoPro_ESP32_TFT_Touch-Control-main\GoPro_ESP32_TFT_Touch-Control-main\GoPro_TFT_RC\GoPro_TFT_RC.ino:375:17: note: suggested alternative: 'ip_event_t'

void onIpAssign(WiFiEvent_t evt, WiFiEventInfo_t info) {

             ^~~~~~~~~~~

             ip_event_t

GoPro_TFT_RC:375:34: error: 'WiFiEventInfo_t' was not declared in this scope

void onIpAssign(WiFiEvent_t evt, WiFiEventInfo_t info) {

                              ^~~~~~~~~~~~~~~

exit status 1

variable or field 'onStationDisconnected' declared void

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
`

@sepp89117
Copy link
Owner

Hi @jovovich82,
I have updated the outdated code.
Please try again. Also take a look at the README for installation instructions

@jovovich82
Copy link
Author

Fantastic! Thanks a lot.

@sepp89117
Copy link
Owner

You're welcome. Does it work for you?

@jovovich82
Copy link
Author

jovovich82 commented Apr 12, 2024 via email

@jovovich82
Copy link
Author

Hi I am not being successful. I have followed your instructions carefully, but I am afraud I might be missing something.

It still errors when compiling at 'onStationDisconnected' declared void

Any thoughts?

@sepp89117
Copy link
Owner

sepp89117 commented Apr 22, 2024

I'm sorry, I can't reproduce the issue. Are you sure you have the latest version of ESP32 installed?

@jovovich82
Copy link
Author

Is there an easy way of checking esp32 version? I'm not too sure my compiling is working

@sepp89117
Copy link
Owner

Check https://randomnerdtutorials.com/installing-esp32-arduino-ide-2-0/
Chapter "Install ESP32 Add-on in Arduino IDE"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants