How to fix PlatformIO ESP8266 ArduinoOTA error: stopAll is not a member of WiFiUDP
Problem:
When compiling your PlatformIO firmware, you see an error message like
arduinoota_build_error.txt
/home/uli/.platformio/packages/framework-arduinoespressif8266/libraries/ArduinoOTA/ArduinoOTA.cpp: In member function 'void ArduinoOTAClass::_runUpdate()':
/home/uli/.platformio/packages/framework-arduinoespressif8266/libraries/ArduinoOTA/ArduinoOTA.cpp:268:12: error: 'stopAll' is not a member of 'WiFiUDP'
268 | WiFiUDP::stopAll();
| ^~~~~~~
Solution
Remove WiFi from the lib_deps
secton of your platform.ini
. Before the fix:
platformio.ini.before
lib_deps =
ESP Async [email protected]
[email protected]
WiFi
After the fix:
platformio.ini.after
lib_deps =
ESP Async [email protected]
[email protected]
Now check your source code and replace any
wifi_include_fix.cpp
#include <WiFi.h>
by
example.cpp
#include <ESP8266WiFi.h>
in order to prevent the WiFi.h: No Such File or Directory
issue as outlined in How to fix PlatformIO ESP8266 WiFi.h: No Such File or Directory
Now you need to completely remove the .pio
folder from your project directory in order to ensure a clean build:
clean_pio.sh
rm -rf .pio
After that, recompile your firmware.
Check out similar posts by category:
Arduino, 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