From 08fad39c0c32201d36b8c442af708ba76ae15b59 Mon Sep 17 00:00:00 2001 From: ctborg Date: Wed, 27 Feb 2019 04:17:03 -0500 Subject: [PATCH] Adds docs for enabling I2C on Hass.io (#8144) * Create enable_i2c.markdown * Update sensor.bme680.markdown * Update hassio_navigation.html * :pencil2: Tweaks * :pencil2: Tweaks --- source/_components/sensor.bme680.markdown | 5 +- .../_includes/asides/hassio_navigation.html | 1 + source/hassio/enable_i2c.markdown | 51 +++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 source/hassio/enable_i2c.markdown diff --git a/source/_components/sensor.bme680.markdown b/source/_components/sensor.bme680.markdown index 2294195bc1b..7ae238d268e 100644 --- a/source/_components/sensor.bme680.markdown +++ b/source/_components/sensor.bme680.markdown @@ -13,7 +13,6 @@ ha_release: 0.62 ha_iot_class: "Local Push" --- - The `bme680` sensor platform allows you to read temperature, humidity, pressure and gas resistance values of a [Bosch BME680 Environmental sensor](https://cdn-shop.adafruit.com/product-files/3660/BME680.pdf) connected via an [I2C](https://en.wikipedia.org/wiki/I²C) bus (SDA, SCL pins). It allows you to use all the operation modes of the sensor described in its datasheet. In addition, it includes a basic air quality calculation that uses gas resistance and humidity measurements to calculate a percentage based air quality measurement. Tested devices: @@ -186,6 +185,10 @@ group: - sensor.bme680_sensor_air_quality ``` +## {% linkable_title Directions for enabling I2C interface on Hass.io %} + +Follow the instructions here to [enable I2C on Hass.io.](/hassio/enable_i2c/). + ## {% linkable_title Directions for installing SMBus support on Raspberry Pi %} Enable I2C interface with the Raspberry Pi configuration utility: diff --git a/source/_includes/asides/hassio_navigation.html b/source/_includes/asides/hassio_navigation.html index 6c42ff0ca6d..f8e6a3debeb 100644 --- a/source/_includes/asides/hassio_navigation.html +++ b/source/_includes/asides/hassio_navigation.html @@ -19,6 +19,7 @@
  • {% active_link /hassio/zwave/ Z-Wave %}
  • {% active_link /hassio/external_storage/ External storage %}
  • {% active_link /hassio/run_local/ Execute local things %}
  • +
  • {% active_link /hassio/enable_i2c/ Enable I2C %}
  • diff --git a/source/hassio/enable_i2c.markdown b/source/hassio/enable_i2c.markdown new file mode 100644 index 00000000000..edafad0941d --- /dev/null +++ b/source/hassio/enable_i2c.markdown @@ -0,0 +1,51 @@ +--- +layout: page +title: "Enable HassOS i2c" +description: "Instructions on how to enable I2C on a Raspberry PI for Hass.io." +date: 2018-01-11 20:08 +sidebar: true +comments: false +sharing: true +footer: true +--- + +Hass.io is a managed environment, which means you can't use existing methods to enable the I2C bus on a Raspberry Pi. + +If you're attempting to add an external sensor, you will have to [enable the I2C interface in the Hass.io configuration](https://github.com/home-assistant/hassos/blob/dev/Documentation/boards/raspberrypi.md#i2c) using a USB stick. + +## {% linkable_title Step by step instructions %} + +You will need: + +- USB drive +- A way to add files to the USB drive +- A way to connect the drive to your Raspberry Pi + +### {% linkable_title Step 1 - Prepare the USB drive %} + +Connect the USB drive to a device capable of adding and editing files to the USB drive. + +Format a USB stick with FAT32/EXT4/NTFS and name the drive `CONFIG` (uppercase). + +### {% linkable_title Step 2 - Add files to enable I2C %} + +- In the root of the USB drive add a folder called `/modules`. +- Inside that folder add a text file called `rpi-i2c.conf` with the following contents: + ``` + i2c-bcm2708 + i2c-dev + ``` +- In the root of the USB drive add a file called `config.txt` with the following contents: + ``` + dtparam=i2c1=on + dtparam=i2c_arm=on + ``` + +### {% linkable_title Step 3 - Load the new USB config %} + +- Insert the USB drive into your Raspberry PI. +- Now go to your Home Assistant web interface, in the sidebar click **Hass.io** > **System**. +- Now click `Import from USB`. +- This will restart your Hass.io instance, and load the new USB configuration. + +When the service has restarted, you will have a working I2C interface.