Add CAN bus safety
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- embedded-iot, networking
Research direction
Start with boards/esp/src/can.rs:127 for the hard-coded TWAI bitrate, then inspect the [[hardware.esp.can_buses]] configuration and the MCP2515 can_speed setting. The remaining work spans bitrate validation, CAN-FD read-only behavior, exposing RX health in system state, and BLE/debug-only read-only control; done means those safety requirements are implemented and verified across the affected platform and app paths.
Written by the indexing model from the issue text.
Description
The firmware should ensure the CAN bus is healthy at all time. For development purposes, there should be a way to control the CAN read-only mode. And on each boot, before sending any CAN messages, we need to make sure the car is the right one for the firmware. So each platform implementations need a way to detect what cars they are plugged into (VIN is probably a good way).
Remaining from the audit
Done on main: listen-only while read-only, bus-off restart, bounded TX, per-bus
TX queues.
- Configurable bitrate. TWAI is hard-coded to 500 kbps
(boards/esp/src/can.rs:127). Addbitrateto[[hardware.esp.can_buses]]
(MCP2515 already hascan_speed). The vehicle crate (or meta.toml) should
declare the expected bitrate per bus so xtask can check it. - CAN-FD buses. Several E-GMP buses are CAN-FD. The TWAI isn't FD-tolerant:
in listen-only it only sees errors, but in Normal mode it will error-frame
every FD frame. Refuse to leave read-only on a bus declared FD, or document it. - Expose bus health (the new RX stats: errors, overruns, bus-offs) in system
state so the app can show it, not just on the serial log. - Dev control of read-only mode: when added, BLE + debug builds only,
never MQTT.
- Dominant language
- Rust
- Stars
- 1
- Forks
- 0
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenCarControls/firmware
-
Refresh stale docsOpen
Difficulty 1/5 1-3 hours Newbie friendliness 67/100
OpenCarControls/firmware#35 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
OpenCarControls/firmware#34 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OpenCarControls/firmware#31 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
OpenCarControls/firmware#30 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
OpenCarControls/firmware#57 ·
Maintainers usually reply within 1 day
All issues in OpenCarControls/firmware
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
project-robius/robrix#1177 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ClickHouse/clickhouse-rs#497 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
area:breg bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
registrystack/registry-stack#2307 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
farion1231/cc-switch#8696 · 1 comment ·
Maintainers usually reply within 1 day