-
Notifications
You must be signed in to change notification settings - Fork 7.6k
OTA runtime password set has no effect. #8803
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
Comments
It has a check if OTA is already initialized: https://github.com/espressif/arduino-esp32/blob/master/libraries/ArduinoOTA/src/ArduinoOTA.cpp#L74 |
Oh. Thank you for the fast response. Will check it! |
It seems to work if i remove the check. Modified method ArduinoOTAClass& ArduinoOTAClass::setPassword(const char * password) {
if (!_password.length() && password) {
MD5Builder passmd5;
passmd5.begin();
passmd5.add(password);
passmd5.calculate();
_password = passmd5.toString();
}
return *this;
} |
After the latest upgrade I modified the method again and it didn't work this time. The method is the same as last time but can't change the password. |
I know that because other parts of my application which uses the same dinamically changing password has successfully changed it but the OTA does not. It remained the same before the password change. |
I have followed the steps which involved the base library tweeking.
|
this is probably due to MDNS caching on your computer. MDNS records have Time To Live and the host does not need to check the record for changes before half of that time passes. |
Since I'm using PIO and I try to upload ota with mdns name specified, will it work if I type the esp32 IP instead of it's mdns name? |
This should have been enough then. I see nothing else in the code preventing the password change |
Tried with IP address instead of mdns name now and it does not work. |
I have several ESP32 on the network running test sketches for days. Linking .pio\build\esp-wrover-kit\firmware.elf
Retrieving maximum program size .pio\build\esp-wrover-kit\firmware.elf
Checking size .pio\build\esp-wrover-kit\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 12.6% (used 41160 bytes from 327680 bytes)
Flash: [====== ] 64.1% (used 2015781 bytes from 3145728 bytes)
Building .pio\build\esp-wrover-kit\firmware.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 27 ELF sections
Successfully created esp32 image.
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, ftdi, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = espota
Uploading .pio\build\esp-wrover-kit\firmware.bin
15:59:04 [DEBUG]: Options: {'esp_ip': 'test3.local', 'host_ip': '0.0.0.0', 'esp_port': 3232, 'host_port': 28577, 'auth': 'admin_test_pw_2', 'image': '.pio\\build\\esp-wrover-kit\\firmware.bin', 'spiffs': False, 'debug': True, 'progress': True, 'timeout': 10}
15:59:04 [INFO]: Starting on 0.0.0.0:28577
15:59:04 [INFO]: Upload size: 2022352
Sending invitation to test3.local
Authenticating...FAIL
15:59:04 [ERROR]: Authentication Failed
*** [upload] Error 1
=============================== [FAILED] Took 101.90 seconds =============================== If I restart these ESP-s the password is changing correctly once. |
Board
ESP32-Wrover
Device Description
no
Hardware Configuration
no
Version
latest master (checkout manually)
IDE Name
PlatformIO
Operating System
Windows10
Flash frequency
80
PSRAM enabled
yes
Upload speed
115200
Description
I want to be able to dinamically change OTA password every day, but it has no effect.
Sketch
Debug Message
Other Steps to Reproduce
If i reinitialise OTA, my esp crashes.
void setNewOTA_Password(){
ArduinoOTA.end();
vTaskDelay(100); // Doesn't matter.
ArduinoOTA.begin(); // Crash
}
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: