* Ian Campbell <i...@hellion.org.uk> [2012-10-09 09:26]:
> Can someone have a look in e.g. /sys/devices/virtual/gpio or some of the
> other directories in "find /sys/ -name \*gpio\*" and see if they can
> find it?

Attached is a script I developed in 2010 which will look at the GPIOs.

> Looking at the qcontrol source it doesn't seem to have any knowledge of
> the individual fans, it just has a single fanspeed command.

I looked through my email archives and the problem appears to be
different to what I recalled.  It seems the problem is that not all
QNAP devices have a fan; if you enable the fan on those devices,
you'll get period error messages in the log file saying that it cannot
read the status of the fan.  Anyway, there are very few devices
without a fan.  I believe only the TS-109 and TS-119.  It should be
possible to detect these via GPIOs.

-- 
Martin Michlmayr
http://www.cyrius.com/
#!/bin/sh



echo 36 > /sys/class/gpio/export 2>/dev/null || true
if [ -e /sys/class/gpio/gpio36/value ]; then
        ram=$(cat /sys/class/gpio/gpio36/value)
        echo 36 > /sys/class/gpio/unexport 2>/dev/null || true
fi
echo 44 > /sys/class/gpio/export 2>/dev/null || true
if [ -e /sys/class/gpio/gpio44/value ]; then
        desktop=$(cat /sys/class/gpio/gpio44/value)
        echo 44 > /sys/class/gpio/unexport 2>/dev/null || true
fi

if [ -n "$ram" -a -n "$desktop" ]; then
        case "$ram" in
                0) # 256 MB
                        case "$desktop" in
                                0) model="TS-410U" ;;
                                1) model="TS-410" ;;
                        esac
                ;;
                1) # 512 MB
                        case "$desktop" in
                                0) model="TS-419U" ;;
                                1) model="TS-419P" ;;
                        esac
                ;;
        esac
fi

echo "Model: $model"

Reply via email to