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