Skip to content

Docs on I2C on the Raspberry Pi are outdated #2716

Open
@lmbarros

Description

@lmbarros

Our docs that explain how to use I2C with the Raspberry Pi family are outdated: they still assume a single container app, while we have been recommending multi-container apps for some time now. The example project we link to is also very old.

(Our docs on multiple containers give some hints on the right way to go, but don't spell out the solution clearly enough either.)

I am not completely sure what a modern I2C example would look like, but here's what I can see for now:

# docker-compose.yml
version: "2"

services:
  my-service:
    # ...
    devices:
      - "/dev/i2c-1:/dev/i2c-1"
      # - "/dev/mem:/dev/mem" # <--- not sure if needed, I don't think so
    cap_add:
      - SYS_RAWIO # <--- not sure if this us the right capability to add. Alternatively, using `privileged: true` should work.)
    labels:
      io.balena.features.kernel-modules: '1'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions