How to make use of the Argon One case for Raspberry Pi on Enterprise Linux systems?

How to make use of the Argon One case for Raspberry Pi on Enterprise Linux systems?

The Argon One case is one of the most popular cases for the Raspberry Pi. It provides protection, dissipates heat brilliantly, allows easier management of the device and has an active cooling system. However, taking advantage of the full capabilities of this enclosure requires a good knowledge of the system, tuning skills and some perseverance. We will show you how to accomplish this.

The Argon One case is one of the most popular cases for the Raspberry Pi. It provides protection, dissipates heat brilliantly, allows easier management of the device (e.g. through the availability of full-size HDMI connectors), and has an active cooling system. However, taking advantage of the full capabilities of this enclosure requires a good knowledge of the system, tuning skills and some perseverance. Today we will show you how to accomplish this.

For the purposes of this article, we used the minimal version of EuroLinux 9 image for Raspberry Pi. The installation and the steps described should also work on other systems in the Enterprise Linux family.

Installing userland software for Raspberry Pi

The userland repository for the Raspberry Pi contains additional libraries and tools for interacting with the Raspi. For example, the vcgencmd command along with the measure_temp subcommand allows you to read the temperature from the console. Raspberry Pi userland is required for proper operation of the case software..

EuroLinux provides userland for Raspberry Pi in the form of a compiled RPM package. System images created after 01/10/2023 have it installed by default. Older versions require you to install this package using the command:

sudo yum install -y raspberrypi-userland

If you don’t have the package on other Enterprise Linux version 9 operating systems, we recommend adding the EuroLinux repository for Raspberry Pi:

[rpi-eurolinux-9]
name=Raspberry PI for EuroLinux 9
baseurl=https://fbi.cdn.euro-linux.com/dist/eurolinux/server/9/aarch64/RPI/all/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-eurolinux9
includepkgs='raspberrypi-user*'

The above configuration has GPG signature checking disabled (or you can manually import the key) and with has an includepkgs option that points to those packages from the repository to be included. This is important because EuroLinux may have, for example, a newer kernel version relative to other projects. The above repository file should be saved in the /etc/yum.repos.d directory, for example, as el-rpi.repo.

After installation, we recommend checking that the vcgencmd command is working (e.g., using the previously described temperature sampling – measure_temp subcommand):

[root@raspberry ~]# vcgencmd measure_temp
temp=36.0'C

It is worth mentioning that an unprivileged (other than root) user, in order to use vcgencmd, must be a member of the video system group. Adding a user to the group can be done using the usermod command:

sudo usermod -a -G video USER

where USER shall be replaced with the name of the target user.

If you want to use group permissions without reloading the user session, you can in turn use the newgrp command:

newgrp video

Installing argononed

Installation of the chassis software is done through a script available at: https://download.argon40.com/argon1.sh. However, this script is customized for Debian family distributions. Therefore, it should be edited before running it:

curl https://download.argon40.com/argon1.sh > argon1.sh
cp argon1.sh{,.back}
vim argon1.sh

This edit is represented by the following diff, which can be used with the patch program.

--- argon1.sh.back	2021-09-04 14:31:36.309279427 +0200
+++ argon1.sh	2021-09-04 14:32:01.273010329 +0200
@@ -18,30 +18,6 @@
 	fi
 }

-CHECKPLATFORM="Others"
-# Check if Raspbian, otherwise Ubuntu
-grep -q -F 'Raspbian' /etc/os-release &> /dev/null
-if [ $? -eq 0 ]
-then
-	CHECKPLATFORM="Raspbian"
-	pkglist=(raspi-gpio python3-rpi.gpio python3-smbus i2c-tools)
-else
-	# Ubuntu has serial and i2c enabled
-	pkglist=(python3-rpi.gpio python3-smbus i2c-tools)
-fi
-
-for curpkg in ${pkglist[@]}; do
-	sudo apt-get install -y $curpkg
-	RESULT=$(argon_check_pkg "$curpkg")
-	if [ "NG" == "$RESULT" ]
-	then
-		echo "********************************************************************"
-		echo "Please also connect device to the internet and restart installation."
-		echo "********************************************************************"
-		exit
-	fi
-done
-
 # Ubuntu Mate for RPi has raspi-config too
 command -v raspi-config &> /dev/null
 if [ $? -eq 0 ]

After making the proposed changes, run the program with superuser privileges:

sudo bash ./argon1.sh

Among other things, it will install the argononed daemon in the path /usr/bin/argononed.py, and the systemd service argononed.service. What’s important, after the installation, the daemon will not run properly and will require additional steps described below.

Installation of dependencies that support the bus and data interface

The chassis uses, among other things, the I²C data bus (generally written as i2c or I2C) and the SPI (Serial Peripheral Interface) interface. These are used to handle the power supply for active cooling, as well as for infrared control (the chassis has an IR receiver, but its configuration is beyond the scope of this article).

To avoid making additional modifications to your scripts, we suggest using a global Python environment (also called the system environment). Installing Python modules in the global environment may lead to incompatible versions of the modules installed against the default system modules. Therefore, caution should be exercised.

Now we will install the necessary Python version 3 tools and GCC. The GCC compiler is required to compile Python modules for Raspberry Pi in the following steps:

sudo yum install -y python3-devel python3-pip gcc

Installation of packages for bus handling:

sudo yum install -y python3-i2c-tools i2c-tools

Installation of the Python module Rpi.GPIO:

sudo pip3 install RPi.GPIO

Enabling the data bus

Next, make it so that I2C and SPI are enabled and made available by the Linux kernel. In the /boot/config.txt file, add or uncomment the following lines:

dtparam=spi=on
dtparam=i2c_arm=on

These parameters can also be added with the following script:

echo -e 'dtparam=spi=on\ndtparam=i2c_arm=on' | sudo tee -a /boot/config.txt

After these changes, a reboot must be performed, as the Linux kernel must load its new configuration:

reboot

After the reboot, we can check the availability and operation of the i2c data bus using the i2cdetect program:

[root@raspberry ~]# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

We can check the availability of the SPI interface when trying to list the bus device files in the /dev/ directory (these are character files):

[root@raspberry ~]# ll /dev/*spi*
crw-------. 1 root root 153, 0 Sep 23 00:00 /dev/spidev0.0
crw-------. 1 root root 153, 1 Sep 23 00:00 /dev/spidev0.1

Configuring the case with argonone-config

Before configuring, we recommend checking that the argononed daemon has been started correctly using systemctl status argononed.service:

[root@raspberry ~]# systemctl status argononed.service
● argononed.service - Argon One Fan and Button Service
     Loaded: loaded (/usr/lib/systemd/system/argononed.service; enabled; vendor preset: disabled)
     Active: active (running) (...)

Example configuration running the fan at different speed levels at 60 and 65 degrees Celsius:

[root@raspberry ~]# argonone-config
--------------------------------------
Argon One Fan Speed Configuration Tool
--------------------------------------
WARNING: This will remove existing configuration.
Press Y to continue:y
Thank you.

Select fan mode:
  1. Always on
  2. Adjust to temperatures (55C, 60C, and 65C)
  3. Customize behavior
  4. Cancel
NOTE: You can also edit /etc/argononed.conf directly
Enter Number (1-4):2

Please provide fan speeds for the following temperatures:
55C (0-100 only):0
60C (0-100 only):50
65C (0-100 only):100

The software also allows you to use your own values. This is especially useful when testing the case, because it dissipates heat so well that a temperature of 50 degrees on standard clocking can be difficult to achieve. For testing, we can use, for example, pairs (temperature;fan use) 43;10, 45;20, 50;40 55;80 and 60;100.

[root@raspberry ~]# argonone-config
--------------------------------------
Argon One Fan Speed Configuration Tool
--------------------------------------
WARNING: This will remove existing configuration.
Press Y to continue:Y
Thank you.

Select fan mode:
  1. Always on
  2. Adjust to temperatures (55C, 60C, and 65C)
  3. Customize behavior
  4. Cancel
NOTE: You can also edit /etc/argononed.conf directly
Enter Number (1-4):3

Please provide fan speeds and temperature pairs

Provide minimum temperature (in Celsius) then [ENTER]:43
Provide fan speed for 43C (0-100) then [ENTER]:10
* Fan speed will be set to 10 once temperature reaches 43 C

Provide minimum temperature (in Celsius) then [ENTER]:45
Provide fan speed for 45C (0-100) then [ENTER]:20
* Fan speed will be set to 20 once temperature reaches 45 C

Provide minimum temperature (in Celsius) then [ENTER]:50
Provide fan speed for 50C (0-100) then [ENTER]:40
* Fan speed will be set to 40 once temperature reaches 50 C

Provide minimum temperature (in Celsius) then [ENTER]:55
Provide fan speed for 55C (0-100) then [ENTER]:80
* Fan speed will be set to 80 once temperature reaches 55 C

Provide minimum temperature (in Celsius) then [ENTER]:60
Provide fan speed for 60C (0-100) then [ENTER]:100
* Fan speed will be set to 100 once temperature reaches 60 C

Provide minimum temperature (in Celsius) then [ENTER]:

Thank you!  We saved 5 pairs.
Changes should take effect now.

Stress tests

To check the active cooling of the chassis, we recommend performing load tests. For the purpose of this article, they are mainly used to verify that the chassis software starts active cooling at preset temperatures and limits/disables it at lower temperatures.

Standard tools (e.g. stress-ng) or the stressberry project can be used for stress testing.

CPU load tests with stress-ng

First of all, install the stress-ng package, which is available in the standard repositories of EuroLinux 9.

sudo yum install -y stress-ng

Then, in the first session of the terminal, we run the observer, which will be informing us every 5 seconds about the current temperature:

watch -n 5 'vcgencmd measure_temp'

In the second terminal, run a load test lasting 2 minutes:

stress-ng --timeout 120 --metrics -c $(nproc)

Example:

[root@raspberry ~]# stress-ng --timeout 120 --metrics -c $(nproc)
stress-ng: info:  [2506] setting to a 120 second (2 mins, 0.00 secs) run per stressor
stress-ng: info:  [2506] dispatching hogs: 4 cpu
stress-ng: info:  [2506] stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s CPU used per
stress-ng: info:  [2506]                           (secs)    (secs)    (secs)   (real time) (usr+sys time) instance (%)
stress-ng: info:  [2506] cpu               18352    120.11    477.81      0.11       152.79          38.40        99.47
stress-ng: info:  [2506] successful run completed in 120.28s (2 mins, 0.28 secs)

Observe that when the set thresholds are exceeded, the cooling system is activated as expected.

stressberry

A popular solution for performing load tests tailored for the Raspberry Pi is stressberry. The advantage of this software is the automatic collection of data and the ability to create nice, clear graphs.

The installation of stressbery is straightforward, but an important element is the use of the option --user in order to keep the system Python environment unchanged:

pip3 install --user stressberry

The current version of stressberry does not use the stress-ng command but stress instead. A corresponding patch has been proposed in the project repository by one of our engineers. Nevertheless, at the time of writing, before running the stressberry program, a soft link stress to stress-ng should be created:

sudo ln -s /usr/bin/stress-ng /usr/bin/stress

Again, we can use the watch program to observe the temperature:

watch -n 5 'vcgencmd measure_temp'

In a second terminal, run the tests:

# slow version is waiting for temperatures to stabilize
stressberry-run slow-run.out 
# version not waiting for temperatures to stabilize -> faster
stressberry-run --idle 1 --cooldown 5 fast-run.out

Sample launch for the version not waiting for temperature stabilization before and after the test:

[Alex@raspberry ~]$ stressberry-run --idle 1 --cooldown 5 fast-run.out
Awaiting stable baseline temperature...
Current temperature: 39.9°C - Previous temperature: 39.9°C
Preparing to stress [4] CPU Cores for [300] seconds
Idling for 1 seconds...
Current temperature: 39.4°C - Frequency: 1500MHz
/usr/bin/stress-ng
stress-ng: info:  [6176] setting to a 300 second (5 mins, 0.00 secs) run per stressor
stress-ng: info:  [6176] dispatching hogs: 4 cpu
Current temperature: 41.8°C - Frequency: 1500MHz
(...)
Current temperature: 44.8°C - Frequency: 1500MHz
stress-ng: info:  [6176] successful run completed in 300.16s (5 mins, 0.16 secs)
Idling for 1 seconds...

Bonus micro troubleshooting of argononed

If the case of problems with the argononed daemon, we recommend that you first check its status using systemctl status argononed.service.

[root@raspberry ~]# systemctl status argononed.service
× argononed.service - Argon One Fan and Button Service
     Loaded: loaded (/usr/lib/systemd/system/argononed.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Wed 2023-01-11 08:52:21 UTC; 59s ago
   Duration: 118ms
    Process: 1242 ExecStart=/usr/bin/python3 /usr/bin/argononed.py (code=exited, status=1/FAILURE)
   Main PID: 1242 (code=exited, status=1/FAILURE)
        CPU: 117ms

The troubleshooting process can be done by, among other things, trying to start the program manually:

/usr/bin/python3 /usr/bin/argononed.py

An example of an error:

[root@raspberry ~]# /usr/bin/python3 /usr/bin/argononed.py
Traceback (most recent call last):
  File "/usr/bin/argononed.py", line 2, in <module>
    import smbus
ModuleNotFoundError: No module named 'smbus'

It is due to the unavailability of the smbus module. To install it, we suggest you use an RPM package available in the standard repositories:

sudo yum install -y python3-i2c-tools # moduły smbus

Another error could be:

[root@raspberry ~]# /usr/bin/python3 /usr/bin/argononed.py
Traceback (most recent call last):
  File "/usr/bin/argononed.py", line 9, in <module>
    bus = smbus.SMBus(1)
FileNotFoundError: [Errno 2] No such file or directory

This one, in turn, is due to the lack of access to the i2c bus due to the absence of a corresponding entry in /boot/config.txt (or due to the failure to reboot the system). Another reason could also be the lack of system tools that are in the i2c-tools package.

Summary

Installing software for Argon One on EuroLinux 9 or other Enterprise Linux systems requires some knowledge, system tuning and debugging skills. Of course, this is what enthusiasts and hobbyists like best ;-)

Our blog will soon feature another article on the subject of Raspi. This time we will cover the topic of increasing the clocking (i.e. overclocking) of the Raspberry Pi along with tests. We will conclude our mini-series on this computer with an article comparing it to other computers with ARM64 architecture.

Authors

The blog articles are written by people from the EuroLinux team. We owe 80% of the content to our developers, the rest is prepared by the sales or marketing department. We make every effort to ensure that the content is the best in terms of content and language, but we are not infallible. If you see anything that needs to be corrected or clarified, we'd love to hear from you.