GPIO can be used to switch something on/off or read in some digital sensor signal, like motion detector. In previous files was described how to use Arduino and USBserial communication for GPIO. From open WRT website GPIO fro WRT160NL 4 outputs and 2 inputs: pin function 6 LED_WLAN 8 LED_WPS_BLUE 9 LED_WPS_AMBER 14 LED_POWER 7 BTN_WPS 21 BTN_RESET GPIO was supported opkg list_installed|grep gpio kmod-input-gpio-buttons - 2.6.39.4-1 kmod-input-gpio-keys-polled - 2.6.39.4-1 kmod-leds-gpio - 2.6.39.4-1 ----------------------------------------------------------------- LED control works nicely cd /sys/devices/platform/leds-gpio/leds wrt160nl:amber:wps wrt160nl:blue:wlan wrt160nl:blue:power wrt160nl:blue:wps cd wrt160nl:amber:wps echo "1" > brightness echo "0" > brightness echo "1" > /sys/devices/platform/leds-gpio/leds/wrt160nl:amber:wps/brightness cat trigger [none] timer default-on netdev phy0rx phy0tx phy0assoc phy0radio phy0tpt usbdev blinking LED echo timer > trigger echo 250 >delay_on echo 550 >delay_off ----------------------------------------------------------------- GPIO Inputs First tried buttons in directory cd /sys/devices/platform/gpio-keys-polled but could not find anything that contains button state. Next tried classical Linux method on pin 7 (WPS button according to OpenWRT webpage) cd /sys/class/gpio echo 7 > /sys/class/gpio/export does not work, probably button is in use by OpenWRT Half a day later found solution in a Polish forum: http://openwrt.tytanos.pl/wrt160nl/GPIO/GPIO_wrt160nl.jpg GPIO 13 is RX pin nr 3 on the five pin connector echo 13 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio13/direction echo 0 > /sys/devices/virtual/gpio/gpio13/value echo 1 > /sys/devices/virtual/gpio/gpio13/value GPIO 0 is LED4 that has not been soledered in. echo 0 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio0/direction echo 0 > /sys/devices/virtual/gpio/gpio0/value echo 1 > /sys/devices/virtual/gpio/gpio0/value Works! Now tested GPIO 13 as input echo 13 > /sys/class/gpio/export echo in > /sys/class/gpio/gpio13/direction cat /sys/devices/virtual/gpio/gpio13/value does not work, always gives value 1, probably because of serial port driver echo 0 > /sys/class/gpio/export echo in > /sys/class/gpio/gpio0/direction cat /sys/devices/virtual/gpio/gpio0/value works nicely. So I soldered a PIR motion detector board output to place of LED4.