What's new

Can WPS be activated on RT-N66U via software?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

bertc

New Around Here
Hello all,

I'm looking for a means to initiate the WPS function without having to physically press the WPS button on the router, or physically click the Start button on the Wireless->WPS web page of the admin web interface. I'm currently running Merlin-build version 3.0.0.4.372.31.

Is there a method to do this?

Thank you
 
So I've looked in the sorce code and found a function named start_wps_method() in wps-broadcom.c (within the release/src/router/rc/sysdeps directory). And I'm trying to mimic what it does.

I first run the comands:
nvram set wl0_closed=0
nvram set wl_closed=0
nvram commit
service restart_wireless

Next I run:
nvram set wps_proc_status=0
nvram commit

Then I create a UDP socket (like set_wps_end() does) and I send the following to port 40500:
SET wps_method=2 wps_sta_pin=00000000 wps_action=3 wps_config_command=1 wps_pbc_method=2 wps_ifname=eth1
(I've verified the above by watching the console output while using the WebUI to initiate WPS.)

Lastly, I run:
nvram set wps_uptime=115430
nvram commit

But I can't get the power to flash as like it does when I press the WPS button on the back of the router.

Does anyone have any suggestions outside of re-building Merlin's code with some functionality that I add? I'd like to use Merlin's build without modifying it myself.

Thanks
 
I don't know because I never looked at the WPS code, however if you check the WPS page, it should be easier there to see what is going on when pressing the button on the webpage. See also which services are restarted by that page through action_script.
 
I was able to get this working mimicing what was in wps-broadcom.c. Trying to debug the webUI method led to trying to find out what "apply.cgi" was doing, which I cannot find. (But then web applications always contain some "magic" ;)
 
I was able to get this working mimicing what was in wps-broadcom.c. Trying to debug the webUI method led to trying to find out what "apply.cgi" was doing, which I cannot find. (But then web applications always contain some "magic" ;)

From the WPSContent webui page:

Code:
function enableWPS(){
        document.form.action_script.value = "restart_wireless";
        document.form.action_mode.value = "apply_new";
        document.form.action_wait.value = "3";
        applyRule();
}

What the webui does is restart the entire wireless subsystem. Through a script this would become:

Code:
service restart_wireless
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top