I can’t get OTA to work to my esp8266. My code is long and I’ll show it if needed, but it is pretty much the sample OTA code after I get wifi set up and working. I’m setting up WiFi up as an AP, starting a webserver, dns, and mdns before connecting as a STA and then starting OTA.
When I try the OTA, pio says …
Looking for upload port...
Use manually specified: 192.168.1.235
Uploading .pioenvs/d1_mini/firmware.bin
15:28:48 [DEBUG]: Options: {'esp_ip': '192.168.1.235', 'host_port': 49136, 'image': '.pioenvs/d1_mini/firmware.bin', 'host_ip': '0.0.0.0', 'auth': '', 'esp_port': 8266, 'spiffs': False, 'debug': True, 'progress': True}
15:28:48 [INFO]: Starting on 0.0.0.0:49136
15:28:48 [INFO]: Upload size: 290144
15:28:48 [INFO]: Sending invitation to: 192.168.1.235
15:28:49 [INFO]: Waiting for device...
15:28:59 [ERROR]: No response from device
*** [upload] Error 1
Meanwhile my debug serial port output says this immediately upon trying the OTA …
OTA updating firmware
OTA Error[2]: Connect Failed
OTA Error[4]: End Failed
I get ArduinoOTA.onStart, then ArduinoOTA.getCommand works, and then I get the two ArduinoOTA.onError calls.
In summary, the esp seems to work fine and starts processing the update but pio doesn’t think there is any response from the esp.
I updated the ArduinoOTA from github because of the getCommand bug (which should really be fixed). Yesterday I refreshed pio by deleting ~/.platformio
.
Any ideas for what I should try next?
Edit: this is my env …
[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
build_flags = -Wl,-Tesp8266.flash.1m64.ld
upload_port = 192.168.1.235