Posts: 1
Joined: Tue Aug 27, 2019 8:07 pm

I2C doesn't stay active after reboot

Tue Aug 27, 2019 8:41 pm

I've seen this topic mentioned a couple times with no clear solution that applies to me. ... p?t=197953 (weird user thing doesn't apply; I'm using all the standard settings, pi 3B+ fresh out of the box, NOOBS downloaded just hours ago running Raspbian) ... p?t=220682 (sounds similar, but the user stopped updating)

I'm using the CoDeSys runtime PLC programming software to access an Adafruit PWM module and a gyroscope sensor over I2C (trying to build a little self-balancing robot).
At least, I'd like to be. It seems like the pi's I2C device is only available the first time I activate it (I've been using the Raspberry Desktop GUI "Raspberry Pi Configuration" panel with all the little radio buttons). The first time I go from disable to enable, it works- I can use "sudo i2cdetect -y 1" and see the connected devices.
The next time I reboot, if I try another i2cdetect, I get "Error: Could not open file '/dev/i2c-1': No such device"
When I open the panel back up, I2C is still enabled. When I click the "disable" button, the GUI freezes, and I have to physically pull the plug to get it to reboot (I can do a "sudo reboot now" from a command line, but then it just freezes at a black screen).

However, when it's done booting up the second time and I open the configurator panel back up, I2C is now disabled. I click "enable," the panel disappears, and now when i run i2cdetect it shows me my modules. But the next time I reboot or power down, it's back to square one.

Every tutorial out there about I2C seems to think that turning it on like that is all you should have to do to activate it (in a previous iteration, I went through all the exact same steps, but used the command-line configurator instead, before I apparently fried my SD card after unexpectedly cycling power too many times and had to get a new one).

I've checked the /boot/config.txt and verified that "dtparam=i2c_arm=on" is in there and "i2c-dev" is listed in /etc/modules (and don't go away after the reboot).
In older tutorials, people mentioned adding "dtparam=i2c1=on" to the config.txt file; didn't help me at all when I tried it.
Another one mentioned in the older tutorials was adding "i2c-bcm2708" to the modules list; that didn't help either.

I don't know what I could possibly be doing different from everyone else that's all "oh, just click the button and turn it on!" but I've spent the better part of the last 8 hours working on this and getting nowhere. Any advice?

Posts: 73
Joined: Sat Mar 23, 2013 5:21 am

Re: I2C doesn't stay active after reboot

Sat Sep 14, 2019 6:28 pm

I think you need to wait for the release of -> 19th September is the release date.

Return to “Troubleshooting”