[GH-ISSUE #236] Wifimanager and ArduinoOTA are not compatible #196

Closed
opened 2026-02-28 01:23:57 +03:00 by kerem · 6 comments
Owner

Originally created by @HamedRoshanfekr on GitHub (Oct 12, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/236

This is my code, it seems that arduinoOTA clears saved data from wifimanager and always starting in ap mode.

`#include <WiFiManager.h>

include <ESP8266WiFi.h>

include <DNSServer.h>

include <ESP8266WebServer.h>

include <ESP8266mDNS.h>

include <WiFiUdp.h>

include <ArduinoOTA.h>

void setup() {
Serial.begin(9600);
delay(10);

WiFiManager wifiManager;
wifiManager.autoConnect("Hamed");
Serial.print("\nConnect\n");

// Port defaults to 8266
// ArduinoOTA.setPort(8266);

// Hostname defaults to esp8266-[ChipID]
ArduinoOTA.setHostname("myesp8266");

// No authentication by default
// ArduinoOTA.setPassword((const char *)"123");

ArduinoOTA.onStart( {
Serial.println("Start");
});
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();
}`

Originally created by @HamedRoshanfekr on GitHub (Oct 12, 2016). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/236 This is my code, it seems that arduinoOTA clears saved data from wifimanager and always starting in ap mode. `#include <WiFiManager.h> # include <ESP8266WiFi.h> # include <DNSServer.h> # include <ESP8266WebServer.h> # include <ESP8266mDNS.h> # include <WiFiUdp.h> # include <ArduinoOTA.h> void setup() { Serial.begin(9600); delay(10); WiFiManager wifiManager; wifiManager.autoConnect("Hamed"); Serial.print("\nConnect\n"); // Port defaults to 8266 // ArduinoOTA.setPort(8266); // Hostname defaults to esp8266-[ChipID] ArduinoOTA.setHostname("myesp8266"); // No authentication by default // ArduinoOTA.setPassword((const char *)"123"); ArduinoOTA.onStart([]() { Serial.println("Start"); }); 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(); }`
kerem closed this issue 2026-02-28 01:23:58 +03:00
Author
Owner

@tzapu commented on GitHub (Oct 12, 2016):

hi,

here s one of my sketches, with both wifimanger and arduinoota, maybe you can use as inspiration.

has worked fine for me over and over again.

cheers

<!-- gh-comment-id:253247674 --> @tzapu commented on GitHub (Oct 12, 2016): hi, here s one of my sketches, with both wifimanger and arduinoota, maybe you can use as inspiration. has worked fine for me over and over again. cheers
Author
Owner

@malinengineer commented on GitHub (Oct 13, 2016):

@tzapu Hi! You forgot to provide a link..

<!-- gh-comment-id:253441762 --> @malinengineer commented on GitHub (Oct 13, 2016): @tzapu Hi! You forgot to provide a link..
Author
Owner

@tzapu commented on GitHub (Oct 13, 2016):

sorry about that
https://github.com/tzapu/SonoffBoilerplate/blob/master/SonoffBoilerplate.ino

good luck

<!-- gh-comment-id:253467717 --> @tzapu commented on GitHub (Oct 13, 2016): sorry about that https://github.com/tzapu/SonoffBoilerplate/blob/master/SonoffBoilerplate.ino good luck
Author
Owner

@drelephant commented on GitHub (Jul 5, 2017):

Came across this via a search.

This gist is the most basic example that I could find that uses WifiManager and ArduinoOTA. I tried it and it worked perfectly.
https://gist.github.com/e857be405e4c77bdfec7b950c34f1b3f

<!-- gh-comment-id:313054425 --> @drelephant commented on GitHub (Jul 5, 2017): Came across this via a search. This gist is the most basic example that I could find that uses WifiManager and ArduinoOTA. I tried it and it worked perfectly. https://gist.github.com/e857be405e4c77bdfec7b950c34f1b3f
Author
Owner

@KiLLeRRaT commented on GitHub (Jun 6, 2018):

The above works, but when specifying a password using ArduinoOTA.setPassword("MyPassword"); things stop working.

<!-- gh-comment-id:395198338 --> @KiLLeRRaT commented on GitHub (Jun 6, 2018): The above works, but when specifying a password using ArduinoOTA.setPassword("MyPassword"); things stop working.
Author
Owner

@tablatronix commented on GitHub (Jun 7, 2018):

Since this issue contains no information of use please open a new one

<!-- gh-comment-id:395267013 --> @tablatronix commented on GitHub (Jun 7, 2018): Since this issue contains no information of use please open a new one
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#196
No description provided.