I2c on Raspberry Pi

Hi,

I’m using i2c in my application and on both Pi 1 and Pi 2 I have similar problem - i2c is not available after device boot. I have modprobe i2c-dev in my docker file though. i2c becomes available only if I restart application manually through resin dashboard. This happens after every device reboot. How can I fix that?
SPI and GPIO are working great at the same time.

Hi,
I will try to reproduce this behavior as I am not aware of such a bug. I will be back as soon as possible with some conclusions.
Best regards,
Theodor

Hello again,
I am just writing to let you know that we have not forgotten about this issue. I had an intense couple of weeks, but this is still an active issue. Hope this delay is not affecting your work too much.
Regards,
Theodor

Well, it does a bit in a sense that I can’t deploy devices to the field :smile:

Hi,

I have finally managed to get around and try this out, I am sorry for taking so long. I do not seem to encounter the same problem as you do. Could you please tell what base image you are using for your container? (i.e. what is value of FROM in your Dockerfile)

Best regards,
Theodor

FROM resin/rpi-raspbian:jessie

There you go that is the problem. Rpi-raspbian is a minimalistic base image that includes pretty much nothing. In your case case you would need udev (from inside systemd) to create your i2c-dev links. I suggest you try a base image like this: resin/raspberrypi-node, this should have everything you need for general purposes.
You can find a full list of our base-images and what they include here: http://docs.resin.io/#/pages/runtime/resin-base-images.md
Let us know if it works out.

Best regards,
Theodor

1 Like

Thanks, this fixed the problem!