Skip to content

Commit b457b75

Browse files
authored
Raspihats platform update, added smbus, i2c install
1 parent b44641b commit b457b75

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

source/_components/binary_sensor.raspihats.markdown

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,47 @@ Configuration variables:
4444
- **invert_logic** (*Optional*): Inverts the input logic, default is `false`.
4545
- **device_class** (*Optional*): See device classes in [binary_sensor component](/components/binary_sensor/), default is `None`
4646

47+
## {% linkable_title Directions for installing smbus support on Raspberry Pi %}
48+
49+
Enable I2c interface with the Raspberry Pi configuration utility:
50+
51+
```bash
52+
# pi user environment: Enable i2c interface
53+
$ sudo raspi-config
54+
```
55+
56+
Select `Interfacing options->I2C` choose `<Yes>` and hit `Enter`, then go to `Finish`.
57+
58+
Install dependencies for use the `smbus-cffi` module and enable your _homeassistant_ user to join the _i2c_ group:
59+
60+
```bash
61+
# pi user environment: Install i2c dependencies and utilities
62+
$ sudo apt-get install build-essential libi2c-dev i2c-tools python-dev libffi-dev
63+
64+
# pi user environment: Add homeassistant user to the i2c group
65+
$ sudo usermod -a -G i2c homeassistant
66+
```
67+
68+
### {% linkable_title Check the i2c address of the sensor %}
69+
70+
After installing `i2c-tools`, a new utility is available to scan the addresses of the connected sensors, so you can see the sensor address:
71+
72+
```bash
73+
$ /usr/sbin/i2cdetect -y 1
74+
```
75+
76+
It will output a table like this:
77+
78+
```text
79+
0 1 2 3 4 5 6 7 8 9 a b c d e f
80+
00: -- -- -- -- -- -- -- -- -- -- -- -- --
81+
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
82+
20: -- -- -- 23 -- -- -- -- -- -- -- -- -- -- -- --
83+
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
84+
40: 40 -- -- -- -- -- UU -- -- -- -- -- -- -- -- --
85+
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
86+
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
87+
70: -- -- -- -- -- -- -- 77
88+
```
89+
4790
For more details about the `raspihats` add-on boards for Raspberry PI, visit [raspihats.com](http://www.raspihats.com/).

0 commit comments

Comments
 (0)