| 1 | = Gateworks Linux Example Test Commands = |
| 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 | |
| 4 | == PCI == |
| 5 | === Find available devices on the PCI Bus === |
| 6 | {{{ |
| 7 | lspci -v |
| 8 | }}} |
| 9 | |
| 10 | == USB == |
| 11 | === Find available devices on the USB Bus === |
| 12 | {{{ |
| 13 | lsusb -v |
| 14 | }}} |
| 15 | |
| 16 | |
| 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 | |
| 26 | == RTC == |
| 27 | === Read Time from RTC === |
| 28 | {{{ |
| 29 | hwclock -r |
| 30 | }}} |
| 31 | |
| 32 | === Write current Time to RTC === |
| 33 | {{{ |
| 34 | hwclock -w |
| 35 | }}} |
| 36 | |
| 37 | == HWMON == |
| 38 | === Read Voltage === |
| 39 | Different voltages can be read from the board, just change in0 to any of in0 - in12[[BR]] |
| 40 | The 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 |
| 44 | }}} |
| 45 | |
| 46 | === Read Temperature === |
| 47 | The temp read is current temp * 10 |
| 48 | {{{ |
| 49 | cat /sys/class/hwmon/hwmon0/device/temp0_input |
| 50 | }}} |
| 51 | |
| 52 | === Set Fan Setpoint === |
| 53 | The fan controller has 5 setpoints ranging from 50% on to 100% on, corresponding with fan0_point0 (50%) to fan0_poing5 (100%) |
| 54 | === Read Current Setpoint === |
| 55 | The setpoint read is current setpoint * 10 |
| 56 | {{{ |
| 57 | cat /sys/class/hwmon/hwmon0/device/fan0_point0 |
| 58 | }}} |
| 59 | === Write new Setpoint === |
| 60 | Value to write is new temperatore * 10 |
| 61 | {{{ |
| 62 | echo 450 > /sys/class/hwmon/hwmon0/device/fan0_point0 |
| 63 | }}} |
| 64 | |
| 65 | == GPIO == |
| 66 | === Read GPIO === |
| 67 | Read the state of a GPIO Pin where "x" is the gpio number |
| 68 | {{{ |
| 69 | gpioctl get x |
| 70 | }}} |
| 71 | |
| 72 | === Set Direction of GPIO === |
| 73 | {{{ |
| 74 | gpioctl dirout x |
| 75 | gpioctl dirin x |
| 76 | }}} |
| 77 | |
| 78 | === Set Output of GPIO === |
| 79 | {{{ |
| 80 | gpioctl clear x |
| 81 | gpioctl set x |
| 82 | }}} |
| 83 | |
| 84 | === Check GPIO === |
| 85 | |
| 86 | {{{ |
| 87 | cat /sys/kernel/debug/gpio |
| 88 | }}} |
| 89 | |
| 90 | === Set GPIO === |
| 91 | |
| 92 | {{{ |
| 93 | echo 0 > /sys/class/gpio/gpio10/value #set low |
| 94 | echo 255 > /sys/class/gpio/gpio10/value #set high |
| 95 | }}} |
| 96 | |
| 97 | == I2C == |
| 98 | === Detect all available i2c devices === |
| 99 | {{{ |
| 100 | i2cdetect -f -y 0 |
| 101 | }}} |
| 102 | |
| 103 | === Read i2c address === |
| 104 | Where "x" is the device id, and "y" is the wanted address |
| 105 | {{{ |
| 106 | i2cget -f -y 0 x y |
| 107 | }}} |
| 108 | |
| 109 | === Write i2c Address === |
| 110 | Where "x" is the device id, and "y" is the wanted address to write and "z" is the value to write |
| 111 | {{{ |
| 112 | i2cset -f -y 0 x y z |
| 113 | }}} |
| 114 | |
| 115 | == Kernel Modules == |
| 116 | === Find modules loaded by kernel === |
| 117 | {{{ |
| 118 | lsmod |
| 119 | }}} |