Skip to content

feat: reconnect for serial#383

Merged
hfudev merged 1 commit intoespressif:mainfrom
horw:feat/serial-watchdog
Oct 24, 2025
Merged

feat: reconnect for serial#383
hfudev merged 1 commit intoespressif:mainfrom
horw:feat/serial-watchdog

Conversation

@horw
Copy link
Collaborator

@horw horw commented Oct 22, 2025

Description

Added auto-reconnection for serial ports that close unexpectedly.
If a device is unplugged and then plugged in again, the log output would get stuck. This MR introduces a fix to prevent that issue.

Related

Testing


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@horw horw force-pushed the feat/serial-watchdog branch from c63a841 to d01209c Compare October 22, 2025 09:19
@horw horw requested a review from hfudev October 22, 2025 09:24
@hfudev hfudev requested a review from Copilot October 23, 2025 02:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a watchdog mechanism to detect stalled serial connections by logging warnings when no data has been received for more than 5 seconds.

  • Adds time-based monitoring to track serial data reception
  • Logs warnings when 5+ seconds pass without receiving data
  • Updates the last data timestamp whenever data is successfully read

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@horw
Copy link
Collaborator Author

horw commented Oct 23, 2025

Reconnection logs look like this now:

image

@horw horw force-pushed the feat/serial-watchdog branch from 9d55aae to 46682d1 Compare October 23, 2025 08:40
@horw horw requested a review from Copilot October 23, 2025 08:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 7 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@horw horw changed the title feat: add watchdog for serial when no data received after 5 seconds feat: add watchdog for serial when no data received after 5 seconds | feat: reconnect for serial Oct 23, 2025
@horw horw changed the title feat: add watchdog for serial when no data received after 5 seconds | feat: reconnect for serial feat: add watchdog for serial when no data received after 15 seconds | feat: reconnect for serial Oct 23, 2025
@horw horw force-pushed the feat/serial-watchdog branch from 46682d1 to 019e38a Compare October 24, 2025 03:06
@horw horw changed the title feat: add watchdog for serial when no data received after 15 seconds | feat: reconnect for serial feat: reconnect for serial Oct 24, 2025
@hfudev hfudev merged commit 7082e5d into espressif:main Oct 24, 2025
3 of 5 checks passed
@horw horw mentioned this pull request Oct 24, 2025
6 tasks
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.

4 participants