05-28-2021, 02:39 AM
(This post was last modified: 05-28-2021, 02:46 AM by Tim Curtis.
Edit Reason: eta
)
(05-23-2021, 07:12 AM)adrii Wrote: Hi Tim
I was looking some more at how to enable I2C on Moode 7.2.1.
'/boot/config.txt' contains a line
Code:dtparam=i2c_arm=on
It seems that this line is supposed to create the device entry /dev/i2c-1 and, also, is the recommended method to do so on Raspberry Pi OS.
Running Moode on a PI Zero this line doesn't create the entry. Similarly, running
Code:sudo dtparam i2c_arm=on
does not set up the entry. However, I just logged into a Pi 4 running Raspberry Pi OS and without I2C enabled and ran that command and the device entry was created.
On Moode I have been giving instructions to enable I2C by including 'i2c-dev' in '/etc/modules', which does create the device entry, but appears to be discouraged on Raspberry Pi OS, and the '/etc/modules' file gets reset by Moode upgrades. I notice that the Moode code includes a 'modprobe i2c-dev', but I don't know if this is old code or is used because the dtparam method does not (always?) work on Moode.
Adrian.
1. The line "dtparam=i2c_arm=on" has been in the config for years and I don't think its loading i2c_dev module. Check lsmod output for the presence of i2c_dev module.
2. /etc/modules was only overwritten in the 710 to 720 update
3. i2c-dev is loaded during moode startup (worker.php) via "modprobe i2c-dev" if ALSA loopback is ON in Audio Config. It shows up in lsmod output as i2c_dev module.
-Tim