Changes between Version 6 and Version 7 of gateworks_linux_test_commands


Ignore:
Timestamp:
05/25/17 10:57:47 (4 months ago)
Author:
tharvey
Comment:

updated examples with kernel-agnostic sysfs path

Legend:

Unmodified
Added
Removed
Modified
  • gateworks_linux_test_commands

    v6 v7  
    44== PCI == 
    55=== Find available devices on the PCI Bus === 
    6 {{{ 
     6{{{#!bash 
    77lspci -v 
    88}}} 
     
    1010== USB == 
    1111=== Find available devices on the USB Bus === 
    12 {{{ 
     12{{{#!bash 
    1313lsusb -v 
    1414}}} 
     
    1818This should only be used to bring up access point manually, please use webgui to configure more advanced functions and be persistent across reboots: 
    1919 
    20 {{{ 
     20{{{#!bash 
    2121wlanconfig ath0 create wlandev wifi0 wlanmode ap 
    2222iwconfig ath0 essid test 
     
    2626== RTC == 
    2727=== Read Time from RTC === 
    28 {{{ 
     28{{{#!bash 
    2929hwclock -r 
    3030}}} 
    3131 
    3232=== Write current Time to RTC === 
    33 {{{ 
     33{{{#!bash 
    3434hwclock -w 
    3535}}} 
     
    3939Different voltages can be read from the board, just change in0 to any of in0 - in12[[BR]] 
    4040The voltages read are current voltage * 1000 
    41 {{{ 
    42 cat /sys/class/hwmon/hwmon0/device/in0_label 
    43 cat /sys/class/hwmon/hwmon0/device/in0_input 
     41{{{#!bash 
     42DIR=$(find /sys/bus/i2c/devices/0-0029/ -name in0_input) 
     43DIR=${DIR%/*} 
     44cat $DIR/in0_label 
     45cat $DIR/in0_input 
    4446}}} 
    4547 
    4648=== Read Temperature === 
    4749The temp read is current temp * 10 
    48 {{{ 
    49 cat /sys/class/hwmon/hwmon0/device/temp0_input 
     50{{{#!bash 
     51DIR=$(find /sys/bus/i2c/devices/0-0029/ -name in0_input) 
     52DIR=${DIR%/*} 
     53cat $DIR/temp0_input 
    5054}}} 
    5155 
     
    5458=== Read Current Setpoint === 
    5559The setpoint read is current setpoint * 10 
    56 {{{ 
    57 cat /sys/class/hwmon/hwmon0/device/fan0_point0 
     60{{{#!bash 
     61DIR=$(find /sys/bus/i2c/devices/0-0029/ -name in0_input) 
     62DIR=${DIR%/*} 
     63cat $DIR/fan0_point0 
    5864}}} 
    5965=== Write new Setpoint === 
    6066Value to write is new temperatore * 10 
    61 {{{ 
    62 echo 450 > /sys/class/hwmon/hwmon0/device/fan0_point0 
     67{{{#!bash 
     68DIR=$(find /sys/bus/i2c/devices/0-0029/ -name in0_input) 
     69DIR=${DIR%/*} 
     70echo 450 > $DIR/fan0_point0 
    6371}}} 
    6472 
     
    6674=== Read GPIO === 
    6775Read the state of a GPIO Pin where "x" is the gpio number 
    68 {{{ 
     76{{{#!bash 
    6977gpioctl get x 
    7078}}} 
    7179 
    7280=== Set Direction of GPIO === 
    73 {{{ 
     81{{{#!bash 
    7482gpioctl dirout x 
    7583gpioctl dirin x 
     
    7785 
    7886=== Set Output of GPIO === 
    79 {{{ 
     87{{{#!bash 
    8088gpioctl clear x 
    8189gpioctl set x 
     
    8391 
    8492=== Check GPIO === 
    85  
    86 {{{ 
     93{{{#!bash 
    8794cat /sys/kernel/debug/gpio 
    8895}}} 
    8996 
    9097=== Set GPIO === 
    91  
    92 {{{ 
     98{{{#!bash 
    9399echo 0 > /sys/class/gpio/gpio10/value #set low 
    94100echo 255 > /sys/class/gpio/gpio10/value #set high 
     
    97103== I2C == 
    98104=== Detect all available i2c devices === 
    99 {{{ 
     105{{{#!bash 
    100106i2cdetect -f -y 0 
    101107}}} 
     
    103109=== Read i2c address === 
    104110Where "x" is the device id, and "y" is the wanted address 
    105 {{{ 
     111{{{#!bash 
    106112i2cget -f -y 0 x y 
    107113}}} 
     
    109115=== Write i2c Address === 
    110116Where "x" is the device id, and "y" is the wanted address to write and "z" is the value to write 
    111 {{{ 
     117{{{#!bash 
    112118i2cset -f -y 0 x y z 
    113119}}} 
     
    115121== Kernel Modules == 
    116122=== Find modules loaded by kernel === 
    117 {{{ 
     123{{{#!bash 
    118124lsmod 
    119125}}}