ArgonOne Fan / Power Control

Here is a simple how to instruction to enable the Fan and Power on / off functionality on the ArgonOne Case.

DarkElvenAngel made a really nice Argon One Daemon
that can be found on DarkElvenAngel / Argon One Daemon · GitLab

On a fresh install of OSMC you need to do the following:

sudo apt-get update
sudo apt-get install i2c-tools libi2c-dev
sudo nano /etc/modules

In modules I added i2c-dev

sudo nano /boot/config-user.txt

In config-user.txt I added dtparam=i2c1=on

reboot
sudo apt-get install gcc device-tree-compiler git bash make libc6-dev
git clone https://gitlab.com/DarkElvenAngel/argononed.git
cd argononed/
./configure
./install

reboot

You can test the fan by typing argonone-cli --manual --fan=100 and set it back to auto using argonone-cli --auto

I do not want to comment using DarkElvenAngel*'s tool - EVERY open source tool is welcome and big THANKS are appropiate for the maintainer.

But for completeness I want to state that after enabling i2c at Pi4 / OSMC by

  • editing ‘config-user.txt’ and adding the line ‘dtparam=i2c_arm=on’
  • editing ‘/etc/modules’ and adding the line ‘i2c-dev’
  • rebooting Pi4

the standard argonOne scripts insalled by argon1.sh work as expected and a clean shutdown is possible.

Maybe their scripts should be handling this.
I don’t have any of their hardware to test to verify things (and am not interested in any samples with the expectation of support).

If they want to update their script, they just need to download an OSMC image from Download - OSMC and adjust accordingly.

If this hardware follows the HAT specifications then these commands should not be relevant and module loading should occur on the fly. Loading modules via /etc/modules is not advised. modules.d should be used if needed.

Best to keep this all under one post.

In my oppinion argon is working well. During installation of their software they normally enable i2c using standard raspi-config commands. But osmc blocks those commands (which are standard at an raspi) and advises to use myOSMC. I do not think that that’s the job for any external script to detect modifications to standard scripts done by OSMC. raspi-config ist present as expected at a raspian system but the content is modified so that it does not work at all.

So in my opinion the problem is caused primary by OSMC. At a plain raspian system everythink works fine and without any need for manual changes by user.

There may be (or better I think there are) good reasons for OSMC to block raspi-config access. But in this case it would be a good option to enable an easy way to enable i2c within OSMC.

EDIT:

Sorry - I did not see your post at the second topic.

YES we should keep everything at one place. So lets stop here and keep Discussion - if any further discussion is required - there:

We do not block raspi-config

OSMC is not based on Raspbian and we don’t modify anything to remove rpi-config.
It does not exist under Debian, which OSMC is based on.

Again, we are not blocking anything. Many scripts detect the underlying operating system by checking /etc/os-release and this is standard practice. For example, Docker has provisions for different distributions, including OSMC: https://get.docker.com/.

 Check if this is a forked Linux distro
check_forked() {

	# Check for lsb_release command existence, it usually exists in forked distros
	if command_exists lsb_release; then
		# Check if the `-u` option is supported
		set +e
		lsb_release -a -u > /dev/null 2>&1
		lsb_release_exit_code=$?
		set -e

		# Check if the command has exited successfully, it means we're in a forked distro
		if [ "$lsb_release_exit_code" = "0" ]; then
			# Print info about current distro
			cat <<-EOF
			You're using '$lsb_dist' version '$dist_version'.
			EOF

			# Get the upstream release info
			lsb_dist=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'id' | cut -d ':' -f 2 | tr -d '[:space:]')
			dist_version=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'codename' | cut -d ':' -f 2 | tr -d '[:space:]')

			# Print info about upstream distro
			cat <<-EOF
			Upstream release is '$lsb_dist' version '$dist_version'.
			EOF
		else
			if [ -r /etc/debian_version ] && [ "$lsb_dist" != "ubuntu" ] && [ "$lsb_dist" != "raspbian" ]; then
				if [ "$lsb_dist" = "osmc" ]; then
					# OSMC runs Raspbian
					lsb_dist=raspbian
				else
					# We're Debian and don't even know it!
					lsb_dist=debian
				fi
				dist_version="$(sed 's/\/.*//' /etc/debian_version | sed 's/\..*//')"
				case "$dist_version" in
					13)
						dist_version="trixie"
					;;
					12)
						dist_version="bookworm"
					;;
					11)
						dist_version="bullseye"
					;;
					10)
						dist_version="buster"
					;;
					9)
						dist_version="stretch"
					;;
					8)
						dist_version="jessie"
					;;
				esac
			fi
		fi
	fi
}