I2C Multiple adapter confusion

Hey

I have not been able to reproduce this. This is the output from a privileged container

root@12fb630:/usr/src/app# i2cdetect -l
i2c-1   i2c             bcm2835 (i2c@7e804000)                  I2C adapter
root@12fb630:/usr/src/app# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- 4c -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Could this be because you are running modprobe i2c-dev during the docker image build phase?

I was able to use i2c-detect without modprobe i2c-dev. If you want to run it at runtime, you should also install kmod since balenalib/rpi-raspbian base image doesn’t ship the modprobe command.

You can also simplify your dockerfile as follows:

FROM balenalib/rpi-raspbian

RUN install_packages i2c-tools 
...

You can read more about the install_packages utility here https://www.balena.io/docs/reference/base-images/base-images/#installing-packages