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