Skip to content

Work around non-OTA auth issue in ESP8266 #116

@airdrummingfool

Description

@airdrummingfool

Hello,
There's a bug between PlatformIO and esptool that causes an error when an auth password is set while doing a plugged-in (non-OTA) upload.

The issue is that no matter the upload method, if there is an OTA password set PlatformIO sends --auth=[password] in upload_flags, which esptool cannot handle (only espota understands the --auth parameter). There's more discussion here: https://community.platformio.org/t/upload-error-255-esp8266-upload-flags-for-auth-break-usb-serial-upload/774

The fix is to delete the OTA password when doing non-OTA uploads, and add it back in when you want to do an OTA upload. This makes switching between password-protected OTA uploads and standard uploads a pain, because you have to reset the password each time you switch between the two.

Unfortunately, according to that link the PlatformIO people say it is an esptool bug, and I doubt the esptool people would be any more inclined to fix it.

To be clear, this bug has nothing to do with Deviot. I certainly understand if you think this is out of scope, but I figured Deviot could work around the error by skipping the self.authOTA() call (in PlatformioCLI.py near line 329) IFF the upload is not an OTA upload.

I tried to work up a PR to demonstrate, but I'm not sure of a foolproof way to detect whether or not it is an OTA upload. The only thing I can think of is checking the serial port to see if it is a path (/something/like/this) vs an IP address or network host - but I'm not sure how to do that reliably across all platforms. Do you have any suggestions? Is this something you'd be willing to incorporate into your code, or is this completely out of scope?

Thanks for this great plugin!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions