Skip to content

Fix improv_serial initialization failure after "Prepare for First Use"#888

Merged
balloob merged 1 commit intoesphome:mainfrom
skipfire:main
Mar 30, 2026
Merged

Fix improv_serial initialization failure after "Prepare for First Use"#888
balloob merged 1 commit intoesphome:mainfrom
skipfire:main

Conversation

@skipfire
Copy link
Copy Markdown
Contributor

Problem
After completing "Prepare for First Use" (device flashing), the improv_serial component fails to initialize because the UART buffer contains residual data from the flashing process and device boot sequence. This causes improv_serial to fail parsing the initial handshake.

image

Solution
Add a device reset (RTS pulse) at the end of the installation process, before handing control to improv_serial. This clears the serial buffer and allows improv_serial to start with a clean state.

Changes

  • Import resetSerialDevice utility
  • Call resetSerialDevice(esploader.transport) after successful firmware installation

The reset uses the same RTS pulse mechanism as the existing "Reset Device" button in the logs view.

Testing
Load website with HTTPS
Use "Prepare for First Use" to flash a device
Proceed to "Configure Wi-Fi"
improv_serial should now successfully initialize and allow Wi-Fi configuration

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@balloob balloob merged commit 579da0a into esphome:main Mar 30, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants