Changes between Version 1 and Version 2 of gateworks_linux_test_commands
- Timestamp:
- 02/27/2018 04:22:16 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
gateworks_linux_test_commands
v1 v2 2 2 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. 3 3 4 5 [=#pci] 4 6 == PCI == 7 See also: 8 * [wiki:newport/PCIe] 9 * [wiki:ventana/PCIe] 10 5 11 === Find available devices on the PCI Bus === 6 {{{ 12 {{{#!bash 7 13 lspci -v 8 14 }}} … … 10 16 == USB == 11 17 === Find available devices on the USB Bus === 12 {{{ 18 {{{#!bash 13 19 lsusb -v 14 20 }}} 15 21 16 22 17 === Manual Bring up madwifi Access Point === 18 This should only be used to bring up access point manually, please use webgui to configure more advanced functions and be persistent across reboots: 19 20 {{{ 21 wlanconfig ath0 create wlandev wifi0 wlanmode ap 22 iwconfig ath0 essid test 23 ifconfig ath0 up 24 }}} 25 23 [=#rtc] 26 24 == RTC == 27 25 === Read Time from RTC === 28 {{{ 26 {{{#!bash 29 27 hwclock -r 30 28 }}} 31 29 32 30 === Write current Time to RTC === 33 {{{ 31 {{{#!bash 34 32 hwclock -w 35 33 }}} 36 34 35 36 [=#hwmon] 37 37 == HWMON == 38 38 === Read Voltage === 39 39 Different voltages can be read from the board, just change in0 to any of in0 - in12[[BR]] 40 40 The voltages read are current voltage * 1000 41 {{{ 41 {{{#!bash 42 42 cat /sys/class/hwmon/hwmon0/device/in0_label 43 43 cat /sys/class/hwmon/hwmon0/device/in0_input … … 46 46 === Read Temperature === 47 47 The temp read is current temp * 10 48 {{{ 48 {{{#!bash 49 49 cat /sys/class/hwmon/hwmon0/device/temp0_input 50 50 }}} … … 54 54 === Read Current Setpoint === 55 55 The setpoint read is current setpoint * 10 56 {{{ 56 {{{#!bash 57 57 cat /sys/class/hwmon/hwmon0/device/fan0_point0 58 58 }}} … … 63 63 }}} 64 64 65 66 [=#gpio] 65 67 == GPIO == 68 69 See also: 70 * [wiki:gpio] 71 * [wiki:OpenWrt/gpio] 72 66 73 === Read GPIO === 67 Read the state of a GPIO Pin where "x" is the gpio number 68 {{{ 69 gpioctl get x 74 See a list of currentl used GPIO's: 75 {{{#!bash 76 cat /sys/kernel/debug/gpio 77 }}} 78 79 === Export A GPIO for user control === 80 {{{#!bash 81 echo 8 > /sys/class/gpio/export # export gpio 8 which will get configured as an input 70 82 }}} 71 83 72 84 === Set Direction of GPIO === 73 {{{ 74 gpioctl dirout x 75 gpioctl dirin x 85 {{{#!bash 86 echo out > /sys/class/gpio/gpio8/value # make gpio8 an output 87 echo in > /sys/class/gpio/gpio8/value # make gpio8 an input 76 88 }}} 77 89 78 90 === Set Output of GPIO === 79 {{{ 80 gpioctl clear x 81 gpioctl set x 91 {{{#!bash 92 echo 0 > /sys/class/gpio/gpio8/value # set gpio8 to logic low 93 echo 1 > /sys/class/gpio/gpio8/value # set gpio8 to logic high 82 94 }}} 83 95 84 96 === Check GPIO === 85 86 {{{ 87 cat /sys/ kernel/debug/gpio97 {{{#!bash 98 cat /sys/kernel/debug/gpio # see all gpio's 99 cat /sys/class/gpio/gpio8/value # see state of gpio8 88 100 }}} 89 101 90 === Set GPIO ===91 102 92 {{{ 93 echo 0 > /sys/class/gpio/gpio10/value #set low 94 echo 255 > /sys/class/gpio/gpio10/value #set high 95 }}} 103 [=#i2c] 104 == I2C == 105 See also: 106 * [wiki:I2C] 107 * [wiki:linux/i2c] 96 108 97 == I2C ==98 109 === Detect all available i2c devices === 99 {{{ 110 {{{#!bash 100 111 i2cdetect -f -y 0 101 112 }}} … … 103 114 === Read i2c address === 104 115 Where "x" is the device id, and "y" is the wanted address 105 {{{ 116 {{{#!bash 106 117 i2cget -f -y 0 x y 107 118 }}} … … 109 120 === Write i2c Address === 110 121 Where "x" is the device id, and "y" is the wanted address to write and "z" is the value to write 111 {{{ 122 {{{#!bash 112 123 i2cset -f -y 0 x y z 113 124 }}} 114 125 126 127 [=#kernel] 115 128 == Kernel Modules == 129 See also: 130 * [wiki:kernel] 131 116 132 === Find modules loaded by kernel === 117 {{{ 133 {{{#!bash 118 134 lsmod 119 135 }}}