Open Charlo26 opened 2 months ago
Hi, Could you start a terminal within the homeassistant container and list all i2c devices from there (you may have to run "apk add i2c-tools" first) ?
> i2cdetect -l
I guess that either the container has no access to the host i2C devices or that the device may not be the expected /dev/i2c-1. Cheers, jpc
Where you able to fix the issue ?
I have the same problem and get the messsage: Error: Unable to access mcp23017-0x32 ([Errno 2] No such file or directory: '/dev/i2c-1')
hello, try running the container with the i2c parameter ( " --device=/dev/i2c-1 \"). I have it like this without any problems
docker run -d \ --name homeassistant \ --privileged \ --restart unless-stopped \ -e TZ=Europe/Bratislava \ -v /home/pi/docker/home-assistant/config:/config \ -v /run/dbus:/run/dbus:ro \ --device=/dev/ttyUSB0 \ --device=/dev/i2c-1 \ --network host \ homeassistant-extended
Thanks for your comment; in order to expose i2c within a docker container, you should indeed either add it explicitly using a "--device" argument as suggested above or run in "--priviledged" mode (both are not required afaik).
If you are running on a raspberry, make sure to enable the i2c interface first (raspi-config -> Interfacing Options > I2C or by editing the /boot/config.txt directly).
Then check that /dev/i2c-1 is effectively available:
i2cdetect -l
command from the rpi shelldocker exec -it <container name> /bin/bash
(replace <container name>
by the name of the HA container) from the rpi shell to get a shell within the container, then apk add i2c-tools
(if i2c tools are not installed within the container) followed by i2cdetect -l
as well
Hello, i got an waveshare MCP2307 with 0x27 address.
I try to find it on my RPi 4, with Raspbian OS, when I use i2cdetect -y 1, I found it with 0x27 adress.
But, on my HomeAssistant Supervised installation, i'm unable to communicate with it.
i2c is correctly enabled.
when I restart HA i got :
Thank you