-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Unable to bring up ArduinoOTA on an esp8266 which is also an AP #1482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
what version of the core are you using? The sketch looks fine and should by all means work |
I pull from master before I do any work, so whatever the latest is right now. If you can suggest some ways to do additional troubleshooting, please do. I have been poking at it for a week or so now, but my c/cpp skills are not very good. |
wait... are you starting AP with the same name? |
i got the Serial to 115200 and it all started working. 9600 is waaay too slow :) |
ill bring up an ap with the same name on my phone so the esp can connect (to test), but take down the phone's ap so the esp can use the same ssid. This is purely for testing as simply as possible. Ill try faster serial tonight and see if that does it. |
OK, just tried it with faster serial and it is still failing. Anything else I can try or anyway to get more details for debugging? |
since you know how to use git, can you try my fork of this repo? I just changed how serial works so it should be OK even on lower speeds. But other than that I have no other clues. I use OTA daily and is working fine (I do not debug it though, progress is visible in terminal) |
I pulled your fork and recompiled with that code with no success. I also removed all Serial logging from my code and that didn't work either. Ill try to add some better debug messages to the OTA class and see if that yields any insight. |
I'll go ahead and close this issue until I can produce some better repro steps or evidence that it is an actual issue and not a problem on my end. |
As it turned out, mDNS does not work, when the ESP8266 is configured as access point. Because of this, the device can not be detected by the computer. The rest should work though. |
I am able to upload OTA in AP mode. My code is similar to yours. To get this to work I need to re-connect to my ESP8266 AP before each upload as my computer re-connects to my wireless home network when the the ESP8266 reboots after the upload. Then I also need to re-select the ESP8266 network port each time in the Arduino IDE; Arduino->Tools->Port->Network Ports->"myESP8266 at XXX.XXX.XXX.XXX". A bit inconvenient but it works every time for me. UPDATED: I am working with more NodeMCU's and I find that I can't upload OTA to an access point (the wireless network port does not appear) unless the NodeMCU has been set to OTA station mode prior to switching access point mode. Once I successfully perform an OTA station mode update the wireless network port for the access point appears when I switch back to access point mode. Clearly a bug. Not sure how to report this. I also find that the Arduino IDE does not update the network port's IP address with any predictability when I change back and forth from STA mode to AP mode. The network node shows up but more often than not it has the wrong name or IP. Further more, it seems that the ESP8266 actively retains both the station mode and access mode setups as I switch back and forth between modes. I have to power down the ESP8266 in order to keep the previous WiFi mode from staying active. More testing required to confirm this... |
This might fix it: PR 5894 |
I am attempting to have an esp8266 function as a wireless AP and also be updatable via OTA, but this does not seem to work. If the esp connects to an existing AP, OTA works as expected, but if the esp brings up its own AP, OTA fails with:
In the sample sketch below there is a function
beginAP
which brings up an access point, and a functionconnectToAP
which connects to an existing access point. The sketch below works as expected, but ifconnectToAP
is commented out andbeginAP
is uncommented, the issue appears.If this is merely a configuration issue on my side, it may be beneficial for it to be documented.
Thanks for the work! This sdk is killer :D
The text was updated successfully, but these errors were encountered: