Wiki source code of Control Gateway GPIOs & LEDs
Version 17.1 by Edwin Chen on 2022/05/29 08:04
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{box cssClass="floatinginfobox" title="**Contents**"}} | ||
2 | {{toc/}} | ||
3 | {{/box}} | ||
4 | |||
5 | = Products LEDs Mapping = | ||
6 | |||
7 | {{velocity}} | ||
8 | $xwiki.ssfx.use("js/xwiki/table/table.css") | ||
9 | $xwiki.jsfx.use("js/xwiki/table/tablefilterNsort.js", true) | ||
10 | {{/velocity}} | ||
11 | |||
12 | (% class="doOddEven filterable grid sortable" id="tableid" style="height:25px; width:1020px" %) | ||
13 | (% class="sortHeader" %)|=(% style="width: 69px;" %)Model|=(% style="width: 75px;" %)OS|=(% style="width: 130px;" %)Global LED|=(% style="width: 93px;" %)PWR LED|=(% style="width: 95px;" %)LAN LED|=(% style="width: 119px;" %)WAN LED|=(% style="width: 111px;" %)WIFI LED|=SENSOR LED|=(% style="width: 133px;" %)((( | ||
14 | 4G control | ||
15 | |||
16 | (Second +3.3v) | ||
17 | )))|=(% style="width: 134px;" %)((( | ||
18 | USB POWER | ||
19 | |||
20 | (+5v) Control | ||
21 | ))) | ||
22 | |(% style="width:69px" %)LPS8|(% style="width:75px" %)Openwrt|(% style="width:130px" %)((( | ||
23 | GPIO28(BLUE), | ||
24 | |||
25 | GPIO21(RED), | ||
26 | |||
27 | GPIO22(GREEN(% style="background-color:transparent" %)) | ||
28 | )))|(% style="width:93px" %)((( | ||
29 | |||
30 | |||
31 | +3.3v | ||
32 | )))|(% style="width:95px" %) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %) | |(% style="width:133px" %) |(% style="width:134px" %) | ||
33 | |(% style="width:69px" %)LPS8N|(% style="width:75px" %)Openwrt|(% style="width:130px" %)((( | ||
34 | GPIO28(BLUE), | ||
35 | |||
36 | GPIO21(RED), | ||
37 | |||
38 | GPIO22(GREEN(% style="background-color:transparent" %)) | ||
39 | )))|(% style="width:93px" %)((( | ||
40 | |||
41 | |||
42 | +3.3v | ||
43 | )))|(% style="width:95px" %) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %)((( | ||
44 | GPIO16(BLUE), | ||
45 | |||
46 | GPIO26(RED), | ||
47 | |||
48 | GPIO27(GREEN(% style="background-color:transparent" %)) | ||
49 | )))| |(% style="width:133px" %)((( | ||
50 | |||
51 | |||
52 | GPIO15 | ||
53 | )))|(% style="width:134px" %) | ||
54 | |(% style="width:69px" %)LG308|(% style="width:75px" %)Openwrt|(% style="width:130px" %)GPIO28(RED)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)GPIO13(RED) |(% style="width:119px" %)GPIO17(RED)|(% style="width:111px" %)GPIO0(RED)| |(% style="width:133px" %)GPIO15 |(% style="width:134px" %)GPIO1 | ||
55 | |(% style="width:69px" %)DLOS8|(% style="width:75px" %)Openwrt|(% style="width:130px" %)GPIO28(GREEN)|(% style="width:93px" %)+3.3v|(% style="width:95px" %) |(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)| |(% style="width:133px" %)GPIO15 |(% style="width:134px" %)GPIO1 | ||
56 | |(% style="width:69px" %)((( | ||
57 | HP0C | ||
58 | |||
59 | LPS8V2 | ||
60 | )))|(% style="width:75px" %)Armbian|(% style="width:130px" %)((( | ||
61 | PA8(GREEN), | ||
62 | |||
63 | PA9(RED(% style="background-color:transparent" %)) | ||
64 | )))|(% style="width:93px" %)+3.3v|(% style="width:95px" %)((( | ||
65 | EPHY-LINK-LED(GREEN), | ||
66 | |||
67 | PA17(BLUE) | ||
68 | )))|(% style="width:119px" %) |(% style="width:111px" %)((( | ||
69 | |||
70 | |||
71 | PA7(RED(% style="background-color:transparent" %)) | ||
72 | )))| |(% style="width:133px" %) |(% style="width:134px" %) | ||
73 | |(% style="width:69px" %)HP0A|(% style="width:75px" %)Armbian|(% style="width:130px" %)PA8(GREEN)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)EPHY-LINK-LED|(% style="width:119px" %)PA9(RED)|(% style="width:111px" %)PA7(RED)| |(% style="width:133px" %)PA17|(% style="width:134px" %) | ||
74 | |(% style="width:69px" %)IBB|(% style="width:75px" %)Openwrt|(% style="width:130px" %)GPIO28(GREEN)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)GPIO13(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|SENSOR_LED|(% style="width:133px" %) |(% style="width:134px" %)GPIO1 | ||
75 | |(% style="width:69px" %)LIG16|(% style="width:75px" %)Openwrt|(% style="width:130px" %)GPIO28(RED)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)GPIO22(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|GPIO21(GREEN)|(% style="width:133px" %) |(% style="width:134px" %) | ||
76 | |(% style="width:69px" %)MS14N|(% style="width:75px" %)Openwrt|(% style="width:130px" %)GPIO28(GREEN)|(% style="width:93px" %)+3.3v|(% style="width:95px" %)GPIO13(GREEN)|(% style="width:119px" %)GPIO17(GREEN)|(% style="width:111px" %)GPIO0(GREEN)|SENSOR_LED|(% style="width:133px" %) |(% style="width:134px" %)GPIO1 | ||
77 | |||
78 | = Control LEDs & GPIOs = | ||
79 | |||
80 | == OpenWrt Base OS == | ||
81 | |||
82 | (% class="box infomessage" id="HControlanGeneralGPIO:" %) | ||
83 | ((( | ||
84 | **Control a General GPIO:** | ||
85 | |||
86 | **echo 18 > /sys/class/gpio/export** ~/~/ Export gpio 18 so we can use it | ||
87 | **echo "high" > /sys/class/gpio/gpio18/direction** ~/~/ Set direction to out and | ||
88 | set level to high. Use "low" to set direction to output and level to low | ||
89 | |||
90 | **echo 0 > /sys/class/gpio/gpio18/value** ~/~/ Set output to 0 or 1 | ||
91 | **echo "in" > /sys/class/gpio/gpio18/direction** ~/~/ Set GPIO18 as input | ||
92 | |||
93 | **cat /sys/class/gpio/gpio18/value** ~/~/ Get GPIO18 value if set input | ||
94 | ))) | ||
95 | |||
96 | (% class="box infomessage" %) | ||
97 | ((( | ||
98 | **Control a GPIO already exported as SYSTEM LEDs .** | ||
99 | **echo 1 > /sys/class/leds/dragino2\:red\:system/brightness** ~/~/ Turn On LED dragino2:red:system | ||
100 | **echo 0 > /sys/class/leds/dragino2\:red\:system/brightness** ~/~/ Turn off LED dragino2:red:system | ||
101 | ))) | ||
102 | |||
103 | |||
104 | 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]] |