Inspired by the good folks at https://forum.openwrt.org/viewtopic.php?id=32516 I decided to build a prototype Router Temperature Controller.
I used an old AR430 (AR2713 cpu) I had in my old junk bin.
I used http://tinyhack.com/blog/2010/04/04/d-l … nd-sd-mod/ as a guide to find the GPIO's.
Quick note, this can ruin you router so proceed with caution.
Also you need some skill and tools so judge accordingly your on your own.
Key parts are a MAXIM DS1621 and an optocoupled FET SPST solid state switch AVQ251, cpu 12 volt fan, power supply etc.
Other misc components, resistors, capacitors, LED, etc are needed.
In Canada these are available from Digikey.
A drawing is available at http://imageshack.us/photo/my-images/401/routerfan.jpg/
I can also send an OpenOffice odf drawing upon request.
I haven't tried it yet but you should be able to adapt this to other routers.
Double check and triple check all your wiring. Things can go "poof" real quick.
For the software and configuration I did a new build from trunk for Atheros.
I included these packages with out Luci:
custom build for ar2317 atheros
ATTITUDE ADJUSTMENT (bleeding edge, r29471)
i2c-tools - 3.0.3-1
gpioctl - 1.0-1
kmod-i2c-algo-bit - 2.6.37.6-1
kmod-i2c-core - 2.6.37.6-1
kmod-i2c-gpio - 2.6.37.6-1
kmod-i2c-gpio-custom - 2.6.37.6-2
kmod-i2c-mux - 2.6.37.6-1
From the above link I used GPIO 3 and 4.
Set the GPIO pins that you have selected:
echo i2c-gpio-custom bus0=0,3,4 > /etc/modules.d/58-i2c-gpio-custom
After a restart I did check dmesg and verify:
i2c /dev entries driver
Custom GPIO-based I2C driver version 0.1.1
i2c-gpio i2c-gpio.0: using pins 3 (SDA) and 4 (SCL)
Find address of I2C device:
root@OpenWrt:~# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- 49 -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
So I can see my I2C address is 0X49, kool!
Test the SD1621 device:
Start Convert EEh
i2cget 0 0x49 0xee w
Read Temperature AAh
i2cget 0 0x49 0xaa b
Write Config
i2cget 0 0x49 0xac 0x0a w
Verify with a read
i2cget 0 0x49 0xac w
Set High Temp point
i2cset 0 0x49 0xa1 0x1e b
Verify with a read
i2cget 0 0x49 0xa1 b
Set low Temp point
i2cset 0 0x49 0xa2 0x1c b
Verify with a read
i2cget 0 0x49 0xa2 b
Monitor fan or led to verify operation.
I have changed the high and low temperature setpoints and they work on the fly.
If you power down the router and temperature controller you will have to restart the temperature controller however it will keep going once set.
The configuration is in EEram so it stays even on power down.
The router has no further burden except for the start and configuration changes.
I did verything from the console.
I hope this helps someone..
~john