ESP8266 PlatformIO-Fehler beheben: WIFI_STA was not declared in this scope
English
Deutsch
Problem:
Beim Kompilieren Ihrer PlatformIO-Firmware sehen Sie eine Fehlermeldung wie
example-4.txt
src/main.cpp:49:10: error: 'class WiFiClass' has no member named 'mode'
49 | WiFi.mode(WIFI_STA);
| ^~~~
src/main.cpp:49:15: error: 'WIFI_STA' was not declared in this scope
49 | WiFi.mode(WIFI_STA);
| ^~~~~~~~Lösung
Sie haben WiFi.h anstelle des korrekten ESP8266WiFi.h eingebunden. Dies wird mehrere Probleme wie Neustarts bei WiFi.begin() verursachen, selbst wenn es korrekt kompiliert.
Ersetzen Sie
example-3.cpp
durch
example-2.cpp
überall in Ihrem Quellcode und unterstützt nicht
example-1.txt
Für weitere Details siehe unseren vorherigen Beitrag über PlatformIO ESP8266 WiFi.h: No Such File or Directory beheben
Check out similar posts by category:
Electronics, ESP8266/ESP32, PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow