wiki:gateworks_linux_test_commands

Gateworks Linux Example Test Commands

Following is a list of commands that are available in the BSP from Gateworks that can be used in order to test the functionality of the product. Users can use these commands to further the functionality of there application.

PCI

Find available devices on the PCI Bus

lspci -v

USB

Find available devices on the USB Bus

lsusb -v

Manual Bring up madwifi Access Point

This should only be used to bring up access point manually, please use webgui to configure more advanced functions and be persistent across reboots:

wlanconfig ath0 create wlandev wifi0 wlanmode ap
iwconfig ath0 essid test
ifconfig ath0 up

RTC

Read Time from RTC

hwclock -r

Write current Time to RTC

hwclock -w

HWMON

Read Voltage

Different voltages can be read from the board, just change in0 to any of in0 - in12
The voltages read are current voltage * 1000

DIR=$(find /sys/bus/i2c/devices/0-0029/ -name in0_input)
DIR=${DIR%/*}
cat $DIR/in0_label
cat $DIR/in0_input

Read Temperature

The temp read is current temp * 10

DIR=$(find /sys/bus/i2c/devices/0-0029/ -name in0_input)
DIR=${DIR%/*}
cat $DIR/temp0_input

Set Fan Setpoint

The fan controller has 5 setpoints ranging from 50% on to 100% on, corresponding with fan0_point0 (50%) to fan0_poing5 (100%)

Read Current Setpoint

The setpoint read is current setpoint * 10

DIR=$(find /sys/bus/i2c/devices/0-0029/ -name in0_input)
DIR=${DIR%/*}
cat $DIR/fan0_point0

Write new Setpoint

Value to write is new temperatore * 10

DIR=$(find /sys/bus/i2c/devices/0-0029/ -name in0_input)
DIR=${DIR%/*}
echo 450 > $DIR/fan0_point0

GPIO

Read GPIO

Read the state of a GPIO Pin where "x" is the gpio number

gpioctl get x

Set Direction of GPIO

gpioctl dirout x
gpioctl dirin x

Set Output of GPIO

gpioctl clear x
gpioctl set x

Check GPIO

cat /sys/kernel/debug/gpio

Set GPIO

echo 0 > /sys/class/gpio/gpio10/value #set low
echo 255 > /sys/class/gpio/gpio10/value #set high

I2C

Detect all available i2c devices

i2cdetect -f -y 0

Read i2c address

Where "x" is the device id, and "y" is the wanted address

i2cget -f -y 0 x y

Write i2c Address

Where "x" is the device id, and "y" is the wanted address to write and "z" is the value to write

i2cset -f -y 0 x y z

Kernel Modules

Find modules loaded by kernel

lsmod
Last modified 5 weeks ago Last modified on 05/25/17 10:57:47