Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8621

HATs and other add-ons • Rpi 4B Argon one V1 M2.NVME fan script on Raspberry OS Trixie

$
0
0
First of all sorry for my english. English is not my first language. I was thinking i am not the only one with this problem and i would like to share the work around with other.

In my case i was reinstalling my Pi 4b to the latest Raspberry OS Trixie. After fresh install the Argon one script didnt work anymore.

what is did i was the following steps

1. i install my raspberry os on my sd card with the raspberry pi imager 2.0.3 .

2. place sd card in the pi withe argon one case and the nvme case and screw them back on! this is important because there is an golden pin with spring loaded that is making contact withe pi board. make sure that is making proper contact you can feel the under casing is setting of the spring. If the under case is not set properly the i2c is not finding anything.

3. run through the setup update upgrade etc. Don`t forget to activate the i2c and the serial with raspi-config > interface options > i2c and the serial.

4. check if the i2c is there by running terminal

Code:

sudo 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: -- -- -- -- -- -- -- --

you should be getting something like this. 1a so its finding something. that is a good sign.

5. Copy this code and paste in Text Editor, save as argonone.sh

Code:

#!/bin/bashargon_create_file() {if [ -f $1 ]; thensudo rm $1fisudo touch $1sudo chmod 666 $1}argon_check_pkg() {RESULT=$(dpkg-query -W -f='${Status}\n' "$1" 2> /dev/null | grep "installed")if [ "" == "$RESULT" ]; thenecho "NG"elseecho "OK"fi}# Check if Raspbian, Ubuntu, othersCHECKPLATFORM="Others"if [ -f "/etc/os-release" ]thensource /etc/os-releaseif [ "$ID" = "raspbian" ]thenCHECKPLATFORM="Raspbian"elif [ "$ID" = "ubuntu" ]thenCHECKPLATFORM="Ubuntu"fifiif [ "$CHECKPLATFORM" = "Raspbian" ]thenpkglist=(rpi.gpio-common python3-rpi.gpio python3-smbus i2c-tools)else# Todo handle lgpio# Ubuntu has serial and i2c enabledpkglist=(python3-rpi.gpio python3-smbus i2c-tools)fifor curpkg in ${pkglist[@]}; dosudo apt-get install -y $curpkgRESULT=$(argon_check_pkg "$curpkg")if [ "NG" == "$RESULT" ]thenecho "********************************************************************"echo "Please also connect device to the internet and restart installation."echo "********************************************************************"exitfidone# Ubuntu Mate for RPi has raspi-config toocommand -v raspi-config &> /dev/nullif [ $? -eq 0 ]then# Enable i2c and serialsudo raspi-config nonint do_i2c 0sudo raspi-config nonint do_serial 2fi# Helper variablesdaemonname="argononed"powerbuttonscript=/usr/bin/$daemonname.pyshutdownscript="/lib/systemd/system-shutdown/"$daemonname"-poweroff.py"daemonconfigfile=/etc/$daemonname.confconfigscript=/usr/bin/argonone-configremovescript=/usr/bin/argonone-uninstalldaemonfanservice=/lib/systemd/system/$daemonname.serviceif [ ! -f $daemonconfigfile ]; then# Generate config file for fan speedsudo touch $daemonconfigfilesudo chmod 666 $daemonconfigfileecho '#' >> $daemonconfigfileecho '# Argon One Fan Configuration' >> $daemonconfigfileecho '#' >> $daemonconfigfileecho '# List below the temperature (Celsius) and fan speed (in percent) pairs' >> $daemonconfigfileecho '# Use the following form:' >> $daemonconfigfileecho '# min.temperature=speed' >> $daemonconfigfileecho '#' >> $daemonconfigfileecho '# Example:' >> $daemonconfigfileecho '# 55=10' >> $daemonconfigfileecho '# 60=55' >> $daemonconfigfileecho '# 65=100' >> $daemonconfigfileecho '#' >> $daemonconfigfileecho '# Above example sets the fan speed to' >> $daemonconfigfileecho '#' >> $daemonconfigfileecho '# NOTE: Lines begining with # are ignored' >> $daemonconfigfileecho '#' >> $daemonconfigfileecho '# Type the following at the command line for changes to take effect:' >> $daemonconfigfileecho '# sudo systemctl restart '$daemonname'.service' >> $daemonconfigfileecho '#' >> $daemonconfigfileecho '# Start below:' >> $daemonconfigfileecho '55=10' >> $daemonconfigfileecho '60=55' >> $daemonconfigfileecho '65=100' >> $daemonconfigfilefi# Generate script that runs every shutdown eventargon_create_file $shutdownscriptecho "#!/usr/bin/python3" >> $shutdownscriptecho 'import sys' >> $shutdownscriptecho 'import smbus' >> $shutdownscriptecho 'import RPi.GPIO as GPIO' >> $shutdownscriptecho 'rev = GPIO.RPI_REVISION' >> $shutdownscriptecho 'if rev == 2 or rev == 3:' >> $shutdownscriptecho 'bus = smbus.SMBus(1)' >> $shutdownscriptecho 'else:' >> $shutdownscriptecho 'bus = smbus.SMBus(0)' >> $shutdownscriptecho 'if len(sys.argv)>1:' >> $shutdownscriptecho "bus.write_byte(0x1a,0)"  >> $shutdownscript# powercut signalecho 'if sys.argv[1] == "poweroff" or sys.argv[1] == "halt":'  >> $shutdownscriptecho "try:"  >> $shutdownscriptecho "bus.write_byte(0x1a,0xFF)"  >> $shutdownscriptecho "except:"  >> $shutdownscriptecho "rev=0"  >> $shutdownscriptsudo chmod 755 $shutdownscript# Generate script to monitor shutdown buttonargon_create_file $powerbuttonscriptecho "#!/usr/bin/python3" >> $powerbuttonscriptecho 'import smbus' >> $powerbuttonscriptecho 'import RPi.GPIO as GPIO' >> $powerbuttonscriptecho 'import os' >> $powerbuttonscriptecho 'import time' >> $powerbuttonscriptecho 'from threading import Thread' >> $powerbuttonscriptecho 'rev = GPIO.RPI_REVISION' >> $powerbuttonscriptecho 'if rev == 2 or rev == 3:' >> $powerbuttonscriptecho 'bus = smbus.SMBus(1)' >> $powerbuttonscriptecho 'else:' >> $powerbuttonscriptecho 'bus = smbus.SMBus(0)' >> $powerbuttonscriptecho 'GPIO.setwarnings(False)' >> $powerbuttonscriptecho 'GPIO.setmode(GPIO.BCM)' >> $powerbuttonscriptecho 'shutdown_pin=4' >> $powerbuttonscriptecho 'GPIO.setup(shutdown_pin, GPIO.IN,  pull_up_down=GPIO.PUD_DOWN)' >> $powerbuttonscriptecho 'def shutdown_check():' >> $powerbuttonscriptecho 'while True:' >> $powerbuttonscriptecho 'pulsetime = 1' >> $powerbuttonscriptecho 'GPIO.wait_for_edge(shutdown_pin, GPIO.RISING)' >> $powerbuttonscriptecho 'time.sleep(0.01)' >> $powerbuttonscriptecho 'while GPIO.input(shutdown_pin) == GPIO.HIGH:' >> $powerbuttonscriptecho 'time.sleep(0.01)' >> $powerbuttonscriptecho 'pulsetime += 1' >> $powerbuttonscriptecho 'if pulsetime >=2 and pulsetime <=3:' >> $powerbuttonscriptecho 'os.system("reboot")' >> $powerbuttonscriptecho 'elif pulsetime >=4 and pulsetime <=5:' >> $powerbuttonscriptecho 'os.system("shutdown now -h")' >> $powerbuttonscriptecho 'def get_fanspeed(tempval, configlist):' >> $powerbuttonscriptecho 'for curconfig in configlist:' >> $powerbuttonscriptecho 'curpair = curconfig.split("=")' >> $powerbuttonscriptecho 'tempcfg = float(curpair[0])' >> $powerbuttonscriptecho 'fancfg = int(float(curpair[1]))' >> $powerbuttonscriptecho 'if tempval >= tempcfg:' >> $powerbuttonscriptecho 'if fancfg < 1:' >> $powerbuttonscriptecho 'return 0' >> $powerbuttonscriptecho 'elif fancfg < 25:' >> $powerbuttonscriptecho 'return 25' >> $powerbuttonscriptecho 'return fancfg' >> $powerbuttonscriptecho 'return 0' >> $powerbuttonscriptecho 'def load_config(fname):' >> $powerbuttonscriptecho 'newconfig = []' >> $powerbuttonscriptecho 'try:' >> $powerbuttonscriptecho 'with open(fname, "r") as fp:' >> $powerbuttonscriptecho 'for curline in fp:' >> $powerbuttonscriptecho 'if not curline:' >> $powerbuttonscriptecho 'continue' >> $powerbuttonscriptecho 'tmpline = curline.strip()' >> $powerbuttonscriptecho 'if not tmpline:' >> $powerbuttonscriptecho 'continue' >> $powerbuttonscriptecho 'if tmpline[0] == "#":' >> $powerbuttonscriptecho 'continue' >> $powerbuttonscriptecho 'tmppair = tmpline.split("=")' >> $powerbuttonscriptecho 'if len(tmppair) != 2:' >> $powerbuttonscriptecho 'continue' >> $powerbuttonscriptecho 'tempval = 0' >> $powerbuttonscriptecho 'fanval = 0' >> $powerbuttonscriptecho 'try:' >> $powerbuttonscriptecho 'tempval = float(tmppair[0])' >> $powerbuttonscriptecho 'if tempval < 0 or tempval > 100:' >> $powerbuttonscriptecho 'continue' >> $powerbuttonscriptecho 'except:' >> $powerbuttonscriptecho 'continue' >> $powerbuttonscriptecho 'try:' >> $powerbuttonscriptecho 'fanval = int(float(tmppair[1]))' >> $powerbuttonscriptecho 'if fanval < 0 or fanval > 100:' >> $powerbuttonscriptecho 'continue' >> $powerbuttonscriptecho 'except:' >> $powerbuttonscriptecho 'continue' >> $powerbuttonscriptecho 'newconfig.append( "{:5.1f}={}".format(tempval,fanval))' >> $powerbuttonscriptecho 'if len(newconfig) > 0:' >> $powerbuttonscriptecho 'newconfig.sort(reverse=True)' >> $powerbuttonscriptecho 'except:' >> $powerbuttonscriptecho 'return []' >> $powerbuttonscriptecho 'return newconfig' >> $powerbuttonscriptecho 'def temp_check():' >> $powerbuttonscriptecho 'fanconfig = ["65=100", "60=55", "55=10"]' >> $powerbuttonscriptecho 'tmpconfig = load_config("'$daemonconfigfile'")' >> $powerbuttonscriptecho 'if len(tmpconfig) > 0:' >> $powerbuttonscriptecho 'fanconfig = tmpconfig' >> $powerbuttonscriptecho 'address=0x1a' >> $powerbuttonscriptecho 'prevblock=0' >> $powerbuttonscriptecho 'while True:' >> $powerbuttonscriptecho 'try:' >> $powerbuttonscriptecho 'tempfp = open("/sys/class/thermal/thermal_zone0/temp", "r")' >> $powerbuttonscriptecho 'temp = tempfp.readline()' >> $powerbuttonscriptecho 'tempfp.close()' >> $powerbuttonscriptecho 'val = float(int(temp)/1000)' >> $powerbuttonscriptecho 'except IOError:' >> $powerbuttonscriptecho 'val = 0' >> $powerbuttonscriptecho 'block = get_fanspeed(val, fanconfig)' >> $powerbuttonscriptecho 'if block < prevblock:' >> $powerbuttonscriptecho 'time.sleep(30)' >> $powerbuttonscriptecho 'prevblock = block' >> $powerbuttonscriptecho 'try:' >> $powerbuttonscriptecho 'if block > 0:' >> $powerbuttonscriptecho 'bus.write_byte(address,100)' >> $powerbuttonscriptecho 'time.sleep(1)' >> $powerbuttonscriptecho 'bus.write_byte(address,block)' >> $powerbuttonscriptecho 'except IOError:' >> $powerbuttonscriptecho 'temp=""' >> $powerbuttonscriptecho 'time.sleep(30)' >> $powerbuttonscriptecho 'try:' >> $powerbuttonscriptecho 't1 = Thread(target = shutdown_check)' >> $powerbuttonscriptecho 't2 = Thread(target = temp_check)' >> $powerbuttonscriptecho 't1.start()' >> $powerbuttonscriptecho 't2.start()' >> $powerbuttonscriptecho 'except:' >> $powerbuttonscriptecho 't1.stop()' >> $powerbuttonscriptecho 't2.stop()' >> $powerbuttonscriptecho 'GPIO.cleanup()' >> $powerbuttonscriptsudo chmod 755 $powerbuttonscriptargon_create_file $daemonfanservice# Fan Daemonecho "[Unit]" >> $daemonfanserviceecho "Description=Argon One Fan and Button Service" >> $daemonfanserviceecho "After=multi-user.target" >> $daemonfanserviceecho '[Service]' >> $daemonfanserviceecho 'Type=simple' >> $daemonfanserviceecho "Restart=always" >> $daemonfanserviceecho "RemainAfterExit=true" >> $daemonfanserviceecho "ExecStart=/usr/bin/python3 $powerbuttonscript" >> $daemonfanserviceecho '[Install]' >> $daemonfanserviceecho "WantedBy=multi-user.target" >> $daemonfanservicesudo chmod 644 $daemonfanserviceargon_create_file $removescript# Uninstall Scriptecho '#!/bin/bash' >> $removescriptecho 'echo "-------------------------"' >> $removescriptecho 'echo "Argon One Uninstall Tool"' >> $removescriptecho 'echo "-------------------------"' >> $removescriptecho 'echo -n "Press Y to continue:"' >> $removescriptecho 'read -n 1 confirm' >> $removescriptecho 'echo' >> $removescriptecho 'if [ "$confirm" = "y" ]' >> $removescriptecho 'then' >> $removescriptecho 'confirm="Y"' >> $removescriptecho 'fi' >> $removescriptecho '' >> $removescriptecho 'if [ "$confirm" != "Y" ]' >> $removescriptecho 'then' >> $removescriptecho 'echo "Cancelled"' >> $removescriptecho 'exit' >> $removescriptecho 'fi' >> $removescriptecho 'if [ -d "/home/pi/Desktop" ]; then' >> $removescriptecho 'sudo rm "/home/pi/Desktop/argonone-config.desktop"' >> $removescriptecho 'sudo rm "/home/pi/Desktop/argonone-uninstall.desktop"' >> $removescriptecho 'fi' >> $removescriptecho 'if [ -f '$powerbuttonscript' ]; then' >> $removescriptecho 'sudo systemctl stop '$daemonname'.service' >> $removescriptecho 'sudo systemctl disable '$daemonname'.service' >> $removescriptecho 'sudo /usr/bin/python3 '$shutdownscript' uninstall' >> $removescriptecho 'sudo rm '$powerbuttonscript >> $removescriptecho 'sudo rm '$shutdownscript >> $removescriptecho 'sudo rm '$removescript >> $removescriptecho 'echo "Removed Argon One Services."' >> $removescriptecho 'echo "Cleanup will complete after restarting the device."' >> $removescriptecho 'fi' >> $removescriptsudo chmod 755 $removescriptargon_create_file $configscript# Config Scriptecho '#!/bin/bash' >> $configscriptecho 'daemonconfigfile='$daemonconfigfile >> $configscriptecho 'echo "--------------------------------------"' >> $configscriptecho 'echo "Argon One Fan Speed Configuration Tool"' >> $configscriptecho 'echo "--------------------------------------"' >> $configscriptecho 'echo "WARNING: This will remove existing configuration."' >> $configscriptecho 'echo -n "Press Y to continue:"' >> $configscriptecho 'read -n 1 confirm' >> $configscriptecho 'echo' >> $configscriptecho 'if [ "$confirm" = "y" ]' >> $configscriptecho 'then' >> $configscriptecho 'confirm="Y"' >> $configscriptecho 'fi' >> $configscriptecho '' >> $configscriptecho 'if [ "$confirm" != "Y" ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "Cancelled"' >> $configscriptecho 'exit' >> $configscriptecho 'fi' >> $configscriptecho 'echo "Thank you."' >> $configscriptecho 'get_number () {' >> $configscriptecho 'read curnumber' >> $configscriptecho 'if [ -z "$curnumber" ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "-2"' >> $configscriptecho 'return' >> $configscriptecho 'elif [[ $curnumber =~ ^[+-]?[0-9]+$ ]]' >> $configscriptecho 'then' >> $configscriptecho 'if [ $curnumber -lt 0 ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "-1"' >> $configscriptecho 'return' >> $configscriptecho 'elif [ $curnumber -gt 100 ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "-1"' >> $configscriptecho 'return' >> $configscriptecho 'fi' >> $configscriptecho 'echo $curnumber' >> $configscriptecho 'return' >> $configscriptecho 'fi' >> $configscriptecho 'echo "-1"' >> $configscriptecho 'return' >> $configscriptecho '}' >> $configscriptecho '' >> $configscriptecho 'loopflag=1' >> $configscriptecho 'while [ $loopflag -eq 1 ]' >> $configscriptecho 'do' >> $configscriptecho 'echo' >> $configscriptecho 'echo "Select fan mode:"' >> $configscriptecho 'echo "  1. Always on"' >> $configscriptecho 'echo "  2. Adjust to temperatures (55C, 60C, and 65C)"' >> $configscriptecho 'echo "  3. Customize behavior"' >> $configscriptecho 'echo "  4. Cancel"' >> $configscriptecho 'echo "NOTE: You can also edit $daemonconfigfile directly"' >> $configscriptecho 'echo -n "Enter Number (1-4):"' >> $configscriptecho 'newmode=$( get_number )' >> $configscriptecho 'if [[ $newmode -ge 1 && $newmode -le 4 ]]' >> $configscriptecho 'then' >> $configscriptecho 'loopflag=0' >> $configscriptecho 'fi' >> $configscriptecho 'done' >> $configscriptecho 'echo' >> $configscriptecho 'if [ $newmode -eq 4 ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "Cancelled"' >> $configscriptecho 'exit' >> $configscriptecho 'elif [ $newmode -eq 1 ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "#" > $daemonconfigfile' >> $configscriptecho 'echo "# Argon One Fan Speed Configuration" >> $daemonconfigfile' >> $configscriptecho 'echo "#" >> $daemonconfigfile' >> $configscriptecho 'echo "# Min Temp=Fan Speed" >> $daemonconfigfile' >> $configscriptecho 'echo 1"="100 >> $daemonconfigfile' >> $configscriptecho 'sudo systemctl restart '$daemonname'.service' >> $configscriptecho 'echo "Fan always on."' >> $configscriptecho 'exit' >> $configscriptecho 'elif [ $newmode -eq 2 ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "Please provide fan speeds for the following temperatures:"' >> $configscriptecho 'echo "#" > $daemonconfigfile' >> $configscriptecho 'echo "# Argon One Fan Speed Configuration" >> $daemonconfigfile' >> $configscriptecho 'echo "#" >> $daemonconfigfile' >> $configscriptecho 'echo "# Min Temp=Fan Speed" >> $daemonconfigfile' >> $configscriptecho 'curtemp=55' >> $configscriptecho 'while [ $curtemp -lt 70 ]' >> $configscriptecho 'do' >> $configscriptecho 'errorfanflag=1' >> $configscriptecho 'while [ $errorfanflag -eq 1 ]' >> $configscriptecho 'do' >> $configscriptecho 'echo -n ""$curtemp"C (0-100 only):"' >> $configscriptecho 'curfan=$( get_number )' >> $configscriptecho 'if [ $curfan -ge 0 ]' >> $configscriptecho 'then' >> $configscriptecho 'errorfanflag=0' >> $configscriptecho 'fi' >> $configscriptecho 'done' >> $configscriptecho 'echo $curtemp"="$curfan >> $daemonconfigfile' >> $configscriptecho 'curtemp=$((curtemp+5))' >> $configscriptecho 'done' >> $configscriptecho 'sudo systemctl restart '$daemonname'.service' >> $configscriptecho 'echo "Configuration updated."' >> $configscriptecho 'exit' >> $configscriptecho 'fi' >> $configscriptecho 'echo "Please provide fan speeds and temperature pairs"' >> $configscriptecho 'echo' >> $configscriptecho 'loopflag=1' >> $configscriptecho 'paircounter=0' >> $configscriptecho 'while [ $loopflag -eq 1 ]' >> $configscriptecho 'do' >> $configscriptecho 'errortempflag=1' >> $configscriptecho 'errorfanflag=1' >> $configscriptecho 'while [ $errortempflag -eq 1 ]' >> $configscriptecho 'do' >> $configscriptecho 'echo -n "Provide minimum temperature (in Celsius) then [ENTER]:"' >> $configscriptecho 'curtemp=$( get_number )' >> $configscriptecho 'if [ $curtemp -ge 0 ]' >> $configscriptecho 'then' >> $configscriptecho 'errortempflag=0' >> $configscriptecho 'elif [ $curtemp -eq -2 ]' >> $configscriptecho 'then' >> $configscriptecho 'errortempflag=0' >> $configscriptecho 'errorfanflag=0' >> $configscriptecho 'loopflag=0' >> $configscriptecho 'fi' >> $configscriptecho 'done' >> $configscriptecho 'while [ $errorfanflag -eq 1 ]' >> $configscriptecho 'do' >> $configscriptecho 'echo -n "Provide fan speed for "$curtemp"C (0-100) then [ENTER]:"' >> $configscriptecho 'curfan=$( get_number )' >> $configscriptecho 'if [ $curfan -ge 0 ]' >> $configscriptecho 'then' >> $configscriptecho 'errorfanflag=0' >> $configscriptecho 'elif [ $curfan -eq -2 ]' >> $configscriptecho 'then' >> $configscriptecho 'errortempflag=0' >> $configscriptecho 'errorfanflag=0' >> $configscriptecho 'loopflag=0' >> $configscriptecho 'fi' >> $configscriptecho 'done' >> $configscriptecho 'if [ $loopflag -eq 1 ]' >> $configscriptecho 'then' >> $configscriptecho 'if [ $paircounter -eq 0 ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "#" > $daemonconfigfile' >> $configscriptecho 'echo "# Argon One Fan Speed Configuration" >> $daemonconfigfile' >> $configscriptecho 'echo "#" >> $daemonconfigfile' >> $configscriptecho 'echo "# Min Temp=Fan Speed" >> $daemonconfigfile' >> $configscriptecho 'fi' >> $configscriptecho 'echo $curtemp"="$curfan >> $daemonconfigfile' >> $configscriptecho '' >> $configscriptecho 'paircounter=$((paircounter+1))' >> $configscriptecho '' >> $configscriptecho 'echo "* Fan speed will be set to "$curfan" once temperature reaches "$curtemp" C"' >> $configscriptecho 'echo' >> $configscriptecho 'fi' >> $configscriptecho 'done' >> $configscriptecho '' >> $configscriptecho 'echo' >> $configscriptecho 'if [ $paircounter -gt 0 ]' >> $configscriptecho 'then' >> $configscriptecho 'echo "Thank you!  We saved "$paircounter" pairs."' >> $configscriptecho 'sudo systemctl restart '$daemonname'.service' >> $configscriptecho 'echo "Changes should take effect now."' >> $configscriptecho 'else' >> $configscriptecho 'echo "Cancelled, no data saved."' >> $configscriptecho 'fi' >> $configscriptsudo chmod 755 $configscriptsudo systemctl daemon-reloadsudo systemctl enable $daemonname.servicesudo systemctl start $daemonname.serviceshortcutfile="/home/pi/Desktop/argonone-config.desktop"if [ "$CHECKPLATFORM" = "Raspbian" ] && [ -d "/home/pi/Desktop" ]thenterminalcmd="lxterminal --working-directory=/home/pi/ -t"if  [ -f "/home/pi/.twisteros.twid" ]thenterminalcmd="xfce4-terminal --default-working-directory=/home/pi/ -T"fisudo wget http://download.argon40.com/ar1config.png -O /usr/share/pixmaps/ar1config.png --quietsudo wget http://download.argon40.com/ar1uninstall.png -O /usr/share/pixmaps/ar1uninstall.png --quiet# Create Shortcutsecho "[Desktop Entry]" > $shortcutfileecho "Name=Argon One Configuration" >> $shortcutfileecho "Comment=Argon One Configuration" >> $shortcutfileecho "Icon=/usr/share/pixmaps/ar1config.png" >> $shortcutfileecho 'Exec='$terminalcmd' "Argon One Configuration" -e '$configscript >> $shortcutfileecho "Type=Application" >> $shortcutfileecho "Encoding=UTF-8" >> $shortcutfileecho "Terminal=false" >> $shortcutfileecho "Categories=None;" >> $shortcutfilechmod 755 $shortcutfileshortcutfile="/home/pi/Desktop/argonone-uninstall.desktop"echo "[Desktop Entry]" > $shortcutfileecho "Name=Argon One Uninstall" >> $shortcutfileecho "Comment=Argon One Uninstall" >> $shortcutfileecho "Icon=/usr/share/pixmaps/ar1uninstall.png" >> $shortcutfileecho 'Exec='$terminalcmd' -t "Argon One Uninstall" --working-directory=/home/pi/ -e '$removescript >> $shortcutfileecho "Type=Application" >> $shortcutfileecho "Encoding=UTF-8" >> $shortcutfileecho "Terminal=false" >> $shortcutfileecho "Categories=None;" >> $shortcutfilechmod 755 $shortcutfilefi# IR config scriptsudo wget https://download.argon40.com/argonone-irconfig.sh -O /usr/bin/argonone-ir --quietsudo chmod 755 /usr/bin/argonone-irecho "***************************"echo "Argon One Setup Completed."echo "***************************"echoif [ ! "$CHECKPLATFORM" = "Raspbian" ]thenecho "You may need to reboot for changes to take effect"echofi if [ -f $shortcutfile ]; thenecho Shortcuts created in your desktop.elseecho Use 'argonone-config' to configure fanecho Use 'argonone-uninstall' to uninstallfiecho
6. Make the file executable. Find the file that you just saved en right click and properties, tab permission > execute > select anyone.

7. go terminal and run the script by

Code:

./argonone.sh bash
if the script doesnt work try installing first the gpio.

Code:

sudo apt install python3-rpi.gpio
8. now you can customize the fan profile using

Code:

argonone-config
9. Copy the whole SD to your nvme by using SD card copier. after copy remove sd card and should be good to go.

The script that i posted was from an old install script the only problem for me was the raspi-gpio modules was chang to rpi.gpio-common. Someone from the other forum posted the old script luckily. Here is the original https://forum.argon40.com/t/argon-one-v ... ng/2539/13post.

Hope this help other people :D

Statistics: Posted by stefanislate — Mon Jan 12, 2026 10:20 pm



Viewing all articles
Browse latest Browse all 8621

Trending Articles