Skip to content

Add troubleshooting guide #4995

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

Merged
merged 9 commits into from
Jun 19, 2025
Merged

Add troubleshooting guide #4995

merged 9 commits into from
Jun 19, 2025

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jun 13, 2025

Description:

This PR adds comprehensive documentation on how to obtain stack traces from ESPHome device crashes. The new troubleshooting guide provides step-by-step instructions for debugging crashes, including:

  • How to compile firmware locally to ensure matching debug symbols
  • Instructions for downloading YAML configurations from the ESPHome Device Builder
  • How to connect devices via USB for serial console access
  • How to use esphome logs to capture and automatically decode stack traces
  • Example output showing what users will see when a crash is decoded
  • Common issues and solutions
  • Alternative method using the ESP Stack Trace Decoder web tool (https://esphome.github.io/esp-stacktrace-decoder/)

The guide has been linked from relevant documentation pages including the logger component, debug component, safe mode component, FAQ, and voice assistant warnings.

Related issue (if applicable): fixes

Pull request in esphome with YAML changes (if applicable):

  • esphome/esphome#

Checklist:

  • I am merging into next because this is new documentation that has a matching pull-request in esphome as linked above.
    or

  • I am merging into current because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.

  • Link added in /components/index.rst when creating new documents for new components or cookbook.

Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 0e7d6ac
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/685369ddf350b800084f5c62
😎 Deploy Preview https://deploy-preview-4995--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bdraco bdraco marked this pull request as ready for review June 13, 2025 14:30
Copy link
Contributor

coderabbitai bot commented Jun 13, 2025

"""

Walkthrough

A new troubleshooting guide was added, focusing on diagnosing device crashes and obtaining decoded backtraces. Multiple documentation files were updated to reference this guide in their "See Also" or warning sections, and the FAQ was updated to suggest the guide as a troubleshooting step for crashes. No code or API changes were made.

Changes

File(s) Change Summary
guides/troubleshooting.rst Added a new troubleshooting guide detailing crash diagnosis and backtrace decoding procedures.
components/debug.rst,
components/logger.rst,
components/safe_mode.rst
Added "See Also" references to the new troubleshooting guide.
components/voice_assistant.rst Added a warning note advising users to consult the troubleshooting guide for crash backtraces.
guides/faq.rst Added a troubleshooting step recommending the new guide for crash-related issues.

Sequence Diagram(s)

sequenceDiagram
    User->>Documentation: Encounters device crash
    Documentation->>guides/troubleshooting.rst: Directs user to troubleshooting guide
    User->>guides/troubleshooting.rst: Follows step-by-step instructions
    guides/troubleshooting.rst->>User: Provides procedures for obtaining and decoding backtraces
    User->>Support/Issue Tracker: Submits decoded backtrace if further help is needed
Loading

Suggested reviewers

  • jesserockz
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9bdf450 and 0e7d6ac.

📒 Files selected for processing (1)
  • guides/troubleshooting.rst (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • guides/troubleshooting.rst
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (6)
guides/troubleshooting.rst (4)

4-7: Validate SEO metadata and image reference
The :description: and :image: entries look correct, but double-check that bug-report.svg is available in the static assets and that the description captures key search terms (e.g., “backtrace”, “crash debugging”).


8-11: Intro needs a stronger hook
Consider adding a brief sentence linking here from the main index or noting prerequisites (e.g., YAML version) to orient the reader.


49-64: Collapse excessive blank lines in backtrace example
Lines 60–63 are blank within the code-block:: text; consider removing or reducing them to improve readability.


89-95: Consider adding Safe Mode to See Also
To mirror the cross-references you've added elsewhere, you may want to include the Safe Mode guide here:

- :doc:`/components/safe_mode` - Safe Mode recovery guide
components/logger.rst (1)

326-326: Unify link text across components
Phrasing (“including how to get backtraces”) differs slightly from other components. Consider standardizing to “Troubleshooting guide for obtaining decoded backtraces”.

components/debug.rst (1)

101-101: Standardize cross-ref phrasing
Link text (“including how to get backtraces from crashes”) differs from logger/safe_mode. Consider aligning wording for consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a103f13 and 585508e.

📒 Files selected for processing (6)
  • components/debug.rst (1 hunks)
  • components/logger.rst (1 hunks)
  • components/safe_mode.rst (1 hunks)
  • components/voice_assistant.rst (1 hunks)
  • guides/faq.rst (1 hunks)
  • guides/troubleshooting.rst (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**`: - Do not generate or add any sequence diagrams

**: - Do not generate or add any sequence diagrams

  • components/safe_mode.rst
  • components/logger.rst
  • components/debug.rst
  • components/voice_assistant.rst
  • guides/faq.rst
  • guides/troubleshooting.rst
🔇 Additional comments (14)
guides/troubleshooting.rst (11)

1-2: Title formatting is correct
The underline matches the title length and uses the proper level for a top-level heading.


13-18: Checklist formatting is consistent
Numbered list clearly outlines prerequisites. No changes needed.


19-21: Section heading style is correct
The underline length and character (~) are appropriate for a second-level section.


22-31: Step 1 link verification
The reference to the CLI guide uses an absolute path (:doc:/guides/cli``). Please verify this resolves correctly in the built documentation.


32-36: Code block indentation is valid
The block directive and its content are indented properly; no adjustments required.


37-40: Note admonition is clear
The rationale for preferring USB upload is concise and well-placed.


41-48: Steps 2 and 3 are self-explanatory
Instructions for connecting via USB and monitoring logs are clear.


45-48: Logs code block indentation
Matches the earlier block. Consistency confirmed.


73-78: Decoded backtrace explanation is clear
The bullet list succinctly summarizes what the user gains from the decoded output.


79-82: “Important” note formatting is correct
The admonition emphasizes the need for matching debug symbols.


83-88: Common issues section is well-structured
Both troubleshooting tips address the most likely user mistakes.

components/safe_mode.rst (1)

53-53: New See Also entry looks good
The link text accurately reflects the guide’s purpose.

guides/faq.rst (1)

270-270: FAQ entry is consistent
Bullet and bold formatting matches the existing style and clearly points to the troubleshooting guide.

components/voice_assistant.rst (1)

21-22: Add troubleshooting guide reference for crashes

Nicely directs users experiencing crashes to the new troubleshooting guide. Links and formatting match existing documentation patterns.

Copy link
Member

@jesserockz jesserockz left a comment

Choose a reason for hiding this comment

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

We also have https://esphome.github.io/esp-stacktrace-decoder/ to allow users to "upload" (nothing leaves the browser) the encoded stack trace along with the .elf file (available to download from the dashboard in the menu on the card [only works if you have not recompiled since last flashing the device])

@bdraco
Copy link
Member Author

bdraco commented Jun 19, 2025

Didn't know about that. I'll incorporate it in as its not mentioned anywhere in the docs currently AFAICT

@jesserockz
Copy link
Member

Yeah its relatively new to ESPHome, I forked it as someone wanted to fix some bugs then the author reached out recently and we transferred into the org for better visibility

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6028c03 and 9bdf450.

📒 Files selected for processing (3)
  • components/debug.rst (1 hunks)
  • components/logger.rst (1 hunks)
  • guides/troubleshooting.rst (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/debug.rst
  • components/logger.rst
🧰 Additional context used
📓 Path-based instructions (1)
`**`: - Do not generate or add any sequence diagrams

**: - Do not generate or add any sequence diagrams

  • guides/troubleshooting.rst
🪛 GitHub Check: build
guides/troubleshooting.rst

[failure] 97-97:
Directive 'note' is not followed by an empty line. Please insert an empty line after guides/troubleshooting.rst:97

🪛 GitHub Actions: Lint
guides/troubleshooting.rst

[error] 97-97: lint: Directive 'note' is not followed by an empty line. Please insert an empty line after line 97.

🔇 Additional comments (1)
guides/troubleshooting.rst (1)

1-122: Comprehensive and well-structured guide

The new troubleshooting document is thorough, clear, and logically organized—covering compilation, USB connection, log monitoring, decoding (both CLI and web-based), and common pitfalls. It integrates examples and “See Also” links effectively.

@jesserockz
Copy link
Member

Thanks 🙏

@jesserockz jesserockz merged commit fc29968 into current Jun 19, 2025
3 checks passed
@jesserockz jesserockz deleted the troubleshooting_guide branch June 19, 2025 01:41
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants