mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-06-02 00:06:49 +00:00
1.6 KiB
1.6 KiB
title, description
title | description |
---|---|
Enable I2C on the Home Assistant Operating System | Instructions on how to enable I2C on a Raspberry Pi |
Home Assistant using the Home Assistant Operating System is a managed environment, which means you can't use existing methods to enable the I2C bus on a Raspberry Pi.
Step by step instructions
You will need:
- SD card reader
- SD card with Home Assistant Operating System flashed on it
Step 1 - Access the Home Assistant OS boot partition
Shutdown/turn-off your Home Assistant installation and unplug the SD card.
Plug the SD card into an SD card reader and find a drive/file system named
hassos-boot
. The file system might be shown/mounted automatically. If not,
use your operating systems disk management utility to find the SD card reader
and make sure the first partition is available.
Step 2 - Add files to enable I2C
- In the root of the
hassos-boot
partition, add a new folder calledCONFIG
. - In the
CONFIG
folder, add another new folder calledmodules
. - Inside the
modules
folder add a text file calledrpi-i2c.conf
with the following content:i2c-dev
- In the root of the
hassos-boot
partition, edit the file calledconfig.txt
add two lines to it:dtparam=i2c_vc=on dtparam=i2c_arm=on
Step 3 - Start with the new configuration
- Insert the SD card back into your Raspberry Pi.
- On startup, the
hassos-config.service
will automatically pickup the newrpi-i2c.conf
configuration. - Another reboot might be necessary to make sure the just imported
rpi-i2c.conf
is present at boot time.
The I2C devices should now be present under /dev.