I have a problem trying to upload cpp code to my Wemos D1 mini using OTA in VSC.
I have used OTA in Arduino IDE for some time & that works fine.
When trying the same thing in in VSC the program says
Uploading 1-100%
Done
Waiting for Result
Result OK
BUT after that the Wemos will not boot, so it seems as if something is wrong or incomplete with the upload…
The software is just cut and paste from Arduino IDE, where it works,
(and works fine in VSC when uploaded via COM Port)…
PLATFORMIO.INI:
[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
;upload_port = COM[5]
upload_port = 192.168.0.16
;monitor_speed = 115200
;monitor_port = COM5
upload_protocol = espota
;each upload flag in a new line
;upload_flags =
; --auth=xxxxxx
Here is part of the output
DATA: [=== ] 34.2% (used 28000 bytes from 81920 bytes)
PROGRAM: [=== ] 34.7% (used 361996 bytes from 1044464 bytes)
Creating BIN file ".pio\build\d1_mini\firmware.bin" using ".pio\build\d1_mini\firmware.elf"
Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = espota
Uploading .pio\build\d1_mini\firmware.bin
14:40:11 [DEBUG]: Options: {'esp_ip': '192.168.0.16', 'host_ip': '0.0.0.0', 'esp_port': 8266, 'host_port': 21106, 'auth': '', 'image': '.pio\\build\\d1_mini\\firmware.bin', 'spiffs': False, 'debug': True, 'progress': True}
14:40:11 [INFO]: Starting on 0.0.0.0:21106
14:40:11 [INFO]: Upload size: 366144
14:40:11 [INFO]: Sending invitation to: 192.168.0.16
14:40:11 [INFO]: Waiting for device...
Uploading: [ ] 0%
Uploading: [ ] 0%
Uploading: [ ] 0%
Uploading: [= ] 1%
(etc. etc. continues to 100%)...
Uploading: [============================================================] 99%
Uploading: [============================================================] 99%
Uploading: [============================================================] 100% Done...
14:40:23 [INFO]: Waiting for result...
14:40:23 [INFO]: Result: OK
When I change the platformio.ini to enable upload via cable (COM5) instead of via IP, it uploads ok, reboots and everything works fine, (but unfortunately not via IP-address/OTA)…
Any ideas ??