Repository navigation
Fix C3 for Tesla power off after few hours bugs - #409
Merged
Merged
Conversation
- Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer
blocking longitudinal commands
- Detect stock steering control (DAS_steeringControlType != NONE) and block
lateral commands at the panda safety layer, unconditionally respecting
DAS emergency evasive steering
- Both mechanisms act as a hardware-level safety firewall
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modifies hardwared’s offroad power-management behavior to avoid unintended power-saving and auto-shutdown on Tesla vehicles (where CAN can remain powered while parked), which can otherwise lead to the device powering off after extended parked periods.
Changes:
- Add a lightweight
CarParamscache to detect whether the current vehicle brand is Tesla. - Make power-save decisions based on ignition + screen brightness, with a Tesla exception (never power save).
- Skip auto-shutdown on Tesla by gating
power_monitor.should_shutdown(...)on the Tesla detection.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+194
to
+197
| cp_bytes = params.get("CarParams") | ||
| if not cp_bytes or cp_bytes == self._last_bytes: | ||
| return | ||
| self._last_bytes = cp_bytes |
|
|
||
| # Power save decision: independent of should_start | ||
| # For Tesla: never power save (CAN stays alive when parked) | ||
| should_pwrsave = (not tesla_no_sleep) and (not onroad_conditions["ignition"] and msg.deviceState.screenBrightnessPercent < 1e-3) |
Comment on lines
+425
to
+428
| # On Tesla, keep started_ts valid even when parked so the manager | ||
| # does NOT kill selfdrive/controls processes (CAN stays alive). | ||
| if tesla_no_sleep and started_ts is None and started_seen: | ||
| started_ts = time.monotonic() |
ChanHoya
pushed a commit
that referenced
this pull request
Jun 24, 2026
* Handle stock AEB and active steering avoidance by disengaging openpilot
- Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer
blocking longitudinal commands
- Detect stock steering control (DAS_steeringControlType != NONE) and block
lateral commands at the panda safety layer, unconditionally respecting
DAS emergency evasive steering
- Both mechanisms act as a hardware-level safety firewall
* fix C3 on Tesla will not power off
happymaj11r
pushed a commit
to happymaj11r/openpilot
that referenced
this pull request
Jun 25, 2026
* Handle stock AEB and active steering avoidance by disengaging openpilot
- Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer
blocking longitudinal commands
- Detect stock steering control (DAS_steeringControlType != NONE) and block
lateral commands at the panda safety layer, unconditionally respecting
DAS emergency evasive steering
- Both mechanisms act as a hardware-level safety firewall
* fix C3 on Tesla will not power off
(cherry picked from commit e7f764b)
Donfyffe
pushed a commit
to Donfyffe/openpilot
that referenced
this pull request
Jun 26, 2026
* Handle stock AEB and active steering avoidance by disengaging openpilot
- Detect stock AEB (DAS_aebEvent) and trigger PERMANENT alert + safety layer
blocking longitudinal commands
- Detect stock steering control (DAS_steeringControlType != NONE) and block
lateral commands at the panda safety layer, unconditionally respecting
DAS emergency evasive steering
- Both mechanisms act as a hardware-level safety firewall
* fix C3 on Tesla will not power off
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check IQ and SP code and tested pass