ESP32 Wroom v1 - OTA when in AP mode

I have a project where the ESP32 is going to be difficult to access once finished (its a hanging Starship Enterprise model)
So, OTA would be handy in case I need to adjust any code/settings.

Here is the code for the project... I have removed the main loop stuff and other bits that make reading it difficult.

I removed the same from my code to try and find the issue, but this seems to be an OTA problem.

It creates the AP fine. And I can select it in the IDE (v1.8.9). But it then fails and says 'No response from device
'
Ideas?

Well I am out of ideas. Nothing I have tried fixes it.
Time to move on. I spend far too much time on these things

I am not sure whether you have removed the code or forgot to post it, but this sentence is, at best, unclear. You obviously understand what is going on but because detail is lacking, we are left somewhat guessing.

I am assuming that the AP is working fine but you then say you can select "it" in the IDE. Is this the IP address of the ESP in the ports list in the IDE? You next say "But then it fails". What fails? Are we talking about the OTA update? Any other error messages during the upload?

How much program memory does your code take? You need at least that much free memory for the OTA upload to succeed. I.e. the amount of available free memory must be able to accommodate another compiled copy of the program.

What partition scheme are you using?

Once the OTA upload completes there will be a pause while the update is copied into place and the ESP reboots, but assuming there is enough memory, the upload should complete. If there us insufficient memory, it will fail, but console messages should perhaps indicate that.

I took my code back out of post 1 because with me deleting enough of it to post, it didn't make sense or compile after that.

I never resolved this.

I tried the demo from the library 'ESP2SOTA.h' library and that doesn't work either.

Plenty of memory left.

Both my original code and the demo in the library above create the AP fine and I can connect to it fine. Just doesn't complete the actual upload.

It connects (by selecting the ESP OTA as the port), but after compiling it fails to communicate with the ESP32 and throws up a failed comms error.

I tried everything I can think of... turned off Anti-virus etc.

Well after a day of trying every conceivable combination of settings, basic code, demo code, firewall adjustments and anything else I could Google....

I have given up

You didn't answer this.

Since the port is showing up then mDns appears to be working and therefore presumably the ESP is on the same subnet as the computer that the update is being sent from?

Can you ping the ESP?

Can you access http://hostname/update ?
where hostname is the host name assigned to the ESP.

I have tried every possible combination of partions..... same result.
Yes, I can ping the ESP32

It just never actually uploads. Says device failed to respond.

Checked the ESP32 is OTA compatible and it is.

OK. I never got this working and would really like to.

Gave up and went back to basics.... IDE 1.8.9

Load the example BasicOTA. That loads onto the ESP32 Devkit v1 fine.

Then tried sending the Blink example to the ESP32 and it just never connects. Finally it will time out with a no response.

Tried the laptop wireless switched to 2.4GHZ (because apparently ESP32's don't do 5GHZ)

Tried various ports apart from the default 3232.

Anti-virus is off

Just loaded IDE 2.3.2 but then found it doesn't support OTA. Great.

Went back to IDE 1.8.9 and now no Network ports are listed, so something broke.

I am just out of ideas...

Well, I think the entire thing is flawed.
Turn off the ESP32 and it still shows in the IDE as an available port.
Only way to correct that is to constantly keep shutting down the IDE and then rebooting.

Even then, the port doesn't always show up.

Hmm

Have you tried this, meticulously following every step?

ESP32 OTA (Over-the-Air) Updates – ElegantOTA Library with Arduino IDE | Random Nerd Tutorials

I spent 2 days on this. Never got it working.
Tried literally everything I could possibly think of.

Followed that (and a few other) tutorials...

Got ChatGPT onboard and ran through all possible options there as well. I never got it to connect.

The ESP was receiving and could be pinged, but just would not complete the connection.
Tried different laptop, updating libraries, rolling back libraries, no Win defender, no anti-virus, command prompt checks, AP mode, local network mode, different IDE versions, different ports .... I ran out of things to check

The fact that there seems to be a pile of people with the same issue and non of them ever resolved it says a lot

Life's too short.

That's odd. OTA works reliably for me (all in WIFI_STA mode) with:

  • Adafruit ESP8266 breakout
  • Adafruit ESP32 Feather
  • Unexpected Maker TinyPico ESP32
  • NodeMCU ESP8266

Maybe you should try a different device.

Yea, I am starting to suspect it's these ESP32 Devkit v1's

Library issue.
Problem fixed

If, as you say, there are a lot of people with the same issue, they may appreciate it if you explain what the library issue was and how you solved it.

Found out the ArduinoOTA OTAWebUpdater.ino example uses JQuery in the OTAForm.
When you are in AP mode you lack access to the internet. Then the example won't work.
When using a simple form from ESP8266 day's then it also works fine in AP mode.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.