OTA not possible on Wemos D1 mini ESP32

I’m using a Wemos D1 mini ESP32 board for a new project. Over USB it is possible to upload the code but not via OTA.
Platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
upload_protocol = espota
upload_port = 10.0.0.208 ; IP-Address of the ESP32 device
upload_flags = --auth=xxx
lib_deps =
adafruit/Adafruit ADS1X15 @ ^2.4.2
SPI
knolleary/PubSubClient@^2.8

When building I get the error message, that this board do not support OTA-upload:

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino, upload_protocol = espota)
-------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION:
PLATFORM: Espressif 32 (6.5.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

  • framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
  • tool-esptoolpy @ 1.40501.0 (4.5.1)
  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
    Error: This board doesn’t support upload_protocol = espota framework!

In the documentation there is the upload_protocol espota available for this board!

Uploading

WEMOS D1 MINI ESP32 supports the following uploading protocols:

  • cmsis-dap
  • esp-bridge
  • esp-prog
  • espota
  • esptool
  • iot-bus-jtag
  • jlink
  • minimodule
  • olimex-arm-usb-ocd
  • olimex-arm-usb-ocd-h
  • olimex-arm-usb-tiny-h
  • olimex-jtag-tiny
  • tumpa

Default protocol is esptool

So, the question is why it is not working (for me) or what I have done wrong?

I don’t have a Wemos D1 mini ESP32, but I do have an esp32doit-devkit-v1. When I tested it with the configuration you provided (board = esp32dev), OTA worked for me without any problems.

I see that you are using the Espressif32 platform version 6.5.0, which was just released yesterday. I suspect the update didn’t work properly so the platform is now broken.

Try uninstalling the platform. Also delete the corresponding directories (Windows: C:\Users\<username>\.platformio\platforms and C:\Users\<username>\.platformio\platforms\packages)

Reinstall the platform.
Build the project and wait until all components of the platform are installed. Then try an upload via OTA again.

By the way, there is a suitable setting for the Wemos D1 mini ESP32:
board = wemos_d1_mini32

Thank you for your answer. I’ve uninstalled the platform but there was no directory “packages” to delete. After reinstall, build and switch over to OTA it was the same error. When I reinstalled the platform I’ve selected the lastest version 6.4.0 but when building it was 6.5.0 - very strange.
Originaly the board setting was wemos_d1_mini32 but I wanted to test it with the more generic device to see if the error also exists.

That’s strange…
What’s the content of C:\Users\<username>\.platformio\ ?

It should look like this:

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        29.12.2023     05:40                .cache
d-----        13.12.2023     06:12                lib
d-----        17.12.2023     14:37                packages
d-----        24.12.2023     08:41                penv
d-----        12.12.2023     16:11                platforms
d-----        24.12.2023     08:41                python3
-a----        27.12.2023     14:43           3848 appstate.json
-a----        28.12.2023     20:42           5284 homestate.json

and it should contain a platforms and packages folder.

OK, I’ve missunderstod your previous post and was looking for the “packages” directory in Windows: C:\Users\<username>\.platformio\platforms and C:\Users\<username>\.platformio\platforms
The .platformio directory looks like yours.

I’ve deleted the espressif directory in platforms and the framework-arduinoespressif32 directory in packages and reinstalled the platform but the error is still the same.

Have you tried setting up a brand new project and use the BasicOTA-Sketch?

My platformio.ini works fine with espota:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_protocol = espota
upload_port = 192.168.2.123

After making a new project with the the code of the original project it is working like a charm. I don’t know what was broken in the original project. Thank you for your suggestion!