I2c and argonone case issues

I have 2 devices and 2 different configs :

Rpi4 with 4 Gb of RAM and an argonone case (using sd card)

Rpi4 with 8 Gb of RAM and an argonone M2 case (using ssd)

Both are on unstable manjaro branch : 5.10.14 kernel / Python 3.9.1

Argonone cases are supposed to monitor cpu temp to run a fan.

I have a /etc/argononed.conf file set with 3 pairs like min.temperature=speed
temperature (Celsius) and fan speed (in percent) according to the help included in the file

My cases don’t work well and I try to figure it out.

(Don’t know if it’s related but I had to change ttyAMA0 to serial0 on /boot/cmdline.txt recently because of the 100% cpu usage of patchram bug with the latest firmware.)

I’ve tried to use dtoverlay=vc4-kms-v3d instead of dtoverlay=vc4-fkms-v3d in /boot/config.txt and it all changed the /dev/i2c* devices ! I didn’t have i2c-1 anymore but i2c-11 and i2c-12 and they seem not related to what I wanted. If anyone can explain it…

I’ve switched back to dtoverlay=vc4-fkms-v3d and now I get i2c-1.

i2cdetect -l
i2c-1 i2c bcm2835 (i2c@7e804000) I2C adapter

i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – (values before 8 are unavailable but I can’t show many spaces)
10: – – – – – – – – – – 1a – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

I’ve tried to read the value with the following bash command :

i2cget -y 1 0x1a 0 b
0xd3

I get a 0xd3 (= 211 ) on the rpi4-8 GB and unreadable on the rpi4-4GB ! :frowning:

If I sum up the argononed.py script, it reads the conf file and look at the correct percentage for fan rotation and it set it to smbus(1) (for RPi4) at the 0x1a adress :

bus.write_byte_data(address,0,block) (where address is always 0x1a and block is the percentage)

When I try to set it via the python script I can see that correct percentage value is passed to the bus but I don’t hear/see any difference and the next time I read the value it’s always 0xd3 !

If anyone here having an argonone case, can you show me your output please ?

I have the argonone case with an 8GB rpi4 and I run the fan software. However, it does not seem to progress though some % of fan speed. It is either 100% or 0, nothing in between as far as I can tell. I get the same output as you, except for the last one:

$ sudo i2cget -y 1 0x1a 0 b
0xc9

Thanks for your reply.

Is the fan running?

And how hot it is ? (for me it’s 49°C)
Edit : here is an execution (I’ve added print to show values)

temp = 49.6’C

block = 50
val2 = 211
temp = 48.7’C

block = 50
val2 = 211
temp = 48.7’C

block = 50
val2 = 211

I set mine to turn on at 40 And yes, it does turn on and off as needed to cool. I do a moderate amount of overclocking and 40 seems a good number for me. Without the fan, I would hit 45 or so.

You did not mention having dtparam=i2c1=on in your config.txt. I needed it or the i2c kernel module would not load on boot. See here

I did see it but before my vc4 switch I always had i2c-1…

I will set it and make some tests to be sure.

I should have mentioned, I run kms.

Here is my /boot/config.txt :

gpu_mem=64
initramfs initramfs-linux.img followkernel
kernel=kernel8.img
arm_64bit=1
enable_gic=1
disable_overscan=1

#enable sound
dtparam=audio=on
hdmi_drive=2

#enable vc4
#dtoverlay=vc4-fkms-v3d
dtoverlay=vc4-kms-v3d
max_framebuffers=2
dtparam=i2c_arm=on
dtparam=i2c1=on

And I’ve lost my i2c-1device :

$ i2cdetect -l

i2c-11 unknown Broadcom STB : N/A
i2c-12 unknown Broadcom STB : N/A

I have to switch back to fkms… :frowning:

And now i2c-1 is back :

i2cdetect -l

i2c-1 i2c bcm2835 (i2c@7e804000) I2C adapter

when fkms is on :

cat /boot/config.txt

#See /boot/overlays/README for all available options
gpu_mem=64
initramfs initramfs-linux.img followkernel
kernel=kernel8.img
arm_64bit=1
enable_gic=1
disable_overscan=1
#enable sound
dtparam=audio=on
hdmi_drive=2
#enable vc4
dtoverlay=vc4-fkms-v3d
#dtoverlay=vc4-kms-v3d
max_framebuffers=2
dtparam=i2c_arm=on
dtparam=i2c1=on

# firmware
arm_64bit=1
enable_gic=1
#gpu_mem=64
#gpu_mem=128
gpu_mem=256
max_framebuffers=2
dtparam=i2c1=on

# overclocking
over_voltage=6
arm_freq=1800
v3d_freq=600
#isp_freq=600
#h264_freq=600
hdmi_enable_4kp60=1

# vc5
#dtoverlay=vc4-fkms-v3d,cma-512
#dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=vc4-kms-v3d-pi4,cma-512
#dtoverlay=rpivid-v4l2

# display
disable_overscan=1

# 4K@30fps
#hdmi_group=1
#hdmi_mode=97
#hdmi_mode=95
#hdmi_mode=102

# 4k@60fps

# sound
dtparam=audio=on
hdmi_drive=2

# bluetooth
dtoverlay=disable-bt

# os
initramfs initramfs-linux.img followkernel
kernel=kernel8.img

If I want to have sound through the headphone jack, I have to use fkms.

It doesn’t work for me: I can’t find a configuration where I have i2c-1 working but with fkms :frowning:

Didn’t you downgrade your firmware (cannot remember if it’s linux or raspberrypi firmware). If yes, how did you do it ? (using pacman cache ?)

I did, before I found the way to fix the current version of linux-firmware.

But yes, if you prefer to downgrade, I used the previous pacman cached version.

Looks like they may be working on this issue.

https://github.com/raspberrypi/linux/issues/4132

1 Like

They push a revert commit : Revert "ARM: dts: bcm2711: Add the BSC interrupt controller" · raspberrypi/linux@7f465f8 · GitHub

Could you please compile a new kernel with it please ?

Édit : I didn’t watch carrefully the kernel version but they didn’t move to 5.10.16 :unamused: maybe you want to wait for it or the new 5.11 (I hope they report this revert commit to it) ?

Both kernels just upgraded so compiling…

The 2 kernels are being push. I looked at the 5.11.0 kernel and it seems they added what was reverted in the 5.10.16 kernel so I have no clue what is up with that. They do a rebase every time the wind blows so the date may be skewed and they have not gotten around to reverting it.

Read this post before upgrading. Lots of things has changed.

https://forum.manjaro.org/t/new-raspberry-pi-kernels-related-packages/4721/376

I’ve upgraded to 5.11 and i2c-1 is not present with kms… so maybe we should comment the 5.10.14 issue to add that 5.11 is also broken to force a full rebase ?

BTW, I didn’t understand the ttymA0 switch to serial0 in /boot/cmdline.txt to avoid patchram 100% cpu bug. I guess that everyone will have it with new kernels (>= 5.10.14) but you still provide a /boot/cmdline.txt with ttymA0… Am I wrong ?

I really do not completely understand their answer either. They said the use of AMA0 in cmdline.txt was obsolete and removed the code allowing it. I looked in the Pi OS image and they also use serial0 in their cmdline.txt. It is supposed to be some sort of alias in their code now as I understand it that makes checks and switches terminals if depending on what is in use. In our case it still uses /dev/AMA0. There is no physical /dev/serial0.

This coding change does not seem to be in the kernel it’s self but in the raspberrypi-bootloader files starting with the date 20210208.

To get the argonone software to work, I had to install the the latest code for python-raspberry-gpio. The current package does not work due to the changes in Python 3.9 and gcc 10.

This is my pkgbuild:

# Maintainer: Devaev Maxim <mdevaev@gmail.com>
# Contributor: Michael Serpieri <contact at pygoscelis dot org>


pkgname=python-raspberry-gpio
pkgver=0.7.0.1a3
pkgrel=1
pkgdesc="Python library for GPIO access on a Raspberry Pi"
url="http://sourceforge.net/projects/raspberry-gpio-python"
license=(MIT)
arch=(armv6h armv7h aarch64)
depends=(python)
makedepends=(gcc python-distribute)
source=('raspberry-gpio-python-code-21bc345134c39ea0bad99eb51fc423a646a460a4.zip')
md5sums=('SKIP')

package() {
        cd "$srcdir/raspberry-gpio-python-code-21bc345134c39ea0bad99eb51fc423a646a460a4"
        python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
}

Edit: The kernel issue with /dev/i2c-1 needs to be addressed before this pkgbuild can help.

I did rebuild my own GPIO “python-raspberry-gpio” some times ago because of the RAM recognition
lack :

PKGBUILD

# Maintainer: Devaev Maxim mdevaev@gmail.com
# Contributor: Michael Serpieri

pkgname=python-raspberry-gpio
pkgver=0.7.1a3
pkgrel=1
pkgdesc=“Python library for GPIO access on a Raspberry Pi”
url=“http://sourceforge.net/projects/raspberry-gpio-python
license=(MIT)
arch=(armv6h armv7h aarch64)
depends=(python)
makedepends=(gcc python-distribute)
source=(“https://files.pythonhosted.org/packages/source/R/RPi.GPIO/RPi.GPIO-$pkgver.tar.gz” “package.patch”)
sha1sums=(‘286e062411a857be27ba056d19fca761a4e3ba31’ ‘5279644675e2211ed6364ca597e330cfc9886fec’)
prepare() {
cd “$srcdir/RPi.GPIO-$pkgver”
patch --forward --strip=1 --input="${srcdir}/package.patch"
}
package() {
cd “$srcdir/RPi.GPIO-$pkgver”
python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
}

PATCH (package.patch)

diff --unified --recursive --text ref/RPi.GPIO.egg-info/SOURCES.txt RPi.GPIO-0.7.1a3/RPi.GPIO.egg-info/SOURCES.txt
— ref/RPi.GPIO.egg-info/SOURCES.txt 2021-01-21 19:29:51.000000000 +0100
+++ RPi.GPIO-0.7.1a3/RPi.GPIO.egg-info/SOURCES.txt 2021-01-31 21:45:03.259579856 +0100
@@ -4,6 +4,7 @@
MANIFEST.in
README.txt
create_gpio_user_permissions.py
+setup.cfg
setup.py
RPi/init.py
RPi.GPIO.egg-info/PKG-INFO
Only in RPi.GPIO-0.7.1a3: build
diff --unified --recursive --text ref/source/cpuinfo.c RPi.GPIO-0.7.1a3/source/cpuinfo.c
— ref/source/cpuinfo.c 2021-01-21 18:46:33.000000000 +0100
+++ RPi.GPIO-0.7.1a3/source/cpuinfo.c 2021-01-31 22:23:35.039471987 +0100
@@ -125,6 +125,7 @@
case 2: info->ram = “1G”; break;
case 3: info->ram = “2G”; break;
case 4: info->ram = “4G”; break;
+ case 5: info->ram = “8G”; break;
default: info->ram = “Unknown”; break;
}
} else {

1 Like

Today I ran across this independent software project, with claims of more than the original.