Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) ESP32 OTA password problems (Read 1256 times)
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
ESP32 OTA password problems
Dec 14th, 2024 at 12:18pm
Print Post  
Hi,
I have a project that uses OTA to update an ESP32.
The password for OTA is set correctly in the Arduino OTA code.
The first time I tried to upload (without a board.txt file) it asked for a password, which I gave but typed incorrectly.
I then created a board.txt file with network.password=<correct password>
Whenever I try to do an upload it continues to use the old incorrect password (as seen in the verbose output)
If I change the password in board.txt it does not change when trying to upload.
I removed the board.txt and it still tries to upload with security.
I did a clean and rebuild, still the same.

It appears the password is being cached somewhere but I have no idea where.
If I remember it was historically always read from the board.txt file in the project.

Any ideas?
« Last Edit: Dec 14th, 2024 at 12:24pm by Acuario »  
Back to top
 
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: ESP32 OTA password problems
Reply #1 - Dec 14th, 2024 at 1:00pm
Print Post  
More info:
It definitely appears it is cached. 
Closing VS and re opening it with the project and the password is correctly read from board.txt however making any changes in board.txt are not picked up until VS is closed and opened again.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: ESP32 OTA password problems
Reply #2 - Dec 16th, 2024 at 9:44am
Print Post  
Thanks for the report and noting the workaround of restarting VS.

We will look into this and update when a fix is available.
  
Back to top
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: ESP32 OTA password problems
Reply #3 - Feb 21st, 2025 at 7:01am
Print Post  
Hi, any progress on this - it is still broken in the latest version.
  
Back to top
 
IP Logged
 
WoeperBe
Junior Member
**
Offline


Posts: 19
Location: Belgium
Joined: Mar 18th, 2020
Re: ESP32 OTA password problems
Reply #4 - Feb 21st, 2025 at 8:46am
Print Post  
Have you tried using a ArduinoOTA.setPasswordHash
i never get it to work since some time ....
But it is not visual micro related i think ?
  
Back to top
 
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: ESP32 OTA password problems
Reply #5 - Feb 21st, 2025 at 9:45am
Print Post  
I´m pretty sure it is a VM problem.
When I do an OTA upload I see the password in the command string in the output window. If I change the password in the board.txt the password in the command string stays the same - implies to me that it is cached and not read on each upload.

Only way to reset it is to close/open Visual Studio, it then picks up the new password.

I have no problems using OTA updates, work perfectly for me as long as the passwords are the same Smiley
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: ESP32 OTA password problems
Reply #6 - Feb 21st, 2025 at 10:33am
Print Post  
Thanks for the updates, can you attach the build and upload log from your machine with the below options enabled:
  • vMicro > Compiler > Verbose
  • vMicro > Compiler > Show Build Properties
  • vMicro > Uploader > Verbose


  
Back to top
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: ESP32 OTA password problems
Reply #7 - Feb 21st, 2025 at 11:36am
Print Post  
Here it is but I don´t know if it will help much.
Simply do an upload with any password then change the password in board.txt, re do the upload and you will see the password in the espota.exe command string will not have changed to the new password from the board.txt

From board.txt
network.password=j3ss1camEMS2
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: ESP32 OTA password problems
Reply #8 - Feb 21st, 2025 at 11:41am
Print Post  
Thanks for the log and detail, we thought the issue with the board.txt changes had been fixed in a recent release (and tested OK), however this is clearly not the case.

We will update this thread when there is a fix for this issue.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: ESP32 OTA password problems
Reply #9 - Feb 21st, 2025 at 6:02pm
Print Post  
The latest release (25.0120.4) should resolve this issue fully, and can be downloaded from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Let us know if you have any further issues with the board.txt entries not updating during the session.
  
Back to top
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: ESP32 OTA password problems
Reply #10 - Feb 21st, 2025 at 6:39pm
Print Post  
I can confirm this is now ok - thanks.
  
Back to top
 
IP Logged
 
Acuario
Senior Member
****
Offline


Posts: 256
Location: Spain
Joined: Aug 28th, 2015
Re: ESP32 OTA password problems
Reply #11 - Feb 22nd, 2025 at 7:32am
Print Post  
..or maybe not. Something strange is going on. It worked a few times but then for no reason it has lost all authentication on code uploads but on spiffs uploads it is ok. Restarting VS has not fixed it.

LITTLEFS Uploading Image...
Quote:

[LITTLEFS] upload : 44d8cf5359afa08abf/EMS2.ino.littlefs.bin
[LITTLEFS] IP     : 192.168.0.203
"python.exe" 3.0.7\\tools\\espota.py" -i 192.168.0.203 -p 3232 -a j3ss1camEMS2 -s -f 44d8cf5359afa08abf/EMS2.ino.littlefs.bin
   Sending invitation to 192.168.0.203
   Authenticating...OK


Output from code upload:
Quote:


Uploading via Bootloader 
Port Properties (network)
\espota.exe -i 192.168.0.203 -p 3232 "--auth=" -f 
Sending invitation to 192.168.0.203 
Authenticating...FAIL
08:31:17 [ERROR]: Authentication Failed
The uploader process failed


For some reason the forum is truncating the commands but the authentication is not there in the code upload.
« Last Edit: Feb 22nd, 2025 at 7:37am by Acuario »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: ESP32 OTA password problems
Reply #12 - Feb 24th, 2025 at 1:46pm
Print Post  
Thanks for the update.

Can you add the below entry to your local board.txt file:
network.auth_upload=yes

And try the build & upload again?
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint