wiki:gateworks_linux_test_commands

Version 1 (modified by trac, 7 years ago) ( diff )

--

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

cat /sys/class/hwmon/hwmon0/device/in0_label
cat /sys/class/hwmon/hwmon0/device/in0_input

Read Temperature

The temp read is current temp * 10

cat /sys/class/hwmon/hwmon0/device/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

cat /sys/class/hwmon/hwmon0/device/fan0_point0

Write new Setpoint

Value to write is new temperatore * 10

echo 450 > /sys/class/hwmon/hwmon0/device/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
Note: See TracWiki for help on using the wiki.