I want to enable the I2C interface, but without having to boot, login, and the whole sudo raspi-config
.
I tried editing /boot/config.txt right after sudo dd
the image to the disk, still in my main computer, and uncommented the dtparam=i2c_arm=on
line.
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
make
./build/profiler
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.
Edit 2:
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 /boot/config.txt
2 - insert i2c-dev
to the /etc/modules
3 - dtparam i2c_arm=on
4 - modprobe i2c-dev
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.
but without having to boot
... i think that you have to run some sort of sofware ... you have to boot the RPi .... make your question clearer as to what you are actually asking