Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add CAN bus safety

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

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

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). Add bitrate to [[hardware.esp.can_buses]]
    (MCP2515 already has can_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

Open in Codespaces

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenCarControls/firmware

All issues in OpenCarControls/firmware

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.