Wiki source code of Control Gateway GPIOs & LEDs

Version 24.24 by Xiaoling on 2023/04/13 16:22

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