peaceLoveAndProperty DD-WRT Novice
Joined: 30 Jun 2015 Posts: 1
|
Posted: Tue Jun 30, 2015 7:51 Post subject: SES Button to toggle Wi-Fi on TrendNet TEW-812DRU V2.1R |
|
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! |
|