Open cserl opened 9 months ago
Sorry for missing your issue. Please try the following:
current_overlays=$(sed -n '/^[[:blank:]]*overlays=/{s/^[^=]*=//p;q}' /boot/dietpiEnv.txt)
[[ $current_overlays =~ (^|[[:blank:]])i2c1([[:blank:]]|$) ]] || G_CONFIG_INJECT 'overlays=' "overlays=${current_overlays:+$current_overlays }i2c1" /boot/dietpiEnv.txt
The code checks whether the overlay has been added already, and does so if not. This is how I would add a dietpi-config
option. In essence, you can just add i2c1
to the end of the overlays=
line in /boot/dietpiEnv.txt
and reboot. Let me know whether this works.
Creating a bug report/issue
Required Information
cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=9 G_DIETPI_VERSION_SUB=1 G_DIETPI_VERSION_RC=1 G_GITBRANCH='master' G_GITOWNER='MichaIng' G_LIVE_PATCH_STATUS[0]='not applicable' (The problem is existing since dietpi v6.28 for all versions. Before v6.28 it did work well.)echo $G_DISTRO_NAME $G_RASPBIAN
bullseyeuname -a
Linux DietPi 6.1.63-current-rockchip #1 SMP PREEMPT Mon Nov 20 10:52:19 UTC 2023 armv7l GNU/Linux
echo $G_HW_MODEL_NAME
or (EG: RPi3) ASUS Tinker Board (armv7l) (HW version: Tinker Board released in April 2017 2GB model, see https://en.wikipedia.org/wiki/Asus_Tinker_Board)Additional Information (if applicable)
echo $G_HW_UUID
43e97bfe-1677-4705-b68a-4f07b545b076Steps to reproduce after a fresh install
Expected behaviour
0 1 2 3 4 5 6 7 8 9 a b c d e f 10: -- -- -- -- -- -- -- 0f 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- uu -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
Actual behaviour
Error: Could not open file
/dev/i2c-1' or
/dev/i2c/1': No such file or directoryThe command runs as expected, not displaying any error message, when using these parameters: i2cdetect -y 0 i2cdetect -y 2
ls -l /dev/i2c* crw-rw---- 1 root i2c 89, 0 Mar 1 02:17 /dev/i2c-0 crw-rw---- 1 root i2c 89, 2 Mar 1 02:17 /dev/i2c-2 crw-rw---- 1 root i2c 89, 5 Mar 1 02:17 /dev/i2c-5
find /proc/device-tree/ -type d -name 'i2c' -exec ls -l {}/status \; -exec cat {}/status \; -exec echo \; 2> /dev/null -r--r--r-- 1 root root 5 Mar 1 12:01 /proc/device-tree/i2c@ff660000/status okay -r--r--r-- 1 root root 5 Mar 1 12:01 /proc/device-tree/i2c@ff170000/status okay -r--r--r-- 1 root root 9 Mar 1 12:01 /proc/device-tree/i2c@ff140000/status disabled -r--r--r-- 1 root root 9 Mar 1 12:01 /proc/device-tree/i2c@ff150000/status disabled -r--r--r-- 1 root root 5 Mar 1 12:01 /proc/device-tree/i2c@ff650000/status okay -r--r--r-- 1 root root 9 Mar 1 12:01 /proc/device-tree/i2c@ff160000/status disabled
Content of /boot/dietpiEnv.txt:
Extra details
A "S.USV Tinker" hat is connected to the Tinkerboard. For the power supply and data transmission of the "S.USV Tinker" hat the following pins are in use:
See Also https://github.com/MichaIng/DietPi/issues/5362 and https://dietpi.com/forum/t/dietpi-for-asus-thinker-board-i2c/16168
Please provide clear step by step instructions for workaround and support fixing. I am not familiar with the overlay concept, I found this link for rpi, but do not know if it is related or how to solve the issue: firmware/boot/overlays/README
I wish an I2C configuration menu under dietpi-config > Advanced Options.
I did a cross-test with a different SD card installing a fresh Tinker_Board-Debian-Stretch-v2.2.9-20210624.img on it. After fresh install issue seems to be the same: But after changing the below 2 lines in /boot/config.txt it started working under Debian Stretch. Changes: before: overlay= after: overlay=i2c-gpio The line "intf:i2c1=off" was uncommented and changed to "intf:i2c1=on"
How to achieve the same on DietPI?