Wiki source code of Control Gateway GPIOs & LEDs
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} |
2 | {{toc/}} | ||
3 | {{/box}} | ||
4 | |||
![]() |
12.1 | 5 | = Products LEDs Mapping = |
![]() |
11.1 | 6 | |
7 | {{velocity}} | ||
![]() |
10.1 | 8 | $xwiki.ssfx.use("js/xwiki/table/table.css") |
9 | $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true) | ||
10 | {{/velocity}} | ||
![]() |
1.1 | 11 | |
![]() |
15.3 | 12 | (% class="doOddEven filterable grid sortable" id="tableid" style="height:25px; width:1105px" %) |
13 | (% class="sortHeader" %)|=Model|=Global LED|=(% style="width: 74px;" %)PWR LED|=(% style="width: 107px;" %)LAN LED|=(% style="width: 119px;" %)WAn LED|=(% style="width: 111px;" %)WIFI LED|=SENSOR LED|=(% style="width: 195px;" %)4G control (Second +3.3v)|=(% style="width: 191px;" %)USB POWER(+5v) Control | ||
14 | |LPS8|((( | ||
![]() |
14.2 | 15 | GPIO28(BLUE), |
![]() |
1.1 | 16 | |
![]() |
14.2 | 17 | GPIO21(RED), |
18 | |||
![]() |
15.2 | 19 | GPIO22(GREEN(% style="background-color:transparent" %)) |
![]() |
15.3 | 20 | )))|(% style="width:74px" %)((( |
![]() |
14.2 | 21 | |
22 | |||
23 | +3.3v | ||
![]() |
15.3 | 24 | )))|(% style="width:107px" %) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %) | |(% style="width:195px" %) |(% style="width:191px" %) |
25 | |LPS8N|((( | ||
![]() |
14.2 | 26 | GPIO28(BLUE), |
27 | |||
28 | GPIO21(RED), | ||
29 | |||
![]() |
15.2 | 30 | GPIO22(GREEN(% style="background-color:transparent" %)) |
![]() |
15.3 | 31 | )))|(% style="width:74px" %)((( |
![]() |
14.2 | 32 | |
33 | |||
34 | +3.3v | ||
![]() |
15.3 | 35 | )))|(% style="width:107px" %) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %)((( |
![]() |
14.2 | 36 | GPIO16(BLUE), |
37 | |||
38 | GPIO26(RED), | ||
39 | |||
![]() |
15.2 | 40 | GPIO27(GREEN(% style="background-color:transparent" %)) |
![]() |
15.3 | 41 | )))| |(% style="width:195px" %)((( |
![]() |
15.2 | 42 | |
![]() |
14.2 | 43 | |
![]() |
15.2 | 44 | GPIO15 |
![]() |
15.3 | 45 | )))|(% style="width:191px" %) |
46 | |LG308|GPIO28(RED)|(% style="width:74px" %)+3.3v|(% style="width:107px" %)GPIO13(RED) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %)GPIO0(RED)| |(% style="width:195px" %)GPIO15 |(% style="width:191px" %)GPIO1 | ||
47 | |DLOS8|GPIO28(GREEN)|(% style="width:74px" %)+3.3v|(% style="width:107px" %) |(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)| |(% style="width:195px" %)GPIO15 |(% style="width:191px" %)GPIO1 | ||
![]() |
15.2 | 48 | |HP0C|((( |
49 | PA8(GREEN), | ||
![]() |
14.2 | 50 | |
![]() |
15.2 | 51 | PA9(RED(% style="background-color:transparent" %)) |
![]() |
15.3 | 52 | )))|(% style="width:74px" %)+3.3v|(% style="width:107px" %)((( |
![]() |
15.2 | 53 | EPHY-LINK-LED(GREEN), |
![]() |
14.2 | 54 | |
![]() |
15.2 | 55 | PA17(BLUE) |
![]() |
15.3 | 56 | )))|(% style="width:119px" %) |(% style="width:111px" %)((( |
![]() |
15.2 | 57 | |
![]() |
14.2 | 58 | |
![]() |
15.2 | 59 | PA7(RED(% style="background-color:transparent" %)) |
![]() |
15.3 | 60 | )))| |(% style="width:195px" %) |(% style="width:191px" %) |
61 | |HP0A|PA8(GREEN)|(% style="width:74px" %)+3.3v|(% style="width:107px" %)EPHY-LINK-LED|(% style="width:119px" %)PA9(RED)|(% style="width:111px" %)PA7(RED)| |(% style="width:195px" %)PA17|(% style="width:191px" %) | ||
62 | |IBB|GPIO28(GREEN)|(% style="width:74px" %)+3.3v|(% style="width:107px" %)GPIO13(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|SENSOR_LED|(% style="width:195px" %) |(% style="width:191px" %)GPIO1 | ||
63 | |LIG16|GPIO28(RED)|(% style="width:74px" %)+3.3v|(% style="width:107px" %)GPIO22(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|GPIO21(GREEN)|(% style="width:195px" %) |(% style="width:191px" %) | ||
64 | |MS14N|GPIO28(GREEN)|(% style="width:74px" %)+3.3v|(% style="width:107px" %)GPIO13(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|SENSOR_LED|(% style="width:195px" %) |(% style="width:191px" %)GPIO1 | ||
![]() |
15.2 | 65 | |
66 | |||
![]() |
1.2 | 67 | = Control LEDs & GPIOs = |
![]() |
1.1 | 68 | |
![]() |
1.2 | 69 | == OpenWrt Base OS == |
![]() |
1.1 | 70 | |
![]() |
6.1 | 71 | (% class="box infomessage" id="HControlanGeneralGPIO:" %) |
72 | ((( | ||
![]() |
8.1 | 73 | **Control a General GPIO:** |
![]() |
1.1 | 74 | |
![]() |
1.2 | 75 | **echo 18 > /sys/class/gpio/export** ~/~/ Export gpio 18 so we can use it |
76 | **echo "high" > /sys/class/gpio/gpio18/direction** ~/~/ Set direction to out and | ||
77 | set level to high. Use "low" to set direction to output and level to low | ||
78 | |||
79 | **echo 0 > /sys/class/gpio/gpio18/value** ~/~/ Set output to 0 or 1 | ||
80 | **echo "in" > /sys/class/gpio/gpio18/direction** ~/~/ Set GPIO18 as input | ||
81 | |||
82 | **cat /sys/class/gpio/gpio18/value** ~/~/ Get GPIO18 value if set input | ||
83 | ))) | ||
84 | |||
![]() |
9.1 | 85 | (% class="box infomessage" %) |
86 | ((( | ||
87 | **Control a GPIO already exported as SYSTEM LEDs .** | ||
88 | **echo 1 > /sys/class/leds/dragino2\:red\:system/brightness** ~/~/ Turn On LED dragino2:red:system | ||
89 | **echo 0 > /sys/class/leds/dragino2\:red\:system/brightness** ~/~/ Turn off LED dragino2:red:system | ||
90 | ))) | ||
91 | |||
92 | |||
![]() |
3.1 | 93 | Reference: [[http:~~/~~/www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#gpio-sysfs>>url:http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#gpio-sysfs]] |