BMX Bicycle freestyle
BMX Bicycle freestyle

Saturday, November 21, 2009

Control Room Temperature with Computer Script

Control room temperature by joining Distributed Computing project



Now it's possible to increase room temperature by donating unused CPU cycles (and get money rewards) to distributed_computing project when room is to cold


Cpu (blue) and disk (red) temperatures are steady(0-300 on x axis), when we kill distributed_computing temperatures fall (at 300), when laptop fan slows down (450) temperatures rise a slightly, and then stay at low level. High temperatures are used to increase room temperature


Hot processor means hot room, cold processor means colder room. Turning processor hot with distributed computing will slightly control room temperature.


This bash code for crontab needs installed mprime script as described here


######################
######################
Control Temperatures using Distributed Computing
######################
######################
a=$(cat /proc/acpi/thermal_zone/*/temperature | grep C | awk '{
print $2 }'| sed -n 1p )
b=$(cat /proc/acpi/thermal_zone/*/temperature | grep C | awk '{
print $2 }'| sed -n 2p )

echo current cpu temperature: $a
echo current disk temperature: $b

#when to turn distributed computing on and off
#a range 68 degrees on, off at 90
#b range: on at 54, off at 59

#turning off
if [[ $a -gt 90 && $b -gt 59 ]]; then
echo killing distributed_computing
/usr/bin/notify-send -u normal -t 4000 \
'ending distributed computing to decrease room&cpu&disk temperature and compute'
killall mprime
fi

#turning on
if [[ $a -lt 68 && $b -lt 54 ]]; then
echo starting distributed computing to increase room temperature and compute
/opt/mprime/mprime&
/usr/bin/notify-send -u normal -t 4000 \
'starting distributed computing to increase room&cpu&disk temperature and compute'
fi

0 comments:

Post a Comment