Skip to content
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

cannot perform ota update after ota credentials changed #2230

Closed
3 tasks done
roblatour opened this issue Sep 18, 2023 · 6 comments · Fixed by #2234
Closed
3 tasks done

cannot perform ota update after ota credentials changed #2230

roblatour opened this issue Sep 18, 2023 · 6 comments · Fixed by #2234
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@roblatour
Copy link

roblatour commented Sep 18, 2023

Describe the problem

I have a program for which ota updates were working fine.
device name was A
password was A

In my code, I then changed these to
device name B
password B

I did an over the air update, selecting the old device (A) from the port list, and providing the old password (A).

The upload worked fine.

Now, the program is showing as:
device name B in the ports list (as expected).

However, the Arduino IDE is not prompting me for a password when I try and do a OTA update, rather it is failing with:

Authenticating...FAIL
16:33:39 [ERROR]: Authentication Failed
Failed uploading: uploading error: exit status 1

I tried exiting and restarting the Arduino IDE.

I tried rebooting my computer.

I tried the nightly build of the Arduino IDE.

The same error re-appears.

To reproduce

As described above

Expected behavior

If the authentication fails on an OTA update attempt, on the next OTA update attempt the IDE should prompt the user for the password (rather than, I assume, continuing to use a bad cached password).

Arduino IDE version

2.2.1

Operating system

Windows

Operating system version

11

Additional context

this issue seems to be some what similar to #1443
However, in this case restarting the IDE does not resolve the issue.

I have checked show verbose in the settings, and the output from the upload process shows

... 192.168.1.195 -p 3232 --auth=Password ...

the IP address for the device is correct, but the password is just the word Password (i.e. the letters 'P' 'a' 's' 's' 'w' 'o' 'r' 'd'; it is neither the old or new password).

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@roblatour roblatour added the type: imperfection Perceived defect in any part of project label Sep 18, 2023
@roblatour

This comment was marked as off-topic.

@roblatour
Copy link
Author

roblatour commented Sep 18, 2023

2nd Update: I found a second, more acceptable, work around.

I moved the program folder for my project to a newly created folder.

for example, my old project folder was:
D:/Arduino_Programs/Folder_A/myprogram
and my ino file was:
D:/Arduino_Programs/Folder_A/myprogram/myprogram.ino

I moved the whole myprogram folder to: D:/Arduino_Programs/Folder_B/myprogram
and my ino file is now:
D:/Arduino_Programs/Folder_B/myprogram/myprogram.ino

and with that I ran an OTA update, the Arduino IDE prompted me for a password, I entered my new password, and it worked fine.

@per1234 per1234 self-assigned this Sep 19, 2023
@per1234

This comment was marked as outdated.

@per1234 per1234 added topic: code Related to content of the project itself status: waiting for information More information must be provided before work can proceed labels Sep 21, 2023
@per1234
Copy link
Contributor

per1234 commented Sep 21, 2023

I had a breakthrough in the investigation thanks to some information provided in a report of the same problem on the forum (I guess that is also you @roblatour???):

https://forum.arduino.cc/t/ide-2-2-1-fails-with-incorrect-ota-password-and-does-not-prompt-for-new-one/1169963

If a successful OTA upload is performed and then the IDE is closed and later re-opened the IDE appears to "remember" the board/port OTA password combination and attempts to upload the OTA code without asking for an OTA password.

The essential condition that was not mentioned here is that the upload is made to the associated board+port that was automatically selected by Arduino IDE when the sketch is restored on Arduino IDE startup.

To reproduce

Equipment

  • Any board that supports upload over a network port.

    Examples:
    • MKR1000
    • Any ESP8266-based board
    • Any ESP32-based board
    • MKR WiFi 1010 (advanced configuration is required)
    • Nano 33 IoT (advanced configuration is required)

Steps

  1. Follow the tutorial to set up your chosen board for uploading over a network port.
  2. Create and save or open an existing saved sketch.
    This step is performed in order to associate the board+network port selection with a sketch that can be restored on IDE startup.
  3. Wait for the network port to appear in the Arduino IDE ports list.
  4. Select the board and network port from the Arduino IDE menus.
  5. Select File > Quit from the Arduino IDE menus.
  6. Start Arduino IDE.
    The saved sketches that were open during the previous session will be restored.
  7. Select the window of the sketch that has the board+network port pre-selected due to the association created in the previous steps.
  8. Select Sketch > Upload from the Arduino IDE menus.
    🐛 The "Configure and Upload" dialog does not appear.
    🐛 If you have verbose upload output enabled, you will see that a default password of "Password" is used in the upload command.
  9. Select Sketch > Configure and Upload from the Arduino IDE menus.
    🐛 You can't because the "Configure and Upload" menu item is disabled.
  10. Select any other board from the Arduino IDE menus.
  11. Select the target board+network port in Arduino IDE.
  12. Select Sketch > Upload from the Arduino IDE menus.
    🙂 The "Configure and Upload" dialog does appear.

Arduino IDE version

2.2.1

Operating system

  • Windows 11
  • Ubuntu 22.04

Additional context

I bisected the regression to 69ae38e / #2165 (does not occur when using the build from the previous commit 9a6a457)

Workaround

  1. Select any other board from the Tools > Board menu in Arduino IDE.
  2. Select the target board in Arduino IDE once again.

After doing that, when you start an upload Arduino IDE will present you with a "Configure and Upload" dialog that will allow you to set the password.

@roblatour
Copy link
Author

@per1234 I cannot take credit for the post from by @robgw as that is someone else.

Regardless, I'm glad you have identified more of what lays at the heart of this, as well as an easier work around (as noted in the post above).

That is more complex than is necessary. I'll provide a more simple workaround:

Select any other board from the Tools > Board menu in Arduino IDE.
Select the target board in Arduino IDE once again.

Well done.

Hope a code fix to address this will be possible.

Cheers

@kittaakos kittaakos self-assigned this Sep 21, 2023
kittaakos pushed a commit that referenced this issue Sep 21, 2023
Ref: #2165
Closes #2230

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit that referenced this issue Sep 26, 2023
Ref: #2165
Closes #2230

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos kittaakos added the conclusion: resolved Issue was resolved label Sep 26, 2023
@roblatour
Copy link
Author

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants