Install CloudShell2 Software on Armbian Bookworm
sudo nano /boot/boot.ini
In the Use Hardware Add-On section, change cs2enable to true:
Code: Select all
#------------------------------------------------------------------------------
#
# Use Hardware Add-On
#
#------------------------------------------------------------------------------
#
# If you are using your odroidxu4 in a CloudShell2 enclosure set this to true to
# enable TFT LCD and FAN control via i2c bus
# false : disabled
# true : TFT LCD and i2c bus enabled
#
# default : false
#
#------------------------------------------------------------------------------
setenv cs2enable "true"
Code: Select all
sudo lsblk
sudo dd if=/dev/zero of=/dev/sda bs=512 count=10000
sudo mkfs.ext4 /dev/sda
sudo mkdir /mnt/hdd1
sudo nano /etc/fstab
UUID=[add device UUID] /mnt/hdd1 ext4 noexec,nodev,noatime,nodiratime 0 0
Get cloudshell software from: https://github.com/hardkernel/cloudshell-lcd
Copy cloudshell-lcd and cloudshell-lcd.service to your XU4. On the XU4:
Code: Select all
chmod +x cloudshell-lcd
sudo cp cloudshell-lcd /bin/cloudshell-lcd
sudo cp cloudshell-lcd.service /lib/systemd/system/cloudshell-lcd.service
sudo systemctl enable cloudshell-lcd.service
sudo systemctl start cloudshell-lcd.service
nano fan_control.sh
Code: Select all
#!/bin/bash
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
temp_start_fan=50 #in celsius. adjust it for your own preference
cpu_temp=$(($(</sys/class/thermal/thermal_zone0/temp) / 1000))
echo "cpu temp = " $cpu_temp "C";
echo "start fan temp = " $temp_start_fan "C";
if [ $cpu_temp \> $temp_start_fan ];
then
echo "starting fan";
i2cset -y 0 0x60 0x05 0xf0; #start fan
else
echo "stopping fan";
i2cset -y 0 0x60 0x05 0xf5; #stop fan
fi;
sudo cp fan_control.sh /usr/local/sbin/fan_control.sh
sudo crontab -e
* * * * * /usr/local/sbin/fan_control.sh
Finally:
sudo reboot