SES Button to toggle Wi-Fi on TrendNet TEW-812DRU V2.1R

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
peaceLoveAndProperty
DD-WRT Novice


Joined: 30 Jun 2015
Posts: 1

PostPosted: Tue Jun 30, 2015 7:51    Post subject: SES Button to toggle Wi-Fi on TrendNet TEW-812DRU V2.1R Reply with quote
I am trying to overcome the DD-WRT defect (in the only compatible build for my router) that disables the SES button toggling Wi-Fi functionality.

I am trying to modify scripts available on the Wiki for my router and have run into some challenges.

Here is the script I'm modifying, straight from the Wiki (no modifications here):

Code:
#!/bin/sh
/sbin/gpio enable 4
echo "0" > /proc/gpio/4_out
echo "0" > /proc/gpio/4_in
while : ; do
WIFI=`nvram get ath0_net_mode`
sleep 1;
        if [ "$(cat /proc/gpio/4_in )" == "1" ]; then
        if [ "$WIFI" == "disabled" ]; then
      /sbin/gpio enable 1
      nvram set ath0_net_mode=mixed
                /sbin/ifconfig ath0 up
      /sbin/gpio enable 2
      echo "0" > /proc/gpio/4_in
      sleep 3
      /sbin/gpio disable 1
        else
      /sbin/gpio enable 3
      nvram set ath0_net_mode=disabled
                /sbin/ifconfig ath0 down
      /sbin/gpio disable 2
      echo "0" > /proc/gpio/4_in
      sleep 3
      /sbin/gpio disable 3
        fi
fi
done &


In my case, the SES button GPIO number is 7. The Wi-Fi NVRAM variable names are wl0_net_mode and wl1_net_mode.

I'm hung up at the command that (I'm assuming, since I'm new to bash commands) picks up the 'SES button push' event. I'm referring to "$(cat /proc/gpio/4_in )" == "1"

In my version of DD-WRT (v24-sp2 03/27/14 build 23808), there is no /proc/gpio. GPIO is located under /sbin and it is not a folder such that I could access /7_out and /7_in underneath it.

I would appreciate any guidance you can provide on how to pick up the SES button push event. Thanks in advance!
Sponsor
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum