-
Notifications
You must be signed in to change notification settings - Fork 13.3k
NodeMCU 1.0 (ESP-12E Module) OTA problem #4337
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
Your "onStart" and "onEnd" are missing the []() part all the others have, like:
That might cause a problem (they're present in current example). Also, you did not specify which core version you are using; 2.3.0 is very old, and 2.4.0 is fairly new, and has a lot of bug fixes available in the git version: https://github.com/esp8266/Arduino#using-git-version |
I also posted this on #959 Sorry if I doing this wrong.. I'm on core 2.5.0 with ArduinoIDE 1.8.8 (macOS) I can though upload OTA using the command line espota.py program. That works all the time. What am I missing???
|
Hi,
line, but it does show a pop-up window asking for the password (which I have NOT set!)!!! After uploading a Sketch that does not have this problem I can one time and only one time OTA upload the sketch that does have this problem with the Arduino IDE..
After this successful OTA upload I can not OTA upload with the Arduino IDE again. I can however OTA upload the sketch by entering the espota.py command in a terminal window. That works like a charm all the time. This is very annoying! |
I asked some other people to upload my Sketch to a ESP8266 wired and after that to do it again OTA. All with the same result: a popup asking for a password. You can find this sketch here: “https://github.com/mrWheel/DSMRloggerWS“ I’m now beginning to suspect it has to do with the size of the binary. Could it be that in the step before calling espota.py something goes wrong? The fact that OTA does work if I just enter the espota.py command in a terminal window puzzles me. Can anyone (@igrr) elaborate? Please? |
This is the verbose output of the ArduinoIDE
|
Basic Infos
Hardware
Hardware: NodeMCU 1.0 (ESP-12E Module)
Core Version: ??
Description
Hi!
Can't establish OTA update using BasicOTA example code. Upload sketch using USB connection, pushing RST button on module, unplug module from laptop, connect it to other power source.
After power-on ESP get IP and Arduino IDE seen it on IP ports, but when i try to upload this sketch again, but now in OTA-mode, i get Error[4]. All FireWalls are disabled, ping on IP in cmd get no issues.
Thanks in advance for any help with this one!
Settings in IDE
Module: NodeMCU 1.0 (ESP-12E Module)
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode:
Flash Frequency:
Upload Using: OTA
Reset Method:
Sketch
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
const char* ssid = "XXXX";
const char* password = "XXXX";
void setup() {
Serial.begin(115200);
Serial.println("Booting");
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println("Connection Failed! Rebooting...");
delay(5000);
ESP.restart();
}
// Port defaults to 8266
// ArduinoOTA.setPort(8266);
// Hostname defaults to esp8266-[ChipID]
// ArduinoOTA.setHostname("myesp8266");
// No authentication by default
// ArduinoOTA.setPassword("admin");
// Password can be set with it's md5 value as well
// MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
// ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");
ArduinoOTA.onStart( {
String type;
if (ArduinoOTA.getCommand() == U_FLASH)
type = "sketch";
else // U_SPIFFS
type = "filesystem";
});
ArduinoOTA.onEnd( {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
else if (error == OTA_END_ERROR) Serial.println("End Failed");
});
ArduinoOTA.begin();
Serial.println("Ready");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
ArduinoOTA.handle();
}
Debug Messages
Ready
IP address: 192.168.0.101
Start updating sketch
Progress: 0%
Error[4]: End Failed
The text was updated successfully, but these errors were encountered: