tttapa / ESP8266

Documentation and help with the ESP8266 chip/boards/modules
GNU General Public License v3.0
651 stars 282 forks source link

OTA Update password not working #40

Open peregrinogris opened 5 years ago

peregrinogris commented 5 years ago

In chapter 13 the code snippet explaining how to setup OTA updates states:

  Serial.println(WiFi.localIP());           // Send the IP address of the ESP8266 to the computer

  ArduinoOTA.setHostname("ESP8266");
  ArduinoOTA.setPassword("esp8266");

  ArduinoOTA.onStart([]() {
    Serial.println("Start");
  });

The problem I seem to be facing is that without adding the (const char*) casting to the password line:

  ArduinoOTA.setPassword((const char *)"esp8266");

whenever I try to upload a new sketch over OTA, the ESP will always refuse the password. I took a look at the official ESP8266 documentation and all the examples I could find have the type casting when using setPassword with an inline string.

in case it helps, I'm using Arduino IDE 1.8.7, ESP8266 2.4.2 and running Ubuntu 18.10.