# DietPi i2c problem

**URL:** <https://dietpi.com/forum/t/dietpi-i2c-problem/66>\
**Category:** General Discussion\
**Created:** [8 September 2015 14:18 UTC](https://dietpi.com/forum/t/dietpi-i2c-problem/66 "2015-09-08T14:18:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aidan\_Hedley](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@Aidan\_Hedley](https://dietpi.com/forum/u/Aidan_Hedley)\
**Post date:** [8 September 2015 14:18 UTC](https://dietpi.com/forum/t/dietpi-i2c-problem/66/1 "2015-09-08T14:18:02Z")

</div>

Great little distro and super for my headless controller application.

I am trying to install a real time clock - , but after installing i2c-tools I am getting the following:  
when i2cdetect used:

> could not open /dev/i2c-0

I had the same issue with Raspian Wheezy and had to use raspi-config to enable i2c kernel hardware  
There must be a file to configure , but I cannot find it, can anyone advise please?

---

<div class="post-metadata">

**Author:** ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)\
**Post date:** [8 September 2015 17:48 UTC](https://dietpi.com/forum/t/dietpi-i2c-problem/66/2 "2015-09-08T17:48:12Z")

</div>

> [@Aidan Hedley](#):
>
> Great little distro and super for my headless controller application.
> 
> I am trying to install a real time clock - , but after installing i2c-tools I am getting the following:  
> when i2cdetect used:
> 
> > could not open /dev/i2c-0
> 
> I had the same issue with Raspian Wheezy and had to use raspi-config to enable i2c kernel hardware  
> There must be a file to configure , but I cannot find it, can anyone advise please?

Hi Aidan,

I’ll have to look into this further. But in the mean time, you can still use raspi-config with DietPi to enable i2c:

**Reinstall Raspi-Config:**

```plaintext
apt-get install raspi-config -y

```

**Launch:**

```plaintext
raspi-config

```

I believe its under advanced \> A7 I2C

**Edit:**  
Turns out you can just add this to your /DietPi/config.txt  
dtparam=i2c\_arm=on  
Reference

Kind Regards,  
Dan

---

<div class="post-metadata">

**Author:** ![Aidan\_Hedley](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@Aidan\_Hedley](https://dietpi.com/forum/u/Aidan_Hedley)\
**Post date:** [9 September 2015 06:47 UTC](https://dietpi.com/forum/t/dietpi-i2c-problem/66/3 "2015-09-09T06:47:58Z")

</div>

AOK Thanks for the link to the config command.  
I had tried Raspi-Config. reported errors and did not work.
