Hello everyone,
I was pretty tired of the eMMC error, and I created a script that completely annihilate this error.
This error is due to the phone heating up, and the fact that custom kernels (maybe even the original kernel) don't read the sensors correctly and throttle the phone correctly. This script monitors the battery and all the CPU sensors and when it is higher than 82°C, throttle the phone.
It was tested on AEL Kernel that supports « Hard limit » command, but this script can be adapted on any other kernel. You may need busy box. You must root to run this script.
Must be placed in init.d folder.
You simply copy each script, and for example with Kernel Audiutor, create a new init.d and paste the script with the correct title.
script called cpu_temperature_daemon :
script called cpu_temperature_daemon_start to place in the same directory /system/etc/init.d/ :
There is absolutely no more eMmc errors on the Note 4 that I tested. Of course, if you already have the error, script will not fix it. It will simply prevent a clean phone from having it by preventing overheat in monitoring all sensors. No big battery hog (insignificant). The script works by monitoring the all the sensors and reducing slightly CPU performance when the phone CPU is to hot (CPU > 82°C), or battery temp > 41°C.
I was pretty tired of the eMMC error, and I created a script that completely annihilate this error.
This error is due to the phone heating up, and the fact that custom kernels (maybe even the original kernel) don't read the sensors correctly and throttle the phone correctly. This script monitors the battery and all the CPU sensors and when it is higher than 82°C, throttle the phone.
It was tested on AEL Kernel that supports « Hard limit » command, but this script can be adapted on any other kernel. You may need busy box. You must root to run this script.
Must be placed in init.d folder.
You simply copy each script, and for example with Kernel Audiutor, create a new init.d and paste the script with the correct title.
script called cpu_temperature_daemon :
Bash:
#!/system/bin/sh
argu=$1
sleeptime=15
if ! [[ $argu = start ]] then exit ; fi
lock=0
while true;
do
maxnumb=0
cpuiscool=0
temp=$(cat /sys/class/thermal/thermal_zone*/temp)
tempbat=$(cat /sys/class/power_supply/battery/batt_temp)
if ((tempbat>410)) then if [[ $lock = 0 ]] then lock=1 ; sleeptime=7 ; chmod 644 /sys/devices/system/cpu/cpu1/online ; echo 1 > /sys/devices/system/cpu/cpu1/online ;chmod 444 /sys/devices/system/cpu/cpu1/online ; echo 65 > /sys/module/msm_thermal/parameters/core_limit_temp_degC ; echo 65 > /sys/module/msm_thermal/parameters/limit_temp_degC ; fi ; fi
for line in $temp; do if ((line>78)) then if ((line<120)) then if [[ $lock = 0 ]] then lock=1 ; sleeptime=7 ; chmod 644 /sys/devices/system/cpu/cpu1/online ; echo 1 > /sys/devices/system/cpu/cpu1/online ;chmod 444 /sys/devices/system/cpu/cpu1/online ; echo 65 > /sys/module/msm_thermal/parameters/core_limit_temp_degC ; echo 65 > /sys/module/msm_thermal/parameters/limit_temp_degC ; fi ; fi ; fi ; if ((line>10)) then if ((line<110)) then maxnumb=$(($maxnumb+1)) ; fi ; fi ; if ((line>10)) then if ((line<75)) then cpuiscool=$(($cpuiscool+1)) ; fi ; fi ; done
if [[ $maxnumb = $cpuiscool ]] then if ((tempbat<411)) then if [[ $lock = 1 ]] then lock=0 ; sleeptime=15 ; chmod 644 /sys/devices/system/cpu/cpu1/online ; echo 1 > /sys/devices/system/cpu/cpu1/online ;chmod 444 /sys/devices/system/cpu/cpu1/online ; echo 82 > /sys/module/msm_thermal/parameters/limit_temp_degC ; echo 82 > /sys/module/msm_thermal/parameters/core_limit_temp_degC ; fi ; fi ; fi
sleep $sleeptime ;
done
script called cpu_temperature_daemon_start to place in the same directory /system/etc/init.d/ :
Bash:
#!/system/bin/sh
numb=$(pgrep -lf cpu_temperature_daemon | wc -l) ; if [[ $numb = 1 ]] then exit ; fi
echo 75 > /sys/module/msm_thermal/parameters/core_limit_temp_degC ; echo 75 > /sys/module/msm_thermal/parameters/limit_temp_degC
nohup /system/etc/init.d/cpu_temperature_daemon start &
There is absolutely no more eMmc errors on the Note 4 that I tested. Of course, if you already have the error, script will not fix it. It will simply prevent a clean phone from having it by preventing overheat in monitoring all sensors. No big battery hog (insignificant). The script works by monitoring the all the sensors and reducing slightly CPU performance when the phone CPU is to hot (CPU > 82°C), or battery temp > 41°C.
Last edited: