DIR300B1 and trouble with WPS button

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


Joined: 13 Jul 2010
Posts: 15

PostPosted: Sun Aug 22, 2010 21:45    Post subject: DIR300B1 and trouble with WPS button Reply with quote
DIR300NRU
P / N: RUR300EEU .... B1G
Firmware: DD-WRT v24-sp2 (08/07/10) std

Installed successfully, without any apparent glitches. (Ubuntu + Mozilla)

Installed because of the need to turn off Wi-fi on the schedule and the inclusion of (off) by pressing the side button (WPS). However, after inclusion of the corresponding function (applied, reboot), pressing the button does not bring any results (Wi-fi is not turned off).

If you have any ideas to solve this problem, please help.

Thank you in advance.

PS: Sorry for my english. Translated from google. Smile
Sponsor
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17638
Location: Hesse/Germany

PostPosted: Mon Aug 23, 2010 18:59    Post subject: Reply with quote
do
http://www.dd-wrt.com/wiki/index.php/Broadcom_detection#Detecting_Reset.2FWPS.2FAOSS.2Fetc_Button

_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
Devostator
DD-WRT Novice


Joined: 13 Jul 2010
Posts: 15

PostPosted: Tue Aug 24, 2010 0:48    Post subject: Reply with quote
WPS Button:

gpio 0:

pressed = 00
unpressed = 01

WPS led on:
gpio disable 13
WPS led off:
gpio enable 13

However, I do not know where to change the script in DDWRT to WPS button was working (turned on and off Wi-fi).

Thank you for your help.
Devostator
DD-WRT Novice


Joined: 13 Jul 2010
Posts: 15

PostPosted: Tue Aug 24, 2010 22:51    Post subject: Reply with quote
I found a script dir615 and changed under DIR300NRU (B1):

# Generate SESButton script and make it executable
logger -s -p local0.notice -t WirelessToggle "Generating SESButton script"
mkdir /tmp/etc/config/
echo "if [ \`ifconfig | grep ra0\` == "" ]; then
logger -s -p local0.notice -t WirelessToggle \"Current wireless status: Off, Turning wireless on...\"
/sbin/ifconfig ra0 up
/sbin/gpio enable 13
else
logger -s -p local0.notice -t WirelessToggle \"Current wireless status: On, Turning wireless off...\"
/sbin/ifconfig ra0 down
/sbin/gpio disable 13
fi
" > /tmp/etc/config/wifi_toggle.sesbutton
chmod +x /tmp/etc/config/wifi_toggle.sesbutton
logger -s -p local0.notice -t WirelessToggle "SESButton script generated and ready for use"

Save in Startup -> reboot -> pressed WPS button = not working

echo "
/sbin/ifconfig ra0 up
/sbin/gpio disable 13
" > /tmp/etc/config/wifi_toggle.sesbutton
chmod +x /tmp/etc/config/wifi_toggle.sesbutton

Save in Startup -> reboot -> pressed WPS button = not working

checked via telnet:
/tmp/etc/config/wifi_toggle.sesbutton = script creates

checked via telnet:
/sbin/ifconfig ra0 up (works)
/sbin/gpio disable 13 (works)

checked WPS button:
gpio poll 0
pressed = 00
unpressed = 01

Conclusion: The firmware does not run scripts .sesbutton pressing WPS button?

Please help
st4ck
DD-WRT Novice


Joined: 16 Aug 2010
Posts: 21
Location: Italy

PostPosted: Wed Aug 25, 2010 7:25    Post subject: Reply with quote
Hi Devostator, I had the same problem with WPS & right site buttons on my DIR300B1. To solve the problem I've created a script (that run in background) and check that the button (gpio 0 for example) is pressed. To check state of button I've maked a new C app from sources of ralink gpio. If you tell me the link of your firmware, I can edit it, and add support to WPS button.

Who need there's my sources/binary for my gpio app here: http://dev.st4ck.com/index.php?dir=gpio
Usage example:
- ./gpioread 13 0 (= gpio disable 13)
- ./gpioread 0 (= gpio poll 0)
- ./gpioread 9 1 (= gpio enable 9)
- ./gpioread 4 (= gpio poll 4)

Bye ^^
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17638
Location: Hesse/Germany

PostPosted: Wed Aug 25, 2010 8:14    Post subject: Reply with quote
@Devostator

this script will do whatever it does once and thats it...what do u expect? right now its crap.

_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
Devostator
DD-WRT Novice


Joined: 13 Jul 2010
Posts: 15

PostPosted: Wed Aug 25, 2010 10:22    Post subject: Reply with quote
Sorry... First time working with scripts.

st4ck
Be grateful for the help.

http://www.dd-wrt.com/routerdb/de/download/D-Link/DIR-300/B1/dir300b-revb-ddwrt-webflash.bin/3576
st4ck
DD-WRT Novice


Joined: 16 Aug 2010
Posts: 21
Location: Italy

PostPosted: Wed Aug 25, 2010 11:05    Post subject: Reply with quote
The new firmware is: http://dev.st4ck.com/dir300b1-wps/dir300b1-st4ck-v2flash-wps.bin

I've added gpioread in /sbin/
On startup a script called '0wifi' run in background.

0wifi source:
Code:
#!/bin/sh

while [ true ]; do
 gpioread 1 > /dev/null 2> /dev/null
 PRESSED=`gpioread 0`
 if [ $PRESSED -eq "00" ]; then
  echo "GPIO 0 PRESSED"
  /tmp/etc/config/wifi_toggle.sesbutton
  sleep 1
 fi
 usleep 200000
done


When right button is pressed the script /tmp/etc/config/wifi_toggle.sesbutton is called

I've not tried, but i hope that it works Smile
You must flash my firmware from emergency room, bye Wink
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17638
Location: Hesse/Germany

PostPosted: Wed Aug 25, 2010 17:37    Post subject: Reply with quote
BS checked our settings agian you info and he stated that the wps button should work as expected. plz install the latest beta.
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!


Last edited by Sash on Thu Aug 26, 2010 7:43; edited 1 time in total
Devostator
DD-WRT Novice


Joined: 13 Jul 2010
Posts: 15

PostPosted: Wed Aug 25, 2010 23:02    Post subject: Reply with quote
to st4ck
It`s alive!!! It`s alive!! )))

to Sash
The latest firmware that I found: DD-WRT v24-sp2 (08/07/10) std - build 14896
If there is any newer firmware, then please give me a link to them.

Thank you all very much for your help. Very Happy
st4ck
DD-WRT Novice


Joined: 16 Aug 2010
Posts: 21
Location: Italy

PostPosted: Thu Aug 26, 2010 7:26    Post subject: Reply with quote
Hi, the latest build is 14929, DIR300b1 here: http://www.dd-wrt.com/site/support/other-downloads?path=others/eko/BrainSlayer-V24-preSP2/08-12-10-r14929/dlink-dir300-revb/
Devostator
DD-WRT Novice


Joined: 13 Jul 2010
Posts: 15

PostPosted: Thu Aug 26, 2010 10:11    Post subject: Reply with quote
Install: Firmware Version DD-WRT v24-sp2 (08/12/10) std - build 14929 = WPS button not work Sad And off wi-fi on a schedule does not happen (in the previous firmware too)...

Need a script (maybe a cron?), which would execute the commands ifconfig ra0 down ifconfig ra0 up and at a certain time (eg 02:00 - off and 09:00 - on).

I would be very grateful for the help.
Devostator
DD-WRT Novice


Joined: 13 Jul 2010
Posts: 15

PostPosted: Thu Aug 26, 2010 11:41    Post subject: Reply with quote
CRON was not difficult. Smile Thanks again everyone for your help
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Ralink 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 cannot attach files in this forum
You cannot download files in this forum