# Cool Music

**URL:** <https://community.volumio.com/t/cool-music/10680>\
**Category:** Diy Volumio Projects\
**Created:** [July 10, 2019, 8:20pm UTC](https://community.volumio.com/t/cool-music/10680 "2019-07-10T20:20:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![timetherington](https://community.volumio.com/user_avatar/community.volumio.com/timetherington/32/715_2.png) [@timetherington](https://community.volumio.com/u/timetherington)\
**Post date:** [July 10, 2019, 8:20pm UTC](https://community.volumio.com/t/cool-music/10680/1 "2019-07-10T20:20:27Z")

</div>

I have Volumio running on a RPi 3B+ with a Hifiberry Amp+ DAC driving some Klipsh AW-400 outdoor speakers mounted on the side of my garage. I live on a corner lot so my garage is a separate building with one wall facing my patio. I also live in the Mojave desert so the garage can get pretty hot in the summer. My RPi started overheating last summer so I set up a fan to cool it.

First, I found [a USB powered fan](https://www.amazon.com/gp/product/B073SPQJ6L). Not a fan that is charged using USB but powered by it. It also needed to have a goose neck so I could point it at the RPi.

Now, at this point, I could have just left it. The fan would run while the RPi had power. But really. Where’s the fun in that? I wanted to be able to turn the fan on and off as needed. I found that the CPU temp is stored at /sys/class/thermal/thermal\_zone0/temp. So I figured that I can read it and if the CPU temp gets above 70° C I should turn on the fan because the overtemp warning happens at 80° C. But how can I control the USB ports?

I found the program [uhubctl](https://github.com/mvp/uhubctl) on Github that would do the trick. It is a Linux program that can control smart USB hubs. Fortunately, the RPi has that and it is one the program can handle.

Now all I needed to do was write a program to read the CPU temp and flip the USB port as needed. I created a Bash script that would do it and then added it to cron so that it runs every 5 minutes. Here’s what the setup looks like:

![IMG_3479.png](https://community.volumio.com/uploads/default/original/2X/2/2eb4830002c3edaa7a45eb425609307bdc7a2852.png)  
Kind of ugly but it works well. The cover is off the RPi so the fan can blow into it. The white cables are the speaker wires.

If you’re interested, [here](http://www.byfarthersteps.com/?p=6802) are my full set up instructions.
