Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Password request using wemos D1 R2 / ESP8266

Open danielperez505 opened this issue 10 years ago • 26 comments

----------------------------- Remove above -----------------------------

Basic Infos

wireless communication with wemos D1 R2 using ESP8266, its working perfectly when I connected with the usb cable

Hardware

Hardware: Wemos D1R2 Core Version: ESP8266

Description

Im getting a password request to access a wemos D1 R2 type board password to upload a new sketch¨ but I havent set any pass. I would aprreciated any help!!

Settings in IDE

Sketch

#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>

const char* ssid = "Mohican";
const char* password = "2a3bf31c";

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("WemoS");

  // 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());

   pinMode(D5, OUTPUT);  // initialize onboard LED as output
}

void loop() {
   ArduinoOTA.handle();
  digitalWrite(D5, HIGH);   
  delay(500);                 
  digitalWrite(D5, LOW);
  delay(500);
}

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

danielperez505 avatar May 06 '16 06:05 danielperez505

Which IDE version are you using?

igrr avatar May 06 '16 06:05 igrr

1.6.8

danielperez505 avatar May 06 '16 21:05 danielperez505

I tried your sketch, modified WiFi connection code to suit my network setup, and OTA uploads went fine, didn't get any password request. I'm on OS X. Which OS are you using, and which version of ESP8266 core (2.1.0, 2.2.0, 2.3.0-rc1)?

igrr avatar May 16 '16 03:05 igrr

Im using wemos d1r2 mini. http://www.wemos.cc/Products/d1_mini.html

danielperez505 avatar May 19 '16 10:05 danielperez505

That's awesome, but I've asked about OS and ESP8266 Arduino core version.

OS is either Windows (XP, Vista, 7, 10, ...), Linux (which distro?), Mac OS (which version)?

To check ESP8266 Arduino core version — open Arduino IDE, go to Tools menu > Board > Boards Manager, scroll down to "ESP8266", see something like "version 2.2.0 installed". The number between "version" and "installed" is the version number i need :)

igrr avatar May 19 '16 10:05 igrr

Sorry, Im running win 10 ESP 8266 v2.1.0 arduino 1.6.8

danielperez505 avatar May 19 '16 10:05 danielperez505

2.1.0 might have had some OTA issues indeed. Please try 2.2.0.

igrr avatar May 19 '16 10:05 igrr

Thanks man, how can Update it can you pls help me?

danielperez505 avatar May 19 '16 10:05 danielperez505

Same menu (boards manager), select new version from drop down box, click install.

igrr avatar May 19 '16 10:05 igrr

I did as you said but the problem still there =( any other suggestion?

danielperez505 avatar May 19 '16 10:05 danielperez505

Did you flash the ESP with new version of the code, compiled with 2.2.0? Or did you just update the core without re-flashing the ESP?

igrr avatar Jun 02 '16 07:06 igrr

i got a similar issue when prompting for console, upload goes fine, console prompts for password, click enter (blank password) doesn't work

Running Ubuntu 16.04, Arduino 1.6.9, ESP 2.2

mohsh86 avatar Jun 10 '16 13:06 mohsh86

The same problem has developed here too. Running Cinnamon, Arduino 1.6.8, ESP 2.2 Strangely, I have used the same board a week ago with no problems. Only when trying it today did it start asking for a board password. Any help would be gratefully received.

#include <ESP8266WiFi.h> #include <ESP8266mDNS.h> #include <WiFiUdp.h> #include <ArduinoOTA.h>

const char* ssid = "EE-BrightBox-mw7m7m"; const char* password = "hop-throw-neat";

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((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");Linux Serial.println("Ready"); Serial.print("IP address: "); Serial.println(WiFi.localIP()); }

void loop() { ArduinoOTA.handle(); }

Nigel-B avatar Jun 17 '16 17:06 Nigel-B

I had the same issue weeks ago. The issue is with photon. Here the solution. https://github.com/esp8266/Arduino/blob/master/doc/ota_updates/readme.md#password-protection. In the script set a pass for you. The once you upload the code using serial communocation restart arduino ide. The upload the script again using otra You should be able to upload it But some times you can't see the serial Let me know if works for u

danielperez505 avatar Jun 17 '16 20:06 danielperez505

No it doesn't work for me. It almost seems like there are two password layers or something similar.

Nigel-B avatar Jun 26 '16 20:06 Nigel-B

As I said for me it only work to upload the sketch not to se the serial communication. Maybe be sure that you install phyton 2.x and not 3.x Also that you run the ota example, then restart arruinó ide and select the esp as a port.

danielperez505 avatar Jun 26 '16 20:06 danielperez505

As I said for me it only work to upload the sketch not to se the serial communication. Maybe be sure that you install phyton 2.x and not 3.x Also that you run the ota example, then restart arruinó ide and select the esp as a port.

danielperez505 avatar Jun 26 '16 20:06 danielperez505

i have also the same problem with ota serial communication

windows 10 Arduino 1.6.8 ESP Package 2.3.0 Python 2.7.12 Hardware is Olimex 8266

With the default Arduino Example thx in advance

wi3 avatar Jun 28 '16 19:06 wi3

@igrr , i have also the same problem with ota serial communication

windows 7 Arduino 1.6.8 & 1.6.9 ESP Package 2.3.0 Python 2.7 I've also check all password that I used in AP & station mode and "123" , even when I disable

ArduinoOTA.setPassword("admin");

,prompt request for password

mkeyno avatar Jul 22 '16 21:07 mkeyno

Same using a nodemcu v3 windows 10 Arduino 1.6.11 ESP Package 2.3.0 Python 2.7

I have uncommented the line with the password ie // No authentication by default ArduinoOTA.setPassword((const char *)"123");

and tried 123 but still get uable to connect: wrong password?

Shane-Lester avatar Jan 25 '17 21:01 Shane-Lester