Table of Contents:

 

1.  Products LEDs Mapping

ModelOSGlobal LEDPWR LEDLAN LEDWAN LEDWIFI LEDSENSOR LED

4G control (Second +3.3v)

USB POWER (+5v) Control

LPS8Openwrt

GPIO28(BLUE),

GPIO21(RED),

GPIO22(GREEN)

 

+3.3v

 GPIO17(RED)    
LPS8NOpenwrt

GPIO28(BLUE),

GPIO21(RED),

GPIO22(GREEN)

 

+3.3v

 GPIO17(RED)

GPIO16(BLUE),

GPIO26(RED),

GPIO27(GREEN)

 

 

GPIO15

 
LG308OpenwrtGPIO28(RED)+3.3vGPIO13(RED) GPIO17(RED)GPIO0(RED) GPIO15 GPIO1
DLOS8OpenwrtGPIO28(GREEN)+3.3v GPIO17(GREEN)GPIO0(GREEN) GPIO15 GPIO1

HP0C

LPS8V2

Armbian

PA8(GREEN),

PA9(RED)

+3.3v

EPHY-LINK-LED(GREEN),

PA17(BLUE)

 

 

PA7(RED)

   
HP0AArmbianPA8(GREEN)+3.3vEPHY-LINK-LEDPA9(RED)PA7(RED) PA17 
IBBOpenwrtGPIO28(GREEN)+3.3vGPIO13(GREEN)GPIO17(GREEN)GPIO0(GREEN)SENSOR_LED GPIO1
LIG16OpenwrtGPIO28(RED)+3.3vGPIO22(GREEN)GPIO17(GREEN)GPIO0(GREEN)GPIO21(GREEN)  
MS14NOpenwrtGPIO28(GREEN)+3.3vGPIO13(GREEN)GPIO17(GREEN)GPIO0(GREEN)SENSOR_LED GPIO1

2.   Control LEDs & GPIOs

2.1  OpenWrt Base OS

Control a General GPIO:

echo 18 > /sys/class/gpio/export     // Export gpio 18 so we can use it
echo "high" > /sys/class/gpio/gpio18/direction   //  Set direction to out and
set level to high. Use "low" to set direction to output and level to low

echo 0 > /sys/class/gpio/gpio18/value    // Set output to 0 or 1
echo "in" > /sys/class/gpio/gpio18/direction  // Set GPIO18 as input

cat  /sys/class/gpio/gpio18/value  // Get GPIO18 value if set input

Control a GPIO already exported as SYSTEM LEDs .
echo 1 > /sys/class/leds/dragino2\:red\:system/brightness  // Turn On LED dragino2:red:system
echo 0 > /sys/class/leds/dragino2\:red\:system/brightness  // Turn off LED dragino2:red:system

Reference: http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#gpio-sysfs

2.2  Armbian Base OS