earlephilhower / arduino-esp8266littlefs-plugin

Plugin to upload LittleFS filesystems to ESP8266
GNU General Public License v2.0
120 stars 20 forks source link

OTA Authentication fail. #6

Open cmbhjv opened 4 years ago

cmbhjv commented 4 years ago

When trying to do OTA in a device with OTA password set, authentication fails.

It doesn't ask for the password either.

My guess is that it needs to pop the Password request form (I guess it's this one here ) and pass it as the "-a" argument to espota.py (here)

earlephilhower commented 4 years ago

This is the mklittlefs.exe github, not related to OTA. I suggest you look at the esp8266 core for assistance.

cmbhjv commented 4 years ago

Sorry, but I believe you are mistaken. mklittlefs.exe is another repository.

This is the "arduino-esp8266littlefs-plugin" github. image

It's the arduino-esp8266littlefs-plugin who needs to ask for the password. The ESP8266LittleFS.java file in this repository calls the espota.py without the -a argument.

earlephilhower commented 4 years ago

Ah, you are correct. I do own both repos. However, the littlefs-java uploader is mostly a cut-n-paste version of the standard arduino 8266 one by me-no-dev:

https://github.com/esp8266/arduino-esp8266fs-plugin/blob/56a6c515545ff5301be5e679d014ab7062600d81/src/ESP8266FS.java#L322

I don't believe it gets a notice that the OTA has a password (most don't since OTA is insecure and will pass PWDs plaintext over the air). Not sure there's a way to know if a PWD has been set in the IDE. Will need a little study.

If you've got a suggestion, PRs are always appreciated. :)

877dev commented 3 years ago

I've been having the same issue here, ArduinonIDE does not prompt for a password when uploading LittleFS OTA.

A workaround is to flash a sketch with no password, upload LittleFS, then flash sketch with password.

LeisureLadi commented 2 years ago

cmbhjv and 877dev, I have forked the repo and added a dialog box for the password. The downside is, that the box will open every time, no matter if a password is required or not. But you can leave the box empty to upload without a password. Have fun!

877dev commented 2 years ago

cmbhjv and 877dev, I have forked the repo and added a dialog box for the password. The downside is, that the box will open every time, no matter if a password is required or not. But you can leave the box empty to upload without a password. Have fun!

That sounds good thank you. I’ll check that out and report back! 👍

877dev commented 2 years ago

@LeisureLadi @cmbhjv finally I got to test this (been away for a week). It works!

Password box appears, enter OTA password, small delay, then Authenticating...OK and Uploading..... Takes a while to upload, and there is no Finished message. But is works.

Excellent work, thank you.

@earlephilhower FYI https://github.com/earlephilhower/arduino-esp8266littlefs-plugin/pull/18

LeisureLadi commented 2 years ago

@877dev The missing 'Finished' message is related with the Python script. It is missing there. Having said this, it is also missing, when you OTA a sketch. I'm not sure if it can be added there. Feel free to investigate and let us know, what you find.