Re: [OpenWrt-Devel] How to config GPIO and read the GPIO value in OpenWRT

2015-10-18 Thread Afkar Rafique
I have configured button definition in the mach-file as below: .desc = "LAN WIFI button", .type = EV_KEY, .code = KEY_LAN_WIFI_BUTTON, .debounce_interval = DB120_KEYS_DEBOUNCE_INTERVAL, .g

Re: [OpenWrt-Devel] How to config GPIO and read the GPIO value in OpenWRT

2015-10-17 Thread Hartmut Knaack
Afkar Rafique schrieb am 16.10.2015 um 03:47: > Thanks for the reply. > > I have change the script as below: > > #!/bin/sh /etc/rc.common > > START=19 > start() { > echo in > /sys/class/gpio/gpio16/direction 2> /dev/null > echo 16 > /sys/class/gpio/export 2> /dev/nu

Re: [OpenWrt-Devel] How to config GPIO and read the GPIO value in OpenWRT

2015-10-15 Thread Afkar Rafique
Thanks for the reply. I have change the script as below: #!/bin/sh /etc/rc.common START=19 start() { echo in > /sys/class/gpio/gpio16/direction 2> /dev/null echo 16 > /sys/class/gpio/export 2> /dev/null if [ "$(cat /sys/class/gpio/gpio16/value)" == "1" ] ; then

Re: [OpenWrt-Devel] How to config GPIO and read the GPIO value in OpenWRT

2015-10-15 Thread Hartmut Knaack
Afkar Rafique schrieb am 15.10.2015 um 04:07: > Thanks for the reply. > > i have Create /etc/init.d/buttons and written below script: > > #!/bin/sh /etc/rc.common > START=19 > start() { > /bin/umount /etc/config 2>/dev/null > echo out > /sys/class/gpio/gpio16/direction 2> /dev/nul

Re: [OpenWrt-Devel] How to config GPIO and read the GPIO value in OpenWRT

2015-10-14 Thread Afkar Rafique
Thanks for the reply. i have Create /etc/init.d/buttons and written below script: #!/bin/sh /etc/rc.common START=19 start() { /bin/umount /etc/config 2>/dev/null echo out > /sys/class/gpio/gpio16/direction 2> /dev/null echo 16 > /sys/class/gpio/export 2> /dev/null

Re: [OpenWrt-Devel] How to config GPIO and read the GPIO value in OpenWRT

2015-10-14 Thread Martin Blumenstingl
On Wed, Oct 14, 2015 at 12:19 PM, Afkar Rafique wrote: > Could anyone please explain how i can configure and read GPIO value. There's an article on the wiki which explains how to set a GPIO to a specific value: [0] If you want to read a GPIO value then you use direction "in" and then simply cat to

Re: [OpenWrt-Devel] How to config GPIO and read the GPIO value in OpenWRT

2015-10-14 Thread smilebef
Am Wed, 14 Oct 2015 18:19:45 +0800 schrieb Afkar Rafique : > Hi, > > I am working on AR9344 Openwrt. I need to configure the GPIO16 and > read the status of GPIO. > > Based on GPIO read value, has to ON/OFF the status LED. > > Could anyone please explain how i can configure and read GPIO value.

[OpenWrt-Devel] How to config GPIO and read the GPIO value in OpenWRT

2015-10-14 Thread Afkar Rafique
Hi, I am working on AR9344 Openwrt. I need to configure the GPIO16 and read the status of GPIO. Based on GPIO read value, has to ON/OFF the status LED. Could anyone please explain how i can configure and read GPIO value. Regards, ___ openwrt-devel mai