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

WiFi' was not declared in this scope #143

Open
VikingFoxViking opened this issue Aug 4, 2024 · 1 comment
Open

WiFi' was not declared in this scope #143

VikingFoxViking opened this issue Aug 4, 2024 · 1 comment

Comments

@VikingFoxViking
Copy link

Hello dear team,

I have been trying for hours to flash my ESP32 via Arduino ID exactly according to the instructions.
Unfortunately, I always get an error message when checking in Arduino. Unfortunately I don't know what to do.

I hope someone can help me.
Thanks in advance.

c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp: In member function 'bool EspMQTTClient::handleWiFi()':
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:187:5: error: 'WiFi' was not declared in this scope
187 | WiFi.disconnect(true);
| ^~~~
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:194:27: error: 'WiFi' was not declared in this scope
194 | bool isWifiConnected = (WiFi.status() == WL_CONNECTED);
| ^~~~
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:194:44: error: 'WL_CONNECTED' was not declared in this scope; did you mean 'MQTT_CONNECTED'?
194 | bool isWifiConnected = (WiFi.status() == WL_CONNECTED);
| ^~~~~~~~~~~~
| MQTT_CONNECTED
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:215:27: error: 'WL_CONNECT_FAILED' was not declared in this scope; did you mean 'MQTT_CONNECT_FAILED'?
215 | if(WiFi.status() == WL_CONNECT_FAILED || millis() - _lastWifiConnectiomAttemptMillis >= _wifiReconnectionAttemptDelay)
| ^~~~~~~~~~~~~~~~~
| MQTT_CONNECT_FAILED
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp: In member function 'bool EspMQTTClient::handleMQTT()':
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:325:9: error: 'WiFi' was not declared in this scope
325 | WiFi.disconnect(true);
| ^~~~
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp: In member function 'void EspMQTTClient::onWiFiConnectionEstablished()':
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:362:75: error: 'WiFi' was not declared in this scope
362 | Serial.printf("WiFi: Connected (%fs), ip : %s \n", millis()/1000.0, WiFi.localIP().toString().c_str());
| ^~~~
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp: In member function 'void EspMQTTClient::onWiFiConnectionLost()':
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:388:5: error: 'WiFi' was not declared in this scope
388 | WiFi.disconnect(true);
| ^~~~
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp: In member function 'void EspMQTTClient::connectToWifi()':
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:555:3: error: 'WiFi' was not declared in this scope
555 | WiFi.mode(WIFI_STA);
| ^~~~
c:\Users\Patrick\Documents\Arduino\libraries\EspMQTTClient\src\EspMQTTClient.cpp:555:13: error: 'WIFI_STA' was not declared in this scope; did you mean 'WIFI_IF_STA'?
555 | WiFi.mode(WIFI_STA);
| ^~~~~~~~
| WIFI_IF_STA

exit status 1

Compilation error: exit status 1

@cswinter77
Copy link

Hi the issue is with the ESP32MQTT library. See here for the fix...

https://forum.arduino.cc/t/broken-dependencies/1266624

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