There are tutorials all over the internet about how to enable i2c on Rasbian using raspi-config, but I'd like to work with Alpine Linux. How do the i2c devices/drivers/kernel modules work and how can I interface with them using Python/C++?

closed as too broad by joan, Aurora0001, Ingo, Steve Robillard, Milliways Sep 2 '18 at 8:09

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Comments are not for extended discussion; this conversation has been moved to chat. ... and as a clarification in response to the comment flag (which another mod may handle): discussing which features of StackExchange and its culture you like or dislike is not furthering this particular question. Feel free to take those issues to chat or meta. – Ghanima Aug 30 '18 at 19:00

Put dtparam=i2c_arm=on into /boot/config.txt. That enables the I²C port access from the CPU. The host adapter driver module is loaded automagically.

For all else you can consult any general Linux I²C programming tutorial.

(You may need to load the i2c-dev module by hand and add UDEV rules to get /dev/i2c-nnn device nodes. This depends on the distribution. You need those for user space access to the I²C buses.)

  • Would you happen to know any good resources describing what you mean about how to load the i2c-dev module, UDEV rules, and device nodes? Thanks for your help! – tmar Aug 29 '18 at 21:09
  • First, please check if Alpine Linux does this already for you. – Janka Aug 29 '18 at 21:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.