Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

OTA password

Open jeffryr opened this issue 11 years ago • 25 comments

When trying to upload a sketch via OTA from the IDE, the following dialog box pops up:

Type board password to upload a new sketch

Clicking on Upload without entering a password results in the following error message:

Sketch uses 259,828 bytes (59%) of program storage space. Maximum is 434,160 bytes.
Global variables use 39,458 bytes (48%) of dynamic memory, leaving 42,462 bytes for local variables. Maximum is 81,920 bytes.
processing.app.debug.RunnerException: Unable to connect to 192.168.100.59
    at cc.arduino.packages.uploaders.SSHUploader.uploadUsingPreferences(SSHUploader.java:136)
    at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
    at processing.app.Sketch.upload(Sketch.java:1178)
    at processing.app.Sketch.exportApplet(Sketch.java:1152)
    at processing.app.Sketch.exportApplet(Sketch.java:1124)
    at processing.app.Editor$DefaultExportHandler.run(Editor.java:2452)
    at java.lang.Thread.run(Thread.java:745)
Unable to connect to 192.168.100.59

Trying to access the monitor via OTA a similar dialog box pops up. This may be related to the REST API used by the Arduino Yun which by default is password protected.

jeffryr avatar Nov 03 '15 13:11 jeffryr

its look like you using the Version 1.6.6 of the Arduino IDE, in this version they change the OTA handling to SSH which is not possible with the ESP. try to use version 1.6.5.

Links2004 avatar Nov 04 '15 17:11 Links2004

This was with Version 1.6.5-r5 on linux, I'll try it with 1.6.5 and let you know.

jeffryr avatar Nov 04 '15 19:11 jeffryr

Oops, my bad, errant symbolic link was left pointing to some random flavor of 1.6.6.

jeffryr avatar Nov 04 '15 19:11 jeffryr

Tried it with 1.6.5 as well:

head -1 arduino-1.6.5/revisions.txt
ARDUINO 1.6.5 - 2015.06.15
cd arduino-1.6.5/hardware/esp8266com/esp8266
git log | head -6
commit deb68987face14f29553127c6f15223f0daf173f
Merge: 49bc812 d57315b
Author: Ivan Grokhotkov <[email protected]>
Date:   Wed Nov 4 18:53:03 2015 +0300

    Merge pull request #955 from pgollor/master

Still prompts for a password. Clicking on Upload without entering a password results in the following error message:

Unable to connect: wrong password?

jeffryr avatar Nov 05 '15 17:11 jeffryr

1.6.5/Windows10, the password box shows up for me only when i try to use to the serial monitor, clicking 'upload' (on serial monitor password prompt) generates the same error.

webguy16 avatar Nov 05 '15 20:11 webguy16

Serial Monitor for networked ESPs will not work yet. Arduino uses SSH for that and changes to the IDE are necessary. If the Arduino Team accepts out changes to enable OTA with the Upload button, next we will push one that will enable SerialMonitor over sockets so that we can use it on the ESP. Hopefully soon it will all work a breeze :)

me-no-dev avatar Nov 08 '15 10:11 me-no-dev

This issue persists, in even the latest Arduino 1.6.7 nightlies / 2.1.x WIP branches. Tested on Mac OS X. It's a deal-breaker, ladies! I don't understand why Arduino is ignoring the upload directives in platform.txt. Also, I am having a hard time reproducing this bug to investigate why.. even though I couldn't avoid it, earlier! Humph.

mralexgray avatar Nov 22 '15 05:11 mralexgray

This issue persists in nightlies because the pull request hasn't been merged by the Arduino team (yet).

igrr avatar Nov 22 '15 06:11 igrr

@igrr I don't see an open request re: issue #959 which number is it? Nevermind, I see it.. Enable OTA Update mechanism for any mDNS enabled platform
 #4107

mralexgray avatar Dec 05 '15 00:12 mralexgray

yes I have same problem. any solution?

irwanayeah avatar Dec 29 '15 17:12 irwanayeah

Update to Arduino IDE 1.6.7

me-no-dev avatar Dec 29 '15 17:12 me-no-dev

@danielfabro,

Please follow this example and your should not see any window asking for a "password to upload a new sketch". If there are issues then check Troubleshooting section as well.

If this not helps then check this post and the whole following thread for an issue that may be similar to what you have.

Krzysztof

krzychb avatar Jan 07 '16 18:01 krzychb

I can get OTA uploads working ok with 1.6.7 but i wondered about the comment from @me-no-dev back in Nov suggesting Serial Monitor might be made to work remotely too, which would be really cool. It prompts for a password if i try though, is it possible for remote serial monitor to work yet?

torntrousers avatar Jan 28 '16 16:01 torntrousers

not yet, but i'm thinking about it :) whatever we propose to the Arduino team it needs to be generic and implementable across the boards. While a simple TCP Socket is not a problem, there needs to be an option for authentication and that is the hard part. Have secure authentication that is implementable on all networked arduinos (that do not have the capability to run SSH)

me-no-dev avatar Jan 28 '16 17:01 me-no-dev

From my point of view:

Debug-Code should not be present in production code. So hardcoding wifi credentials etc. just for debugging purpose would be ok for me. But that might conflict with scenarios where wifi is also used for other things and not just debug.

tuxedo0801 avatar Feb 25 '16 13:02 tuxedo0801

Here the solution : https://github.com/esp8266/Arduino/blob/master/doc/ota_updates/readme.md#password-protection

danielperez505 avatar Jun 15 '16 03:06 danielperez505

Same problem for 1.8.3 installed from homebrew.

elgs avatar Aug 01 '17 03:08 elgs

Just be sure that you follow the steps, install phyton and disable your FW

danielperez505 avatar Aug 02 '17 22:08 danielperez505

Have the same error macOS 10.13.3 Arduino IDE 1.8.5 On uploading the error The dialog Type board password to upload a new sketch I enter the password as defined in the BasicOTA script. and get the error

python /Users/csmcvea/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/tools/espota.py -i 192.168.1.8 -p 8266 --auth=mypass -f /var/folders/2k/qfnbmhxd0plfydqbkrr_phlr0000gn/T/arduino_build_404073/BasicOTA.ino.bin Authenticating...FAIL 12:58:59 [ERROR]: ERR: ERROR[11]: Invalid bootstra I enter nothing in the dialog and this error python/Users/csmcvea/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/tools/espota.py -i 192.168.1.8 -p 8266 --auth= -f /var/folders/2k/qfnbmhxd0plfydqbkrr_phlr0000gn/T/arduino_build_404073/BasicOTA.ino.bin Authenticating...FAIL 13:03:39 [ERROR]: Authentication Failed The thing is when I first uploaded it ran perfectly, so I figured I'd just tweet the password, the port, the setHostname. And never ran again. I tried flashing the ESP8266 again and loaded the BasicOTA again but this time I only changed the ssid and password. No joy!

If you can help it's much appreciated. csmcvea

csmcvea avatar Feb 23 '18 21:02 csmcvea

Is the fw in toy computer

On 24 Feb 2018 8:16 AM, "csmcvea" [email protected] wrote:

Have the same error macOS 10.13.3 Arduino IDE 1.8.5 On uploading the error The dialog Type board password to upload a new sketch I enter the password as defined in the BasicOTA script. and get the error

python /Users/csmcvea/Library/Arduino15/packages/esp8266/ hardware/esp8266/2.4.0/tools/espota.py -i 192.168.1.8 -p 8266 --auth=mypass -f /var/folders/2k/qfnbmhxd0plfydqbkrr_ phlr0000gn/T/arduino_build_404073/BasicOTA.ino.bin Authenticating...FAIL 12:58:59 [ERROR]: ERR: ERROR[11]: Invalid bootstra I enter nothing in the dialog and this error python/Users/csmcvea/Library/Arduino15/packages/esp8266/ hardware/esp8266/2.4.0/tools/espota.py -i 192.168.1.8 -p 8266 --auth= -f /var/folders/2k/qfnbmhxd0plfydqbkrr_phlr0000gn/T/arduino_build_404073/BasicOTA.ino.bin Authenticating...FAIL 13:03:39 [ERROR]: Authentication Failed The thing is when I first uploaded it ran perfectly, so I figured I'd just tweet the password, the port, the setHostname. And never ran again. I tried flashing the ESP8266 again and loaded the BasicOTA again but this time I only changed the ssid and password. No joy!

If you can help it's much appreciated. csmcvea

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/esp8266/Arduino/issues/959#issuecomment-368140764, or mute the thread https://github.com/notifications/unsubscribe-auth/ARdZmybeXIzDBadeAcSLAzAgCkz_qILxks5tXyqlgaJpZM4Ga4yw .

danielperez505 avatar Feb 23 '18 22:02 danielperez505