I’m trying to install fan script for konstakang’s lineage based Android TV image.
Could anybody help? trying to “adb shell sh argon1.sh” But not working do I need libreelec one or does neither work. image is on nvme ssd and works but fan never starts and chip throttles.
You are going to have to use a script to monitor the fan.
First install Magisk so that you can add scripts to startup. Then boot into normal mode, goto settings - system - developer options and enable adb. Once enabled connect through adb with root access and put the script below in /data/adb/service.d/argon_fan.sh
argon_fan.sh
#!/system/bin/sh
sleeptime=120
while true
do
cputemp=$(cat /sys/class/thermal/thermal_zone0/temp)
if [[ $cputemp -lt 55000 ]]; then
fanspeed="0x00"
elif [ $cputemp -ge 55000 -a $cputemp -lt 60000 ]; then
fanspeed="0x10"
elif [ $cputemp -ge 60000 -a $cputemp -lt 65000 ]; then
fanspeed="0x32"
elif [ $cputemp -ge 65000 ]; then
fanspeed="0x64"
fi
i2cset -y 1 0x01a 0x80 $fanspeed i
sleep $sleeptime
done
Copy over the rc_keymap.txt file to /boot/rc_keymap.txt
Reboot into normal mode
Goto settings - system - developer options and enable adb
Connect through adb with root access
Edit the config.txt (nano /boot/config.txt) and change dtoverlay=gpio-ir,gpio_pin= from 18 to 23.
Save and exit
Run ‘ir-keytable -r /boot/rc_keymap.txt’ (If you get an error on formatting line one, it is likely not a unix file. If using Windows it can be created with notepad++ with line endings switched to unix)
I’m a novice with this to a degree and would ask if you could elaborate a little further.
I’m on an Apple Mac computer and Lineage installed on a Rpi 4 with 120gb SSD.
I’ve installed adb (as far as I’m aware) on my mac via brew.
I’ve enabled developer options, and rooted debugging in lineage. I’ve also tried installing Magisk, but no so sure if its installed correctly.
How do I create the file /data/adb/service.d/aragon_fan.sh, or how do I locate this?
I’ve searched around, but I can’t find detailed instructions on how to do this.
I understand and should be able to do the IR reviver via BBEdit, I just don’t understand the fan part above.
I believe I’ve got the fan script installed, but having issues with the IR Remote installation.
I’ve tried adb (via my imac), nano /boot/config.txt, but get a blank nano page.
I disconnect the Argon and plugsed the SSD usb port dirctly into my imac and edited the config.txt
When reconnect the Argon to the TV the IR Remote doesn’t work and the gpio pin is still set to 18.
I I type in my Mac terminal while in adb “find /boot”, “find /boot/config.txt”, or “find /config.txt” , it does find anything “no such file or directory”. Then double checked that I’m still connected to the RPi running Lineage?
Any ideas?
config.txt is a file, not a directory. So commands like “cd” must fail by design. If you start with a slash ‘/’ then you use a “absolute” path not a “relative”! This can be important, because the path must be exists. You can try to get the current path with pwd, maybe you saw only a shortcut in the adb shell and the absolute path couldn’t match.
On your screenshot you were already in the path “boot” and ls listed the config.txt file. I wouldn’t had expect that the nano editor is available (because it’s not a Linux distribution). The mostly supported command to show the content should be cat config.txt if you already in the correct path. And if vi is available vi config.txt to edit the file. If neither vi nor nano are available, the fallback option is to use pull / push to update the config.txt via download to your Mac, update the file and afterwards upload again.
Also the config.txt could be currently a empty file in the worst case, but it shouldn’t. Try to verify that with ls -la command to get timestamp and size information.
Hint: The boot partiton is the first partition at the SD card with a FAT32 partiton type and should be accessible via Finder at your Mac. On that way you could edit the config.txt file as well.
Please note: If you have inserted an NVMe and an SD card at the same time, there may be 2 boot partitions: 1 on the NVMe and 1 on the SD card!
Thank you, that make sense with reading your explanation and correcting my confusion of the directory and file.
I’ve managed to open the config.txt file and also went to edit it with vi, but ironically the line i needed to edit is already done (from when I connect the SSD directly to my Mac).
I’ve rebooted, but the remote doesn’t seem to work?
Have you inserted an SD card/connected a USB mass storage device in parallel? I ask because a second reboot with closed terminals sounds like the first reboot was not performed or the system read another copy of config.txt.
The RPi5 detection of an NVMe SSD connected via PCIe can be unstable and in such cases boot from another device if a boot partition with config.txt is also found there. This could be an explanation for the strange behavior that you had to change the config.txt multiple times. Each time a different copy of the config.txt. To rule this out, make sure you remove the SD card and only boot from NVMe or vice versa.
No, no sd card, just the SSD, but I did also have a usb dongle inserted with the ‘rc_keymap.txt’ file and a usb cable connecting the RPi to my computer. I also had (i think) 2 terminal windows open and connected.
Another factor could have been the position of the Argon case, being that the sun was shining through my window and directly on the IR receiver. So it might not have needed the 2nd reboot and the sun was preventing the receiver from detecting.
Again, Thank you for your help. I’d have got nowhere without your intervention.
Thanks a lot for the scripts!
Is there a possibility to assign 2 functions to the same key? I would like the “ok” button to execute KEY_KPENTER and KEY_PLAY/PAUSE
I can navigate perfectly all the menus but an app requires the play/pause instruction to function properly and neither KEY_KPENTER nor KEY_OK work to make it pause