I want to enable the I2C interface, but without having to boot, login, and the whole
I tried editing /boot/config.txt right after
sudo dd the image to the disk, still in my main computer, and uncommented the
Now, everytime I reboot, it's like the interface is disabled. The line is still uncommented, and
i2c-dev is the only thing in the /etc/modules file. Now everytime I reboot, I have to do
sudo raspi-config all over again to make it work.
Is it something about permissions? I don't know where to look for problems here.
Edit as requested:
I wrote aversion of the INA219 library in C++, INA uses i2c.
This is how you can try it:
git clone http://github.com/regisin/pi_ina219cpp
The library works fine if I use the
sudo raspi-config (not even trying the manual part), and ev en when rebooting it continues to work.
However, when I tried to edit the
/boot/config.txt file, it only works if I do a
sudo modprobe i2c-dev manually, after the boot.
If you read the previous section you noticed I used modprobe. I looked into the
/usr/bin/raspi-config file, and noticed that the i2c function does a few commands:
1 - uncomment or add
dtparam=i2c_arm=on line to
2 - insert
i2c-dev to the
What puzzles me is that after editing /boot/config.txt directly in the sd card from another machine, raspi-config does not work as expected. It's like some configuration is resetting at boot time. I guess I could work around this by doing modprobe when booting, but it does not sound like that's the intended behavior.