Cannot Enable I2C on Raspberry Pi 4 with DietPi

Creating a bug report/issue

:white_check_mark: I have searched the existing open and closed issues

Required Information

  • DietPi version
  G_DIETPI_VERSION_CORE=9
  G_DIETPI_VERSION_SUB=17
  G_DIETPI_VERSION_RC=2
  G_GITBRANCH=‘master’
  G_GITOWNER=‘MichaIng’
  • Distro version
    bookworm 0

  • Kernel version
    Linux 6.12.47+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.47-1+rpt1\~bookworm (2025-09-16) aarch64 GNU/Linux

  • Architecture
    arm64

  • SBC model
    RaspberryPi 4B

  • Power supply used

    Original RPi 5V 3A

  • SD card used
    system boots off m2 ssd via ArgonONE m2 case

Steps to reproduce

1. Enable the I2C interface using the dietpi-config utility, which shows I2C state : [On].

2. Verify that /boot/config.txt contains dtparam=i2c_arm=on

3. Reboot the system.

Expected behaviour

The I2C bus should be enabled, and the device file /dev/i2c-1 should be created.

Actual behaviour

The /dev/i2c-1 device file is never created.

Extra details

Kernel Module is Loaded: The i2c_dev module is successfully loaded at boot.

1 $ lsmod | grep i2c_dev

2 i2c_dev 16384 0

Device File is Missing: The kernel is not creating any I2C device nodes.

1 $ ls -l /dev/i2c*

2 ls: cannot access ‘/dev/i2c*’: No such file or directory

Kernel Log is Missing Hardware Info: The dmesg log shows the i2c_dev driver loading

1 $ dmesg | grep i2c

2 \[ 2.011406\] i2c_dev: i2c /dev entries driver

In truth I do not understand whether this is a software or a hardware issue and all input is appreciated.

Encountered this while installing https://gitlab.com/DarkElvenAngel/argononed/-/tree/master , but I believe the installed software did not modify this behavior

The orignal PSU has 3A, not just 1. The older official ones hat 2,5A though. So maybe it’s a powering issue. Not enough Amperes and then you also have the m.2 case, which draws power via USB :thinking:
Can you check dmseg for errors:

dmesg -l crit alert emerg err warn

Can you also show

ls -l /boot
cat /boot/config.txt
cat /boot/firmware/config.txt

Hi

Sorry, 1A is a typo, the PSU is 5V 3A

Will send the command outputs in ~3 hours

$ dmesg -l crit,alert,emerg,err,warn

Output
[0.446193] pci_bus 0000:01: **supply vpcie3v3 not found, using dummy regulator**
[0.446249] pci_bus 0000:01: **supply vpcie3v3aux not found, using dummy regulator**
[0.446272] pci_bus 0000:01: **supply vpcie12v not found, using dummy regulator**
[0.555098] bcm2708_fb soc:fb: Unable to determine number of FBs. Disabling driver.
[0.555109] bcm2708_fb soc:fb: probe with driver bcm2708_fb failed with error -2
[2.675141] hci_uart_bcm serial0-0: **supply vbat not found, using dummy regulator**
[2.675427] hci_uart_bcm serial0-0: **supply vddio not found, using dummy regulator**
[3.037498] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
[3.037514] Bluetooth: hci0: BCM: ‘brcm/BCM4345C0.raspberrypi,4-model-b.hcd’
[3.037520] Bluetooth: hci0: BCM: ‘brcm/BCM4345C0.hcd’
[3.037526] Bluetooth: hci0: BCM: ‘brcm/BCM.raspberrypi,4-model-b.hcd’
[3.037531] Bluetooth: hci0: BCM: ‘brcm/BCM.hcd’
[14.315005] systemd[1]: **binfmt-support.service: Cannot add dependency job, ignoring: Unit binfmt-support.service is masked.**
[14.358674] systemd[1]: Failed to start Load Kernel Modules.
[14.358970] systemd[1]: **systemd-modules-load.service: Failed with result ‘exit-code’.**
[250.270147] hrtimer: **interrupt took 14407 ns**

$ ls -l /boot

Output
total 10060
-rw-r–r-- 1 root root      83 Sep 16 17:31 System.map-6.12.47+rpt-rpi-v8
lrwxrwxrwx 1 root root      20 May 27 05:09 **cmdline.txt** → **firmware/cmdline.txt**
-rw-r–r-- 1 root root  248948 Sep 16 17:31 config-6.12.47+rpt-rpi-v8
-rwxr-xr-x 1 root root    3031 Sep 24 20:28 **config.txt**
-rwxr-xr-x 1 root root    3008 Sep 24 01:58 **config.txt.backup**
drwxr-xr-x 4 root root    4096 Sep 24 02:53 **dietpi**
-rw-r–r-- 1 root root   18092 May 27 01:44 dietpi-LICENSE.txt
-rw-r–r-- 1 root root   16310 May 27 01:44 dietpi-README.md
-rw------- 1 root root    3950 May 27 05:11 dietpi-wifi.txt
-rw-r–r-- 1 root root   18354 Sep 21 15:47 dietpi.txt
drwxr-xr-x 5 root root    4096 Jan  1  1970 **firmware**
-rw-r–r-- 1 root root 9968290 Sep 16 17:31 vmlinuz-6.12.47+rpt-rpi-v8

$ cat /boot/config.txt

Output
#-------Display---------
# Max allocated framebuffers: Set to “0” in headless mode to reduce memory usage
# - Defaults to “2” on RPi4 and “1” on earlier RPi models
#max_framebuffers=0
# If you get no picture, set the following to “1” to apply most compatible HDMI settings.
#hdmi_safe=1
# Uncomment to adjust the HDMI signal strength if you have interferences, blanking, or no display.
# - Ranges from “0” to “11”, use values above “7” only if required, e.g. with very long HDMI cable.
# - Default on first RPi1 A/B is “2”, else “5”, on RPi4 this setting is ignored.
#config_hdmi_boost=5
# Uncomment if HDMI display is not detected and composite is being outputted.
#hdmi_force_hotplug=1
# Uncomment to disable HDMI even if plugged, e.g. to force composite output.
#hdmi_ignore_hotplug=1
# Uncomment to force a console size. By default it will be display’s size minus overscan.
#framebuffer_width=1280
#framebuffer_height=720
# Uncomment to enable SDTV/composite output on RPi4. This has no effect on previous RPi models.
#enable_tvout=1
# SDTV mode
#sdtv_mode=0
# Uncomment to force a specific HDMI mode (this will force VGA).
#hdmi_group=1
#hdmi_mode=1
# Uncomment to force an HDMI mode rather than DVI. This enables HDMI audio in DMT modes.
#hdmi_drive=2
# Set “hdmi_blanking=1” to allow the display going into standby after 10 minutes without input.
# With default value “0”, the display shows a blank screen instead, but will not go into standby.
# NB: Some legacy OpenMAX applications (OMXPlayer) cannot wake screens from real standby.
hdmi_blanking=1
# Set to “1” if your display has a black border of unused pixels visible.
disable_overscan=1
# Uncomment the following to adjust overscan.
# Use positive numbers if console goes off screen, and negative if there is too much border.
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# Rotation
#display_hdmi_rotate=0
#lcd_rotate=0
#-------RPi camera module-------
#start_x=1
#disable_camera_led=1
#-------GPU memory splits-------
gpu_mem_256=16
gpu_mem_512=16
gpu_mem_1024=16
#-------Boot splash screen------
disable_splash=1
#-------Onboard sound-----------
dtparam=audio=off
#-------I2C-------------
dtparam=i2c_arm=on
#dtparam=i2c_arm_baudrate=100000
dtoverlay=argonone
#-------SPI-------------
dtparam=spi=off
#-------Serial/UART-----
# NB: “enable_uart=1” will enforce “core_freq=250” on RPi models with onboard WiFi.
enable_uart=1
#-------SD card HPD-----
# Comment to enable SD card hot-plug detection, while booting via USB or network.
# NB: This causes constant CPU load and kernel errors when no SD card is inserted.
dtparam=sd_poll_once
#-------Overclock-------
temp_limit=75
initial_turbo=20
over_voltage=2
arm_freq=1800
core_freq=500
#over_voltage_min=0
#arm_freq_min=300
#core_freq_min=250
#sdram_freq_min=400
arm_64bit=1
dtoverlay=disable-wifi
[pi4]

$ cat /boot/firmware/config.txt

Output
#-------Display---------
# Max allocated framebuffers: Set to “0” in headless mode to reduce memory usage
# - Defaults to “2” on RPi4 and “1” on earlier RPi models
#max_framebuffers=0
# If you get no picture, set the following to “1” to apply most compatible HDMI settings.
#hdmi_safe=1
# Uncomment to adjust the HDMI signal strength if you have interferences, blanking, or no display.
# - Ranges from “0” to “11”, use values above “7” only if required, e.g. with very long HDMI cable.
# - Default on first RPi1 A/B is “2”, else “5”, on RPi4 this setting is ignored.
#config_hdmi_boost=5
# Uncomment if HDMI display is not detected and composite is being outputted.
#hdmi_force_hotplug=1
# Uncomment to disable HDMI even if plugged, e.g. to force composite output.
#hdmi_ignore_hotplug=1
# Uncomment to force a console size. By default it will be display’s size minus overscan.
#framebuffer_width=1280
#framebuffer_height=720
# Uncomment to enable SDTV/composite output on RPi4. This has no effect on previous RPi models.
#enable_tvout=1
# SDTV mode
#sdtv_mode=0
# Uncomment to force a specific HDMI mode (this will force VGA).
#hdmi_group=1
#hdmi_mode=1
# Uncomment to force an HDMI mode rather than DVI. This enables HDMI audio in DMT modes.
#hdmi_drive=2
# Set “hdmi_blanking=1” to allow the display going into standby after 10 minutes without input.
# With default value “0”, the display shows a blank screen instead, but will not go into standby.
# NB: Some legacy OpenMAX applications (OMXPlayer) cannot wake screens from real standby.
hdmi_blanking=1
# Set to “1” if your display has a black border of unused pixels visible.
disable_overscan=1
# Uncomment the following to adjust overscan.
# Use positive numbers if console goes off screen, and negative if there is too much border.
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# Rotation
#display_hdmi_rotate=0
#lcd_rotate=0
#-------RPi camera module-------
#start_x=1
#disable_camera_led=1
#-------GPU memory splits-------
gpu_mem_256=16
gpu_mem_512=16
gpu_mem_1024=16
#-------Boot splash screen------
disable_splash=1
#-------Onboard sound-----------
dtparam=audio=off
#-------I2C-------------
#dtparam=i2c_arm=on
#dtparam=i2c_arm_baudrate=100000
#-------SPI-------------
#dtparam=spi=off
#-------Serial/UART-----
# NB: “enable_uart=1” will enforce “core_freq=250” on RPi models with onboard WiFi.
enable_uart=1
#-------SD card HPD-----
# Comment to enable SD card hot-plug detection, while booting via USB or network.
# NB: This causes constant CPU load and kernel errors when no SD card is inserted.
dtparam=sd_poll_once
#-------Overclock-------
temp_limit=75
initial_turbo=20
over_voltage=4
arm_freq=1900
core_freq=600
#over_voltage_min=0
#arm_freq_min=300
#core_freq_min=250
#sdram_freq_min=400
arm_64bit=1
dtoverlay=disable-wifi
[pi4]
dtoverlay=argonone

Thanks!

TLDR;
The symlink for config.txt is missing,

Alright,
so you activated it with dietpi-config, which writes to /boot/config.txt.
You also checked, that this change was made.
But since a few months or so RPi foundation changed something about firmware and file structure, so now the config is in /boot/firmware/config.txt.
Normally on DietPi there is now a symlink from /boot/config.txt to /boot/firmware/config.txt, but this symlink is missing on your system.
Altough there is a symlink for the cmdline.txt.

Did you ever touch the config.txt and perhapbs you removed the symlink?

For the sake of testing you could do a reboot and check if the symlink is now there. If not we can set it manually.

@MichaIng do you have an idea what could’ve gone wrong here?

Oh and this message is also concerning:

You can check the log for this with:

sudo journalctl -u systemd-modules-load

Thanks for your reply! No, I did not edit any config.txt before getting the error from the argonone software.

I did manually edit /boot/config.txt when troubleshooting. I tried to move the options above the [pi4] filter, manually commented/uncommented the dtoverlay=argonone and I think I also commented the dtoverlay=disable-wifi

I should also mention that I tried to install Argon’s original software before (which is reportedly really badly coded)

https://download.argon40.com/argon1.sh

Ok whatever happend, we will fix it now.
Do:

ln -sf /boot/firmware/config.txt /boot/config.txt

Then you edit that file /boot/firmware/config.txt, and uncomment the lines (remove the #):
#dtparam=i2c_arm=on
and
#dtparam=spi=off

Save it and reboot

1 Like

Thank you so much! DietPi is wonderful

1 Like

If there is a [pi4] inside, then it is likely not our config.txt in the first place, which does not contain such filters.

My other guess was that the Argon script broke it, but at least the current version check for /boot/firmware/config.txt and in case edits that one, correctly. But that script loads a number of other scripts which I won’t check through now :sweat_smile:. Or it was an old version of the script.

Generally, sed -i nastily replaces symlink with their files, as long as not --follow-symlink is used as well. And it would create this backup when using sed -i.backup (defining this suffix). On first such sed, the backup would remain the symlink, while here it is a regular file as well. But when doing it twice, the backup would be overwritten with the original regular file. This is why all sed -i calls in our scripts contain --follow-symlink. I anyway cannot imagine any case where one would want to have a symlink replaced with its edited target file, instead of editing the target file and leaving the symlink untouched.

1 Like