Control Gateway GPIOs & LEDs

Version 14.2 by Xiaoling on 2022/05/07 16:21
Warning
For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

Products LEDs Mapping

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:Main.Control Gateway GPIOs & LEDs.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

ModelGlobal LEDPWR LEDLAN LEDWAn LEDWIFI LEDSENSOR LED4G control (Second +3.3v)USB POWER(+5v) Control
LPS8

GPIO28(BLUE),

GPIO21(RED),

GPIO22(GREEN)

 

+3.3v

          

 GPIO17(RED)    
LPS8N

GPIO28(BLUE),

GPIO21(RED),

GPIO22(GREEN)

 

+3.3v

 GPIO17(RED)

GPIO16(BLUE),

GPIO26(RED),

GPIO27(GREEN)

 GPIO15 
LG308GPIO28(RED)+3.3vGPIO13(RED) GPIO17(RED) GPIO0(RED) GPIO15 GPIO1
DLOS8GPIO28(GREEN)+3.3v GPIO17(GREEN) GPIO0(GREEN) GPIO15 GPIO1
HP0CPA8(GREEN),PA9(RED)+3.3vEPHY-LINK-LED(GREEN),PA17(BLUE) PA7(RED)   
HP0APA8(GREEN)+3.3vEPHY-LINK-LEDPA9(RED)PA7(RED) PA17 
IBBGPIO28(GREEN)+3.3vGPIO13(GREEN)GPIO17(GREEN)GPIO0(GREEN)SENSOR_LED GPIO1
LIG16GPIO28(RED)+3.3vGPIO22(GREEN)GPIO17(GREEN)GPIO0(GREEN)GPIO21(GREEN)  
MS14NGPIO28(GREEN)+3.3vGPIO13(GREEN)GPIO17(GREEN)GPIO0(GREEN)SENSOR_LED GPIO1

Control LEDs & GPIOs

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