Add a hotplug button event script to launch the process. I modified directly the hostapd package source ( /package/hostapd/files/wps-hotplug.sh ), as the hotplug script gets automatically installed to
/etc/hotplug.d/button/50-wps
with the package. See below.
The script launches hostapd_cli for each radio and lights the WPS led for 10 seconds. There is no monitoring of the result, or anything like that. It is just a dumb script using the hostapd_cli command to pass the message to the hostapd daemon.
Note: button is called
BTN_1
in Backfire,
wps
in trunk. /etc/hotplug.d/button/50-wps
if [ "$ACTION" = "pressed" -a "$BUTTON" = "BTN_1" ]; then
for dir in /var/run/hostapd-*; do
[ -d "$dir" ] || continue
logger "WPS button active: $dir"
hostapd_cli -p "$dir" wps_pbc
/etc/config/wireless
config 'wifi-iface'
option 'device' 'radio0'
option 'network' 'lan'
option 'mode' 'ap'
option 'ssid' 'public'
option 'encryption' 'psk2'
option 'key' 'SecretKey'
option 'wps_pushbutton' '1'
If everything goes ok, you should see in Syslog not only the button events, but also succesful WPS authentication.
最小的配置是为复位按钮设置正确的值。复位按钮在 trunk 中被称为 'reset' ,在 Backfire final 中被称为 'BTN_0' 。
uci set system.@restorefactory[0].button=reset
uci commit system
在恢复出厂设置后你必须重新安装和配置 restorefactory
软件包。如果你编译了自己的含有已经配置好 restorefactory
的镜像,可以跳过本步。
闪存颗粒: v1: Spansion S25FL064P (FL064PIF) or Macronix MX25L6405DMI-12G Macronix MX25L12845EWI-10G ? ?
闪存容量: 8192 KiB 16384 KiB 8192 KiB 128 MiB NAND
RAM芯片: 2X Nanya NT5DS16M16CS-5T ? ? ?
RAM: 64 MiB 128 MiB
无线模块: Atheros AR9223 802.11bgn / Atheros AR9220 802.11an ? ? ?
有线模块: Realtek RTL8366SR ? ? ?
Internet: n/a
USB: 有 1 x 2.0
Serial: 有
JTAG: 有
Voltage Reg: 有
To remove the cover use a Torx (T-8) screwdriver.
There are two screws easily visible on the bottom of the case.
There are four more screws under the rubber feet. The feet are not glued to the plastic and can easily be removed and pushed back into place once reassembled. The feet have rubber tethers, but you can slide them out gently without damaging them, and later you can reinsert them just as easily. Don't forget to put them in a plastic baggie so you don't lose them!
If you have a basic familiarity with RS232 signals and putting together basic electronic components, you should be able to follow these instructions to create a cable to attach to the WNDR3700's serial port.
The author of this section prefers a two-step process, that of using a USB-to-9-pin-serial (DB9) connector for the computer, and then building a separate 9-pin-serial-to-board interface. This allows you to leave the connector plugged into the board all of the time (and close the plastic case of the router!), without having a USB dongle hanging around when not using it. If you use a ribbon cable to connect to the header on the router, you can actually snake it out between the 4-port LAN jack and the WAN jack and still get the router's case back on (albeit a bit snugly), so the system looks pretty clean and polished even after adding the serial port connector.
For the computer-to-9-pin-serial part, you probably have two options:
Buy a Nokia CA-42 cable and be comfortable stripping wires and using a multimeter.
Buy a premade USB-to-DB9 RS232 serial cable. IMPORTANT NOTE I haven't bothered to look to see if the standard RS232 voltages are compatible with the WNDR3700 board. I think I recall reading somewhere that the CA-42 cable is 3.3V, and I don't recall offhand what RS232 calls for. If you buy a premade USB-to-DB9 RS232 cable, make sure to check the output levels with a voltmeter to ensure that you don't fry anything!
If you buy a premade USB-to-DB9 RS232 cable, this step is already done. (Whichever method you use, make sure that your OS has drivers for the USB converter that you are planning to use!)
If you go the CA-42 cable route, follow the “Determining the wiring assignment of your cable” steps listed in this page: http://buffalo.nas-central.org/index.php/Use_a_Nokia_Serial_Cable_on_an_ARM9_Linkstation. This page refers to a different router product, but the CA-42 cable being used is the same and your goal is to determine the pin/color assignments. You have to chop off the fancy Nokia connector and then strip wires to test wire colors with your multimeter to figure out which color corresponds to which Nokia pin number. Once you've figured that out:
Pin 6 of the Nokia connector should be wired to pin 3 on the DB9.
Pin 7 of the Nokia connector should be wired to pin 2 on the DB9.
Pin 8 of the Nokia connector should be wired to pin 5 on the DB9.
You should wire this cable with a male DB9 connector, which will connect to the female connector that you put on the board side of things.
For step 2:
For connecting to the WNDR3700 itself, forum user whiskas previously posted the pinout of the connector at http://img387.imageshack.us/i/26102009417.jpg/. The four pins on the board (reading from left to right in whiskas's photo) correspond to DB9 pin numbers 5, 3, 2 and no connection. You'll probably want to buy a crimp-style socket (I used a “IDC 10-pin dual row socket”, which has more pins than we need but which works fine) and a ribbon cable that connects to it. Buy a 9-pin female DB9, carefully sort out which pins in the ribbon cable need to be connected to what, and crimp them into the right place. If you use crimp-style connectors, you can do this with no tools other than steady hands, and the IDC socket will slide right onto the board without having to solder anything.
If, for whatever reason, you would prefer to avoid tftp flashing, it's possible to load a new image with ymodem (loady) or kermit (loadb). It's a good idea to use iminfo to verify the image's checksum before copying it to flash with cp.b. Remember to use the sysupgrade .bin file even if this is your initial flash from the factory firmware; the extra header in the factory .img is NOT required when flashing from U-Boot.
ar7100> loady 80800000
## Ready for binary (ymodem) download to 0x80800000 at 115200 bps...
(Begin the ymodem or kermit transfer)
## Total Size = 0x004d0004 = 5046276 Bytes
ar7100> iminfo 80800000
## Checking Image at 80800000 ...
Image Name: MIPS OpenWrt Linux-3.3.8
Created: 2012-07-01 17:49:09 UTC
Image Type: MIPS Linux Unknown Image (uncompressed)
Data Size: 914224 Bytes = 892.8 kB
Load Address: bf070000
Entry Point: bf070000
Verifying Checksum ... OK
ar7100> erase 0xbf070000 +0x004d0004
Erase Flash from 0xbf070000 to 0xbf54ffff in Bank # 1
First 0x7 last 0x54 sector size 0x10000
Erased 78 sectors
ar7100> cp.b 0x80800000 0xbf070000 0x004d0004
Copy to Flash... write addr: bf070000
ar7100> boot
Note that the size value (0x004d0004 in this case) will vary from one image to another. Don't omit the “+” in the erase command as it's part of the command's syntax.
According to the release notes in the NETGEAR-supplied GPL firmware, U-Boot can be upgraded using the following procedure. Note that you do not need to update U-Boot in order to install OpenWrt. Additionally, this has not yet been tested by the author of this wiki page, and you can permanently brick your router (with little hope of recovery, other than possibly finding a JTAG interface) if your U-boot image becomes corrupted:
Please burn u-boot-wndr3700-dni6-V1.7.bin
Set up a tftp server on your PC, its ip address is 192.168.1.12.
Entering into boot loader
ag7100> set serverip 192.168.1.12
ag7100> tftp 0x80010000 u-boot-wndr3700-dni6-V1.7.bin
ag7100> erase 0xbf000000 +0x70000
ag7100> cp.b 0x80010000 0xbf000000 0x50000
ag7100> reset
Entering into boot loader again
ag7100>bootm
Then the device should be in tftp recovery mode. Please run the command
"tftp -i 192.168.1.1 put WNDR3700U-V1.0.4.49.img" on MS-DOS of your PC.
**128 MB**
Top of RAM usable for U-Boot at: 88000000
Reserving 315k for U-Boot at: 87fb0000
Reserving 192k for malloc() at: 87f80000
Reserving 44 Bytes for Board Info at: 87f7ffd4
Reserving 36 Bytes for Global Data at: 87f7ffb0
Reserving 128k for boot params() at: 87f5ffb0
Stack Pointer at: 87f5ff98
Now running in RAM - U-Boot at: 87fb0000
id read 0x100000ff
flash size 8MB, sector count = 128
Flash: 8 MB
In: serial
Out: serial
Err: serial
Net: ag7100_enet_initialize...
Antenna Mod
The procedure below covers hardware revision 1. Revision 2 only has U.FL connectors for the 5
GHz
antennas (PJ2 and PJ4), while the 2.4
GHz
connectors are replaced with dummy connectors (presumably a Hirose testing connectors used in production). So for revision 2 the PJ5 and PJ6 connectors will have to bypassed and the coax cable soldered directly to the PCB.
You will need: