OpenWrt Forum Archive

Topic: WNDR3700 exploration

The content of this topic has been archived between 1 Oct 2014 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

metamat,

good first post :-) and thanks for all the clarifications on what you did to get things running.
I will join you in exploring the nice new side of my WNDR3700. I have a spare one laying around exactly for these things.

Hein

WNDR3700 for newbies

I've seen a lot of stuff fly back and forth on this thread regarding the steps needed to bring up the firmware on the WNDR3700. I figured out a lot via trial and error (being mostly an OpenWRT newbie myself), so in the spirit of sharing, I will post my complete notes on how to build a WNDR3700 image from scratch, including working WiFi on 2.4G and 5G bands. I haven't tried to use the snapshot builds posted on openwrt.org, so I can't comment on their usability.

I've also gleaned various pieces of info from the thread that I will include here in more detail too, including:

- building a compatible serial cable, and
- unbricking the router via TFTP recovery (which does NOT require a serial cable or fancy timing checks)

These instructions are working fine for me as of the relatively-recent trunk revision 19064.

By the way, to metamatt: I don't know about your router, but the NETGEAR default admin login and password are printed right on the bottom of my case. :-)

1. Get your development OS ready

I used Ubuntu 9.10. I installed on a VMware virtual machine, but you can install it on VirtualBox or bare hardware if you like. If you don't have it already, download a Ubuntu ISO and install it. Give yourself at least a 15 Gb disk (preferably 20 or more) since OpenWRT builds take up a lot of space.

2. Prep your development system for OpenWRT

For Ubuntu, you'll need to install a bunch of packages to get the OpenWRT buildroot system to work:

sudo apt-get install subversion  g++ ncurses-term zlib1g-dev gawk flex patch openssh-server minicom tftp tftpd

3. Check out the OpenWRT code (bleeding edge from the trunk):

mkdir openwrt
cd openwrt
svn co svn://svn.openwrt.org/openwrt/trunk/

4. Set up OpenWRT BuildRoot for the WNDR3700 board:

cd ~/openwrt/trunk
make menuconfig

Make the following selections beyond the defaults. You could conceivably do this using one of the trunk snapshot images and loading kernel modules, but I haven't tried.

1) Target System: Atheros AR71xx/AR7240/AR913x

2) Target Profile: NETGEAR WNDR3700

3) Target Images: if you want to build a ramdisk image, select "ramdisk" and ensure that LZMA compression is listed. Otherwise, leave the defaults alone (should be jffs2, squashfs and tgz). You seemingly need to rebuild everything except the toolchain if you want to switch from the ramdisk to a firmware image or vice versa.

4) Image Configuration: Use this section to set up the defaults for the LAN ports on your router. If you don't have a serial cable connected to the router, you'll need to do this so that you can access the router once your newly-flashed code boots up. I recommend entering values for DNS server (on your ISP's network), LAN network mask (for the addresses to be doled out via DHCP), and LAN IP address (private IP address on your router's side).

eg. LAN DNS = (whatever your ISP tells you to use), LAN network mask=255.255.255.0, LAN IP address=192.168.0.1

5) Network -> CRDA = YES (compile as built-in package with "*", not as a module with "M")

6) Kernel Modules -> Other Modules -> kmod-leds-wndr3700-usb = YES (compile as built-in driver as "*", not as a module with "M")

7) Kernel Modules -> Wireless Drivers -> kmod-ath -> Force Atheros drivers to respect the user's regdomain settings = YES

If you want to slap a USB memory stick in the back of your router to allow you to install many more packages, also add the following four sets of modules to the configuration to support FAT and ext2 external media:

1) Kernel modules->Filesystems->kmod-fs-ext2, kmod-fs-msdos, kmod-fs-vfat, kmod-nls-cp437, kmod-nls-cp850, kmod-nls-iso8859-1, kmod-nls-iso8859-15, kmod-nls-utf8  = BUILT IN

2) Kernel modules->USB support->kmod-usb-storage, kmod-usb2, kmod-usb-uhci, kmod-usb-ohci

3) Base system->busybox (select the package to access the semi-hidden config menu)->configuration->Linux system utilities->fat filesystem (note that "fat filesystem" is not in the list in alphabetical order)
Base system->busybox->Configuration->Linux system utilities-> mount->support specifying devices by label or uuid

4) Utilities->Filesystem->e2fsprogs


In case anyone cares, here is a copy of my current .config file. At the very least, you'll want to edit the DNS server address in the "image configuration" step (see #4 above) if you use this.

#
# Automatically generated make config: don't edit
# OpenWrt version: Kamikaze (r19064)
# Fri Jan  8 05:57:46 2010
#
CONFIG_HAVE_DOT_CONFIG=y
CONFIG_TARGET_ar71xx=y
CONFIG_TARGET_ar71xx_WNDR3700=y
CONFIG_TARGET_BOARD="ar71xx"
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time"
CONFIG_LINUX_2_6_30=y
CONFIG_DEFAULT_base-files=y
CONFIG_DEFAULT_busybox=y
CONFIG_DEFAULT_dnsmasq=y
CONFIG_DEFAULT_dropbear=y
CONFIG_DEFAULT_firewall=y
CONFIG_DEFAULT_hostapd-mini=y
CONFIG_DEFAULT_hotplug2=y
CONFIG_DEFAULT_iptables=y
CONFIG_DEFAULT_kmod-ath9k=y
CONFIG_DEFAULT_kmod-button-hotplug=y
CONFIG_DEFAULT_kmod-input-core=y
CONFIG_DEFAULT_kmod-input-gpio-buttons=y
CONFIG_DEFAULT_kmod-input-polldev=y
CONFIG_DEFAULT_kmod-ipt-nathelper=y
CONFIG_DEFAULT_kmod-leds-gpio=y
CONFIG_DEFAULT_kmod-usb-core=y
CONFIG_DEFAULT_kmod-usb-ohci=y
CONFIG_DEFAULT_kmod-usb2=y
CONFIG_DEFAULT_libc=y
CONFIG_DEFAULT_libgcc=y
CONFIG_DEFAULT_mtd=y
CONFIG_DEFAULT_opkg=y
CONFIG_DEFAULT_ppp=y
CONFIG_DEFAULT_ppp-mod-pppoe=y
CONFIG_DEFAULT_uci=y
CONFIG_DEFAULT_ucitrigger=y
CONFIG_DEFAULT_udevtrigger=y
CONFIG_LINUX_2_6=y
CONFIG_GPIO_SUPPORT=y
CONFIG_PCI_SUPPORT=y
CONFIG_USB_SUPPORT=y
CONFIG_BIG_ENDIAN=y
CONFIG_USES_SQUASHFS=y
CONFIG_USES_JFFS2=y
CONFIG_USES_TGZ=y
CONFIG_mips=y
CONFIG_ARCH="mips"

CONFIG_TARGET_ROOTFS_INITRAMFS=y
CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA=y

CONFIG_X86_GRUB_ROOTPART="/dev/sda2"
CONFIG_X86_GRUB_BOOTOPTS=""
CONFIG_OLPC_BOOTSCRIPT_ROOTPART="/dev/sda2"


CONFIG_LARGEFILE=y
CONFIG_SHADOW_PASSWORDS=y
CONFIG_USE_SSTRIP=y


CONFIG_KERNEL_DEBUG_FS=y
CONFIG_DOWNLOAD_FOLDER=""
CONFIG_AUTOREBUILD=y
CONFIG_BUILD_SUFFIX=""
CONFIG_TARGET_ROOTFS_DIR=""
CONFIG_EXTERNAL_KERNEL_TREE=""
CONFIG_KERNEL_GIT_CLONE_URI=""
CONFIG_KERNEL_GIT_LOCAL_REPOSITORY=""
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time"
CONFIG_SOFT_FLOAT=y
CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS=""
CONFIG_BINUTILS_VERSION="2.19.1"
CONFIG_GCC_VERSION_4_3_3_CS=y
CONFIG_EXTRA_GCC_CONFIG_OPTIONS=""
CONFIG_INSTALL_LIBSTDCPP=y
CONFIG_USE_UCLIBC=y
CONFIG_GCC_VERSION="4.3.3+cs"
CONFIG_GCC_VERSION_4=y
CONFIG_GCC_VERSION_4_3=y
CONFIG_UCLIBC_VERSION="0.9.30.1"
CONFIG_LIBC="uClibc"
CONFIG_LIBC_VERSION="0.9.30.1"
CONFIG_TARGET_SUFFIX="uclibc"
CONFIG_UCI_PRECONFIG=y
CONFIG_UCI_PRECONFIG_network_lan_dns="11.22.33.44"
CONFIG_UCI_PRECONFIG_network_lan_proto="static"
CONFIG_UCI_PRECONFIG_network_lan_gateway=""
CONFIG_UCI_PRECONFIG_network_lan_netmask="255.255.255.0"
CONFIG_UCI_PRECONFIG_network_lan_ipaddr="192.168.0.1"

CONFIG_PACKAGE_base-files=y
CONFIG_PACKAGE_busybox=y

CONFIG_BUSYBOX_CONFIG_FEATURE_2_6_MODULES=y
CONFIG_BUSYBOX_CONFIG_HAVE_DOT_CONFIG=y


CONFIG_BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
CONFIG_BUSYBOX_CONFIG_SHOW_USAGE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VERBOSE_USAGE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_COMPRESS_USAGE=y
CONFIG_BUSYBOX_CONFIG_LONG_OPTS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DEVPTS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_PIDFILE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_SUID=y
CONFIG_BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS=y
CONFIG_BUSYBOX_CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HAVE_RPC=y

CONFIG_BUSYBOX_CONFIG_LFS=y
CONFIG_BUSYBOX_CONFIG_CROSS_COMPILER_PREFIX=""
CONFIG_BUSYBOX_CONFIG_EXTRA_CFLAGS=""

CONFIG_BUSYBOX_CONFIG_NO_DEBUG_LIB=y
CONFIG_BUSYBOX_CONFIG_INCLUDE_SUSv2=y

CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_SYMLINKS=y
CONFIG_BUSYBOX_CONFIG_PREFIX="./_install"

CONFIG_BUSYBOX_CONFIG_PASSWORD_MINLEN=6
CONFIG_BUSYBOX_CONFIG_MD5_SIZE_VS_SPEED=2
CONFIG_BUSYBOX_CONFIG_FEATURE_FAST_TOP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_MAX_LEN=512
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_HISTORY=256
CONFIG_BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION=y
CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_COPYBUF_KB=4
CONFIG_BUSYBOX_CONFIG_IOCTL_HEX2STR_ERROR=y


CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ=y
CONFIG_BUSYBOX_CONFIG_BUNZIP2=y
CONFIG_BUSYBOX_CONFIG_GUNZIP=y
CONFIG_BUSYBOX_CONFIG_GZIP=y
CONFIG_BUSYBOX_CONFIG_TAR=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_CREATE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_FROM=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y

CONFIG_BUSYBOX_CONFIG_BASENAME=y
CONFIG_BUSYBOX_CONFIG_CAT=y
CONFIG_BUSYBOX_CONFIG_CHGRP=y
CONFIG_BUSYBOX_CONFIG_CHMOD=y
CONFIG_BUSYBOX_CONFIG_CHOWN=y
CONFIG_BUSYBOX_CONFIG_CHROOT=y
CONFIG_BUSYBOX_CONFIG_CP=y
CONFIG_BUSYBOX_CONFIG_CUT=y
CONFIG_BUSYBOX_CONFIG_DATE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DATE_ISOFMT=y
CONFIG_BUSYBOX_CONFIG_DD=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
CONFIG_BUSYBOX_CONFIG_DF=y
CONFIG_BUSYBOX_CONFIG_DIRNAME=y
CONFIG_BUSYBOX_CONFIG_DU=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
CONFIG_BUSYBOX_CONFIG_ECHO=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_ECHO=y
CONFIG_BUSYBOX_CONFIG_ENV=y
CONFIG_BUSYBOX_CONFIG_EXPR=y
CONFIG_BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64=y
CONFIG_BUSYBOX_CONFIG_FALSE=y
CONFIG_BUSYBOX_CONFIG_HEAD=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_HEAD=y
CONFIG_BUSYBOX_CONFIG_HOSTID=y
CONFIG_BUSYBOX_CONFIG_ID=y
CONFIG_BUSYBOX_CONFIG_LENGTH=y
CONFIG_BUSYBOX_CONFIG_LN=y
CONFIG_BUSYBOX_CONFIG_LS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LS_FILETYPES=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LS_SORTFILES=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LS_USERNAME=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LS_COLOR=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y
CONFIG_BUSYBOX_CONFIG_MD5SUM=y
CONFIG_BUSYBOX_CONFIG_MKDIR=y
CONFIG_BUSYBOX_CONFIG_MKFIFO=y
CONFIG_BUSYBOX_CONFIG_MKNOD=y
CONFIG_BUSYBOX_CONFIG_MV=y
CONFIG_BUSYBOX_CONFIG_NICE=y
CONFIG_BUSYBOX_CONFIG_PRINTF=y
CONFIG_BUSYBOX_CONFIG_PWD=y
CONFIG_BUSYBOX_CONFIG_RM=y
CONFIG_BUSYBOX_CONFIG_RMDIR=y
CONFIG_BUSYBOX_CONFIG_SEQ=y
CONFIG_BUSYBOX_CONFIG_SLEEP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP=y
CONFIG_BUSYBOX_CONFIG_SORT=y
CONFIG_BUSYBOX_CONFIG_SYNC=y
CONFIG_BUSYBOX_CONFIG_TAIL=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_TAIL=y
CONFIG_BUSYBOX_CONFIG_TEE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO=y
CONFIG_BUSYBOX_CONFIG_TEST=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TEST_64=y
CONFIG_BUSYBOX_CONFIG_TOUCH=y
CONFIG_BUSYBOX_CONFIG_TR=y
CONFIG_BUSYBOX_CONFIG_TRUE=y
CONFIG_BUSYBOX_CONFIG_UNAME=y
CONFIG_BUSYBOX_CONFIG_UNIQ=y
CONFIG_BUSYBOX_CONFIG_WC=y
CONFIG_BUSYBOX_CONFIG_YES=y

CONFIG_BUSYBOX_CONFIG_FEATURE_PRESERVE_HARDLINKS=y

CONFIG_BUSYBOX_CONFIG_FEATURE_AUTOWIDTH=y

CONFIG_BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE=y

CONFIG_BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y

CONFIG_BUSYBOX_CONFIG_CLEAR=y
CONFIG_BUSYBOX_CONFIG_RESET=y

CONFIG_BUSYBOX_CONFIG_MKTEMP=y
CONFIG_BUSYBOX_CONFIG_START_STOP_DAEMON=y
CONFIG_BUSYBOX_CONFIG_WHICH=y

CONFIG_BUSYBOX_CONFIG_AWK=y
CONFIG_BUSYBOX_CONFIG_FEATURE_AWK_LIBM=y
CONFIG_BUSYBOX_CONFIG_DIFF=y
CONFIG_BUSYBOX_CONFIG_SED=y
CONFIG_BUSYBOX_CONFIG_VI=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN=1024
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_COLON=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_YANKMARK=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SEARCH=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_USE_SIGNALS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_DOT_CMD=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_READONLY=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SETOPTS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SET=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_WIN_RESIZE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
CONFIG_BUSYBOX_CONFIG_FEATURE_ALLOW_EXEC=y

CONFIG_BUSYBOX_CONFIG_FIND=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PRINT0=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PERM=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_TYPE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_XDEV=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_MAXDEPTH=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_EXEC=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_USER=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_GROUP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_NOT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_DEPTH=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PAREN=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_SIZE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PRUNE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PATH=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_REGEX=y
CONFIG_BUSYBOX_CONFIG_GREP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_EGREP_ALIAS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_FGREP_ALIAS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_CONTEXT=y
CONFIG_BUSYBOX_CONFIG_XARGS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y

CONFIG_BUSYBOX_CONFIG_INIT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_USE_INITTAB=y
CONFIG_BUSYBOX_CONFIG_FEATURE_INIT_SYSLOG=y
CONFIG_BUSYBOX_CONFIG_HALT=y
CONFIG_BUSYBOX_CONFIG_MESG=y

CONFIG_BUSYBOX_CONFIG_PASSWD=y
CONFIG_BUSYBOX_CONFIG_FEATURE_PASSWD_WEAK_CHECK=y


CONFIG_BUSYBOX_CONFIG_INSMOD=y
CONFIG_BUSYBOX_CONFIG_RMMOD=y
CONFIG_BUSYBOX_CONFIG_LSMOD=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y

CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
CONFIG_BUSYBOX_CONFIG_DEFAULT_MODULES_DIR="/lib/modules"

CONFIG_BUSYBOX_CONFIG_DMESG=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY=y
CONFIG_BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
CONFIG_BUSYBOX_CONFIG_HEXDUMP=y
CONFIG_BUSYBOX_CONFIG_HWCLOCK=y
CONFIG_BUSYBOX_CONFIG_VOLUMEID=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_FAT=y
CONFIG_BUSYBOX_CONFIG_MOUNT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_LABEL=y
CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_NFS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_CIFS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_FLAGS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_FSTAB=y
CONFIG_BUSYBOX_CONFIG_PIVOT_ROOT=y
CONFIG_BUSYBOX_CONFIG_RDATE=y
CONFIG_BUSYBOX_CONFIG_SWITCH_ROOT=y
CONFIG_BUSYBOX_CONFIG_UMOUNT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_UMOUNT_ALL=y

CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_LOOP=y

CONFIG_BUSYBOX_CONFIG_CROND=y
CONFIG_BUSYBOX_CONFIG_FEATURE_CROND_DIR="/var/spool/cron"
CONFIG_BUSYBOX_CONFIG_CRONTAB=y
CONFIG_BUSYBOX_CONFIG_LESS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_MAXLINES=9999999
CONFIG_BUSYBOX_CONFIG_LOCK=y
CONFIG_BUSYBOX_CONFIG_STRINGS=y
CONFIG_BUSYBOX_CONFIG_TIME=y
CONFIG_BUSYBOX_CONFIG_WATCHDOG=y

CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6=y
CONFIG_BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
CONFIG_BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS=y
CONFIG_BUSYBOX_CONFIG_ARPING=y
CONFIG_BUSYBOX_CONFIG_BRCTL=y
CONFIG_BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY=y
CONFIG_BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW=y
CONFIG_BUSYBOX_CONFIG_HTTPD=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_CGI=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY=y
CONFIG_BUSYBOX_CONFIG_IFCONFIG=y
CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW=y
CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
CONFIG_BUSYBOX_CONFIG_NC=y
CONFIG_BUSYBOX_CONFIG_NETMSG=y
CONFIG_BUSYBOX_CONFIG_NETSTAT=y
CONFIG_BUSYBOX_CONFIG_FEATURE_NETSTAT_WIDE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_NETSTAT_PRG=y
CONFIG_BUSYBOX_CONFIG_NSLOOKUP=y
CONFIG_BUSYBOX_CONFIG_PING=y
CONFIG_BUSYBOX_CONFIG_PING6=y
CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_PING=y
CONFIG_BUSYBOX_CONFIG_ROUTE=y
CONFIG_BUSYBOX_CONFIG_TELNET=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TELNET_TTYPE=y
CONFIG_BUSYBOX_CONFIG_TELNETD=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE=y
CONFIG_BUSYBOX_CONFIG_TRACEROUTE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
CONFIG_BUSYBOX_CONFIG_APP_UDHCPC=y
CONFIG_BUSYBOX_CONFIG_UDHCP_DEBUG=0
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397=y
CONFIG_BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_BUSYBOX_CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
CONFIG_BUSYBOX_CONFIG_VCONFIG=y
CONFIG_BUSYBOX_CONFIG_WGET=y
CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION=y
CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS=y

CONFIG_BUSYBOX_CONFIG_FREE=y
CONFIG_BUSYBOX_CONFIG_KILL=y
CONFIG_BUSYBOX_CONFIG_KILLALL=y
CONFIG_BUSYBOX_CONFIG_KILLALL5=y
CONFIG_BUSYBOX_CONFIG_PGREP=y
CONFIG_BUSYBOX_CONFIG_PIDOF=y
CONFIG_BUSYBOX_CONFIG_PKILL=y
CONFIG_BUSYBOX_CONFIG_PS=y
CONFIG_BUSYBOX_CONFIG_BB_SYSCTL=y
CONFIG_BUSYBOX_CONFIG_TOP=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
CONFIG_BUSYBOX_CONFIG_UPTIME=y

CONFIG_BUSYBOX_CONFIG_FEATURE_SH_IS_ASH=y
CONFIG_BUSYBOX_CONFIG_ASH=y
CONFIG_BUSYBOX_CONFIG_ASH_BASH_COMPAT=y
CONFIG_BUSYBOX_CONFIG_ASH_JOB_CONTROL=y
CONFIG_BUSYBOX_CONFIG_ASH_READ_TIMEOUT=y
CONFIG_BUSYBOX_CONFIG_ASH_ALIAS=y
CONFIG_BUSYBOX_CONFIG_ASH_GETOPTS=y
CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_ECHO=y
CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_PRINTF=y
CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_TEST=y
CONFIG_BUSYBOX_CONFIG_ASH_CMDCMD=y
CONFIG_BUSYBOX_CONFIG_ASH_EXPAND_PRMT=y
CONFIG_BUSYBOX_CONFIG_SH_MATH_SUPPORT=y
CONFIG_BUSYBOX_CONFIG_SH_MATH_SUPPORT_64=y

CONFIG_BUSYBOX_CONFIG_SYSLOGD=y
CONFIG_BUSYBOX_CONFIG_FEATURE_ROTATE_LOGFILE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_REMOTE_LOG=y
CONFIG_BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG=y
CONFIG_BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
CONFIG_BUSYBOX_CONFIG_LOGREAD=y
CONFIG_BUSYBOX_CONFIG_KLOGD=y
CONFIG_BUSYBOX_CONFIG_LOGGER=y
CONFIG_PACKAGE_dnsmasq=y
CONFIG_PACKAGE_dropbear=y
CONFIG_PACKAGE_firewall=y
CONFIG_PACKAGE_hotplug2=y
CONFIG_PACKAGE_libc=y
CONFIG_PACKAGE_libgcc=y
CONFIG_PACKAGE_mtd=y
CONFIG_PACKAGE_opkg=y
CONFIG_PACKAGE_uci=y
CONFIG_PACKAGE_ucitrigger=y
CONFIG_PACKAGE_udevtrigger=y
CONFIG_PACKAGE_wireless-tools=y



CONFIG_PACKAGE_libiptc=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_libnl-tiny=y
CONFIG_PACKAGE_libuci=y
CONFIG_PACKAGE_libuci-lua=y
CONFIG_PACKAGE_libxtables=y

CONFIG_PACKAGE_crda=y
CONFIG_PACKAGE_hostapd-mini=y
CONFIG_PACKAGE_iptables=y
CONFIG_PACKAGE_iptables-mod-conntrack=y
CONFIG_PACKAGE_iptables-mod-nat=y
CONFIG_PACKAGE_iw=y
CONFIG_PACKAGE_ppp=y
CONFIG_PACKAGE_ppp-mod-pppoe=y

CONFIG_PACKAGE_kmod-scsi-core=y

CONFIG_PACKAGE_kmod-crypto-aes=y
CONFIG_PACKAGE_kmod-crypto-arc4=y
CONFIG_PACKAGE_kmod-crypto-core=y

CONFIG_PACKAGE_kmod-fs-ext2=y
CONFIG_PACKAGE_kmod-fs-mbcache=y
CONFIG_PACKAGE_kmod-fs-msdos=y
CONFIG_PACKAGE_kmod-fs-vfat=y
CONFIG_PACKAGE_kmod-nls-base=y
CONFIG_PACKAGE_kmod-nls-cp437=y
CONFIG_PACKAGE_kmod-nls-cp850=y
CONFIG_PACKAGE_kmod-nls-iso8859-1=y
CONFIG_PACKAGE_kmod-nls-iso8859-15=y
CONFIG_PACKAGE_kmod-nls-utf8=y

CONFIG_PACKAGE_kmod-ipt-core=y
CONFIG_PACKAGE_kmod-ipt-conntrack=y
CONFIG_PACKAGE_kmod-ipt-nat=y
CONFIG_PACKAGE_kmod-ipt-nathelper=y

CONFIG_PACKAGE_kmod-ppp=y
CONFIG_PACKAGE_kmod-pppoe=y

CONFIG_PACKAGE_kmod-button-hotplug=y
CONFIG_PACKAGE_kmod-crc-ccitt=y
CONFIG_PACKAGE_kmod-input-core=y
CONFIG_PACKAGE_kmod-input-gpio-buttons=y
CONFIG_PACKAGE_kmod-input-polldev=y
CONFIG_PACKAGE_kmod-leds-gpio=y
CONFIG_PACKAGE_kmod-leds-wndr3700-usb=y

CONFIG_PACKAGE_kmod-usb-core=y
CONFIG_PACKAGE_kmod-usb-ohci=y
CONFIG_PACKAGE_kmod-usb-storage=y
CONFIG_PACKAGE_kmod-usb-uhci=y
CONFIG_PACKAGE_kmod-usb2=y

CONFIG_PACKAGE_kmod-ath=y
CONFIG_ATH_USER_REGD=y
CONFIG_PACKAGE_kmod-ath9k=y
CONFIG_PACKAGE_kmod-mac80211=y

CONFIG_KEXEC_TOOLS_TARGET_NAME="mips"
CONFIG_PACKAGE_lua=y

5. Build your target

Type "make" and it should merrily build away for at least a good half hour (or more). When you're done, you should have the resulting binaries stored in ~/openwrt/trunk/bin/ar71xx.

6a. Upload firmware image to the board (for static firmware images)

This step is for flashing the router. Skip to step 6b if you built a ramdisk and want to upload it to memory only.

If you built a static firmware image, you can simply upload the file using the NETGEAR web interface. The file you want to upload from your binaries directory (see above) is openwrt-ar71xx-wndr-(squashfs/jffs2)-factory.img.

Note that the NETGEAR web interface JavaScript didn't seem to like the filename of the OpenWRT image, so I had to rename it to something more NETGEAR-like (eg. "WNDR3700-V1.0.4.35NA.img") before the upload would be accepted. From that point, it worked and flashed fine (and I was using the very first version of NETGEAR firmware available). metamatt wrote something about different browsers maybe being an issue, but it didn't seem to matter which web browser I used, so long as I used a NETGEAR-like filename.

6b. Upload firmware image to the board (as a ramdisk)

Skip this step if you flashed the image to the board in 6a above.

You'll need to build a serial cable to do the ramdisk upload. See later on in this post for instructions if you wish to do this.

- Connect an ethernet cable between your computer and one of the LAN ports (doesn't matter which, just so long as it's not the WAN port) of the WNDR3700.
- Connect your serial cable to the header on the WNDR3700 and set your local terminal program (eg. minicom) for 115200 bps 8N1, no software flow control, no hardware flow control.
- Set your computer's ethernet port to use a static IP address of 192.168.0.10, netmask 255.255.255.0
- Set up a TFTP server on your local computer to respond to requests on the 192.168.0.10 interface. Make sure that the ramdisk image (openwrt-ar71xx-uImage-lzma.bin) is in the directory used by the TFTP server.

- Fix the header for the ramdisk image so that it's recognized by the u-Boot firmware. Use the wndr3700.c program that was posted earlier in this thread by aorlinsk here http://aorlinsk2.free.fr/openwrt/wndr3700/ and run it from the TFTP server's data directory. I've also reproduced the code here just in case:

./wndr3700 openwrt-ar71xx-uImage-lzma.bin openwrt-fixed.out

A copy of the source for wndr3700.c is here:

/*
 * wndr3700.c - partially based on OpenWrt's add_header.c
 *
 * Copyright (C) 2009 Anael Orlinski  <naouel@naouel.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License,
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

/*
 * The add_header utility used by various vendors preprends the buf
 * image with a header containing a CRC32 value which is generated for the
 * model id + reserved space for CRC32 + buf, then replaces the reserved
 * area with the actual CRC32. This replacement tool mimics this behavior.
 */

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <string.h>
#include <netinet/in.h>
#include <inttypes.h>

#define BPB 8 /* bits/byte */

static uint32_t crc32[1<<BPB];

static void init_crc32()
{
    const uint32_t poly = ntohl(0x2083b8ed);
    int n;

    for (n = 0; n < 1<<BPB; n++) {
        uint32_t crc = n;
        int bit;

        for (bit = 0; bit < BPB; bit++)
            crc = (crc & 1) ? (poly ^ (crc >> 1)) : (crc >> 1);
        crc32[n] = crc;
    }
}

static uint32_t crc32buf(unsigned char *buf, size_t len)
{
    uint32_t crc = 0xFFFFFFFF;

    for (; len; len--, buf++)
        crc = crc32[(uint8_t)crc ^ *buf] ^ (crc >> BPB);
    return ~crc;
}

struct header {
    uint32_t magic;
    uint32_t crc;
    unsigned char stuff[56];
};

static void usage(const char *) __attribute__ (( __noreturn__ ));

static void usage(const char *mess)
{
    fprintf(stderr, "Error: %s\n", mess);
    fprintf(stderr, "Usage: wndr3700 input_file output_file\n");
    fprintf(stderr, "\n");
    exit(1);
}

int main(int argc, char **argv)
{
    off_t len;            // of original buf
    off_t buflen;            // of the output file
    int fd;
    void *input_file;        // pointer to the input file (mmmapped)
    struct header header;
    unsigned char *buf;    // pointer to prefix + copy of original buf

    // verify parameters

    if (argc != 3)
        usage("wrong number of arguments");

    // mmap input_file
    if ((fd = open(argv[1], O_RDONLY))  < 0
    || (len = lseek(fd, 0, SEEK_END)) < 0
    || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
    || close(fd) < 0)
    {
        fprintf(stderr, "Error loading file %s: %s\n", argv[1], strerror(errno));
        exit(1);
    }

    buflen = len;

    init_crc32();

        // preload header
        memcpy(&header, input_file, sizeof(header));

        header.magic = htonl(0x33373030); /* 3700 in ascii */
    header.crc = 0;

    // create a firmware image in memory and copy the input_file to it
    buf = malloc(buflen);
    memcpy(buf, input_file, len);

    // CRC of temporary header
    header.crc = htonl(crc32buf((unsigned char*)&header, sizeof(header)));

    memcpy(buf, &header, sizeof(header));

    // write the buf
    if ((fd = open(argv[2], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
    || write(fd, buf, buflen) != buflen
    || close(fd) < 0)
    {
        fprintf(stderr, "Error storing file %s: %s\n", argv[2], strerror(errno));
        exit(2);
     }

    free(buf);

    munmap(input_file,len);

    return 0;
}

- Power up the board. When it gets to the message asking you to press any key to interrupt the normal bootup sequence, press a key on the serial console (or just hold down the enter key from first bootup until you get to a prompt):
- Enter the following into the serial console. Please note that if you forget the bootargs piece below, the board will boot and look normal, but it won't be able to bring up any of the network interfaces!

setenv ipaddr 192.168.0.1
setenv serverip 192.168.0.10
setenv bootargs 'board=WNDR3700'
tftpboot 80800000 openwrt-fixed.out
bootm

The system should boot!

7. Get your wireless interfaces working

- Make sure an ethernet cable is plugged into the LAN port of your router and into your computer. Ensure that you have a static IP configuration on your computer's ethernet port that is within the same subnet that you assigned in step #4-4 above.

Through your ethernet cable, telnet into your router ("telnet 192.168.0.1" if you used the suggested subnet and router IP configuration in #4-4). If you booted the board using a ramdisk image, you can skip the telnet step and simply press <enter> to activate the serial console.

From here, fix your wireless config files:

cd /etc/config
vi wireless (or run your editor of choice)

- Remove the "option disable 1" line from each of the two wifi-iface sections to activate the two radios.
- To each config wifi-device (not wifi-iface) section, also add an "option country US" (or insert your own two-letter regulatory country code as appropriate, in capitals).
- For the radio1 device, SET THE CHANNEL TO 48 since channels 36-44 did not seem to work for me.
- Adjust other wireless settings as appropriate.

AS OF 2010-01-11, THE 5 GHZ WIRELESS WOULD NOT COME UP FOR ME UNLESS I SET THE COUNTRY CODE AND CHANNELS AS DESCRIBED ABOVE.

After saving your wireless config, execute this command to force the system to reread the configs and bring up the radios:

wifi

8. You are done!

From this point, you should have working wireless and wired access. Routing seems to work normally for me too, although for admittedly only light use. However, I've gotten some relatively sophisticated packages (eg. asterisk 1.4) to install and run without problems.

The only small issue I've seen with the image is that the DHCP server is sometimes very slow to respond and it can take 20-30 seconds to get an IP lease from the router (and you sometimes have to try more than once).

9. Install packages to USB stick (optional)

From here, you should be able to insert a USB stick and have it recognized by the system, which would give you plenty of room to install more packages. Mine showed up automatically as /mnt/sda1. Please note that you need to have configured the kernel for USB support (see step #4) for this to work.

Those config steps included support for both FAT and ext2 filesystems, but you'll probably want to format your USB stick as ext2 format so that you can use it for installing packages.

Once the stick is inserted, to be able to install packages there, edit /etc/opkg.conf and:
- add "dest usb /opt" to the bottom of the file

Execute this command once (assuming that /mnt/sda1 is where your USB stick came up):

ln -s /mnt/sda1 /opt

Now edit /etc/profile and add the new USB mounts to your paths:

export PATH=<current default path>:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
export LD_LIBRARY_PATH=<current default LD library path>:/opt/lib:/opt/usr/lib

From here, you should be able to install new packages to your USB storage as follows:

opkg update
opkg -dest usb install asterisk14 <…or whatever you want…>

10. UH OH! I bricked my router! (optional)

If you happen to brick your router, do not fear. ole.h mentioned a method for unbricking the router easily with a TFTP client. If you use the factory reset button, you don't need to worry about building a serial cable, trying to tap into any crazy timing, or anything else particularly tricky. It is simple and the following step-by-step process (cribbed from the ole.h's earlier notes, as well as from http://cyberstorm.altervista.org/wag354 … 54g_en.txt) will get you going. This assumes that you have a copy of the stock NETGEAR firmware in the current directory.

1) Power the router off.
2) Hold down the factory reset button on the bottom of the case. As lizby pointed out in the next message :-), you now also need to turn the router back on.
3) Wait 45-60 seconds. Release the factory reset button. (If you happen to have a serial cable connected, you'll see that the system is in firmware recovery mode and that it will be waiting for you to upload firmware. But you don't need the serial cable at all.)
4) Configure your ethernet connection using a static IP as 192.168.1.2, netmask 255.255.255.0.
5) Run a tftp CLIENT on your computer (enter no hostname on the command line) and enter the following:

verbose
trace
rexmt 1
binary
connect 192.168.1.1
put WNDR3700-V1.0.4.35NA.img (or whatever the filename is that you're trying to flash)

Once done, the router will  flash itself to the stock NETGEAR firmware file that you provided and reboot automatically. Be patient--it will eventually come up as a brand new factory-fresh router with NETGEAR firmware!

11. I wanna build a serial cable for ramdisk testing! (optional)

If you have a basic familiarity with RS232 signals and putting together basic electronic components, you should be fine. I prefer 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 me 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 I'm 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, so my system looks pretty clean and polished even after adding the connector.

For the computer-to-9-pin-serial part, you have two options:

1) Buy a Nokia CA-42 cable and be comfortable stripping wires and using a multimeter.
2) Buy a premade USB-to-DB9 RS232 serial cable. !!!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 cable, make sure to check the output levels to ensure that you don't fry anything!

For step 1:

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.ph … inkstation. 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, user whiskas previously posted the pinout of the connector here: 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.

I have photos of the above bits and pieces that I can share if anyone really cares to see them.

Anyway, that's all I've got! I hope this information will be useful to the community. Thanks so much to everyone else who has gotten us this far!

(Last edited by essdz on 18 Jan 2010, 02:43)

Very nice writeup.  It is perhaps obvious, but should item 10.2 have at the end, "Power the device back up."?

ase, thanks for your effort.
But it seems to me that lan ports are attached to interface eth0 not to eth1.
I'm thinking if we can configure switch vlan's then there is no need for eth0 and eth1, instead we can only use eth0 (or eth1) as 5-port switch, i'm quite sure that the RTL8366_PORT_UNKNOWN is wan port. So if there are 3 mac addresses stored on flash then maybe two of them are for wireless and one for switch? Please correct me if i'm wrong.

I seem to be getting lots of lines that look like:

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x3337 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0xf317 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x4a66 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x0052 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0xbf07 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0xbf07 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x2a9f instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x0505 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x574e instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x3337 instead
Further such events for this erase block will not be printed
Empty flash at 0x000000b0 ends at 0x000000b4
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010000: 0xa249 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010004: 0xc2ff instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010008: 0xa6f2 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0001000c: 0x2314 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010010: 0x1bff instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010014: 0xcd3c instead

(This is after sending my image via uBoot+tftp)

Anyone have any ideas what i might be doing wrong?

After a while of doing this, I just get a kernel panic :-(

eddsz: Really nice writeup! If it is possible, it would be nice to create a wiki page for WNDR3700 on openwrt.org?

ned0r: I saw the same when i tried to ramdisk boot, but I don't know why it is not possible to use current builds for ramdisk boot. Try flashing the image instead, you can always restore with a serial cable..

essdz, thanks for the writeup.

A couple clarifications:
- netgear default login UI on the underside of the case: yes, so it is!  Good to know.
- difficulty using netgear's factory web UI to upload openwrt image: probably only a problem if you start with old firmware (which I did, but I don't know how many routers come from the factory that way now; maybe I just got lucky)

Also, the luci http interface wasn't working for me, but I poked at it, and got it working. Apparently a bunch more packages were missing from the image I downloaded?

opkg list-installed | grep luci told me (to start with):

luci-core - 0.9+svn5661-1
luci-http - 0.9+svn5661-1
luci-lmo - 0.9+svn5661-1
luci-lucid - 0.9+svn5661-1
luci-nixio - 0.9+svn5661-1
luci-px5g - 0.9+svn5661-1
luci-sgi-cgi - 0.9+svn5661-1
luci-sys - 0.9+svn5661-1
luci-theme-base - 0.9+svn5661-1
luci-theme-openwrt - 0.9+svn5661-1
luci-uci - 0.9+svn5661-1
luci-web - 0.9+svn5661-1

I added:

root@OpenWrt:/etc/config# opkg install luci-app-firewall
root@OpenWrt:/etc/config# opkg install luci-app-ddns
root@OpenWrt:/etc/config# opkg install luci-lucid
root@OpenWrt:/etc/config# opkg install luci-app-initmgr luci-app-livestats luci-app-statistics luci-app-openvpn
root@OpenWrt:/etc/config# opkg install luci-fastindex luci-httpclient luci-luanet
root@OpenWrt:/etc/config# opkg install luci-ipkg

after this, the result of the same list-installed command is:

luci-admin-core - 0.9+svn5661-1
luci-admin-full - 0.9+svn5661-1
luci-admin-rpc - 0.9+svn5661-1
luci-app-ddns - 0.9+svn5661-1
luci-app-firewall - 0.9+svn5661-1
luci-app-initmgr - 0.9+svn5661-1
luci-app-livestats - 0.9+svn5661-1
luci-app-openvpn - 0.9+svn5661-1
luci-app-statistics - 0.9+svn5661-1
luci-cbi - 0.9+svn5661-1
luci-core - 0.9+svn5661-1
luci-fastindex - 0.9+svn5661-1
luci-http - 0.9+svn5661-1
luci-httpclient - 0.9+svn5661-1
luci-i18n-english - 0.9+svn5661-1
luci-ipkg - 0.9+svn5661-1
luci-json - 0.9+svn5661-1
luci-lmo - 0.9+svn5661-1
luci-luanet - 0.9+svn5661-1
luci-lucid - 0.9+svn5661-1
luci-nixio - 0.9+svn5661-1
luci-px5g - 0.9+svn5661-1
luci-sgi-cgi - 0.9+svn5661-1
luci-sys - 0.9+svn5661-1
luci-theme-base - 0.9+svn5661-1
luci-theme-openwrt - 0.9+svn5661-1
luci-uci - 0.9+svn5661-1
luci-uvl - 0.9+svn5661-1
luci-web - 0.9+svn5661-1

and it seems to work; at least the login page loads (I haven't tried anything more yet). I'm not sure *which* of the packages I added did the trick, though.

ole.h wrote:

eddsz: Really nice writeup! If it is possible, it would be nice to create a wiki page for WNDR3700 on openwrt.org?

Good idea! I did as much wiki-ifying of my post as I could stand, and it is added to the wiki at this location: http://wiki.openwrt.org/inbox/netgear/wndr3700. I assume that the wiki mods will probably move it someplace else soonish (under the Table of Hardware?), but feel free to review, edit or clean up in the meantime.

metamatt: thanks for the LuCI tips! I hadn't tried luci yet--I gave it a cursory pass, but I couldn't get the installed packages to work the first time around, and I'm kind of a command-line guy anyway...but I will try to give it another shot soon with your instructions.

I also had to install the hostapd and kmod-lib80211 packages; both were missing; without hostapd, the wifi interfaces didn't even try to initialize, and with hostapd but without kmod-lib80211, "wifi" complained about missing CCMP.

I'm guessing that this is just brokenness in the autogenerated build I grabbed?  Is this normal?  Anyway, I'll stop posting this kind of missing package info in this thread unless people think it's useful.

Great job, guys. How's the wifi performance on WNDR3700 (with the svn openwrt)? Is this now the most functional "next-gen" router?
I still set up a bunch of WHR-HP-G54 since I just flash it with a pre-customized WR image, but it's now time to switch to somewhing faster/gigabit/N and kamikaze smile

peckec wrote:

..  i'm quite sure that the RTL8366_PORT_UNKNOWN is wan port.

It turned out that i was wrong ... probably it's not a wan port, i was hoping that we can configure vlan's for wan port as well.

I am still having problems with the wireless range of the router. And with range i am talking of only a few meters without walls!

I posed my laptop approximately one meter away from the router and measured the signal strength of the netgear firmware and openwrt:
a) Netgear-Firmware
b) Openwrt

a)
 Cell 28 - Address: 00:24:B2:58:FB:52
                    ESSID:"NETGEAR"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Frequency:2.417 GHz (Channel 2)
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=73/100  Signal level=-55 dBm  
                    Extra: Last beacon: 12ms ago


b) 
 Cell 24 - Address: 00:24:B2:58:FB:52
                    ESSID:"openWrt"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Frequency:2.417 GHz (Channel 2)
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=46/100  Signal level=-73 dBm  
                    Extra: Last beacon: 168ms ago

-> 20dBm difference

edit: Just to clarify: -55dBm is a really good signal strength. -73dBm is ok, but not if the router is right next to the PC. Around -90dBm could be seen as the minimum signal, because around -95dBm is the noise value.
After putting the notebook 5 meters away, the signal already reaches -90dBm =/

I have tried multiple values with 'iwconfig wlan0 txpower'. Even 30dbm with the ath9k regulatory patch posted earlier. This seems to not even change the signal strength at all.

In receiving the problem is the same: 'iwlist scan' shows me 14 APs in my neighbourhood with netgears firmware. Openwrt sees only 4.


Can somebody check this? Simply use 'iwlist scan' on your PC and on your router for transmission and receiver strength, using netgear- and openwrt-firmware.

thx

(Last edited by whiskas on 14 Jan 2010, 11:17)

peckec wrote:

It turned out that i was wrong ... probably it's not a wan port, i was hoping that we can configure vlan's for wan port as well.

You don't need switch driver for vlan configuration for wan port. I think that just "vconfig add eth1 20" && "ifconfig eth1.20 <ip-addr> netmask <netmask-addr> broadcast <broadcast-addr> up" would add vlan with id 20 to wan port. I didn't test that though.

I also know that the swconfig needs to take the wan eth device name instead of lan eth device name as argument. It's because the current network driver for the wndr3700 does not register any phy devices if there are more than 1 found (switch has several phys so none of them is registered). To work around this issue the switch driver currently binds itself to the phy registration of the eth1 device. See file ag71xx_phy.c around line 255 for details about phy registration. In my opinion this is not such a big deal anyway.

Does anyone have any information about how to get the wlan leds (both 2.4G and 5G) working?

ase wrote:

Does anyone have any information about how to get the wlan leds (both 2.4G and 5G) working?

I think the only thing posted about leds was at post #52

I would actually guess that the driver may control them.

Fallen Kell wrote:
ase wrote:

Does anyone have any information about how to get the wlan leds (both 2.4G and 5G) working?

I think the only thing posted about leds was at post #52

I would actually guess that the driver may control them.

Turns out the ath9k driver uses the wrong gpio for the leds on wndr3700. The following hack will enable wlan leds on the wndr3700:

Locate file drivers/net/wireless/ath/ath9k/gpio.c from under compat-wireless. In the file there should be block of code such as:

        if (AR_SREV_9287(sc->sc_ah))
                sc->sc_ah->led_pin = ATH_LED_PIN_9287;
        else
                sc->sc_ah->led_pin = ATH_LED_PIN_DEF;

Insert the following line below the block

        sc->sc_ah->led_pin = 5;

So you will have:

        if (AR_SREV_9287(sc->sc_ah))
                sc->sc_ah->led_pin = ATH_LED_PIN_9287;
        else
                sc->sc_ah->led_pin = ATH_LED_PIN_DEF;

        sc->sc_ah->led_pin = 5;

This effectively just overrides the default led pin in an ugly and hackish way but works for me.
Someone should write this into a cleaner patch.

Once you've installed OpenWRT once, is there an easier/better way to upgrade to a new build than reflashing with the same firmware-recovery-mode that you use for a bricked router?

I followed essdz's steps from post 102, section 10; that worked; however one refinement that makes this a little less like navigation by dead reckoning (counting 45 seconds and then not knowing if you've waited too long or not long enough) -- the wndr3700 in recovery mode will come up as 192.168.1.1 (as in essdz's instructions), but it also responds to pings. So you can configure the machine you're going to send the upgrade from with a static IP of 192.168.1.2, ahead of time, and start an ongoing ping to 192.168.1.1 (Linux's ping will continue until stopped by default; from Windows this is ping -t), then power cycle the wndr3700 with the "restore factory settings" button held down, and hold the button until it starts answering your pings, and then you know you can let go of the button and proceed to tftp the new firmware. (I just did this and it really did take about 45 seconds before it answered the ping, though.)

metamatt wrote:

Once you've installed OpenWRT once, is there an easier/better way to upgrade to a new build than reflashing with the same firmware-recovery-mode that you use for a bricked router?

Yes, there is! This is, apparently, where we get back into "standard OpenWRT" land:

http://wiki.openwrt.org/inbox/netgear/w … .newer.one

(Please feel free to add your suggestions about the ping timing to the unbrick part of that page too!)

essdz wrote:

I suggest JFFS here because it has persistent storage, unlike the read-only squashfs.

Please remove that from your post and the wiki entry. The SquashFS-image will create a jffs-partition on the first boot and overlay it on / so you can write in /etc or wherever. SquashFS compresses much better than JFFS, so your image will be a lot smaller.

Hi there.

I started a different approach with my WNDR3700: I wrote a shell script and put it on a USB stick, along with the latest openwrt busybox, which does the following:
1. download latest openwrt distribution with wget and untar it on the stick (partition 1)
2. do some configuration (i.e. copy selected etc scripts, set samba access to whole file system, change password, etc.)
3. kill running daemons
4. mount filesystem on usb stick with pivot_root
5. start new services

Et Voila, you got nearly the latest openwrt version running on the router WITHOUT reflasing

But:

A. It is still the old kernel running (with prevents me from using kernel modules from the new distro)
B. The system is non-persistent (and since a telnet time-out makes re access impossible, reboots are needed sometimes)
C. The running configuration is not completely in line with Lucy (firewall settings etc.)

Conclusion: nice first try, but not completely to my liking.

I contacted NetGear if they were willing to provide the "TUN.KO" module for their kernel. NetGear first labelled their own openwrt distro as modified and unsupported, next they stated that modifying the router voids all warrenties and they also stated that providing anything other then the standard firmware was beyond free service.
So here's customer service for you!

I want to use the TUN.KO module to load it into the kernel and create a VPN over the internet between two WNDR3700, using the openwrt software. The software runs fine with the stick, but the kernel is the problem!

I was thinking: would there be a solution in modifying the existing firmware to boot form a USB stick if present? That would make experimenting a whole lot easier and safer.

I guess that lilo-like boot USB kernel is not possible (is it?) But a hook in the shells could also be handy (doens't solve my kernel problem, but allows me to use the rest of the openwrt distro when the proper USB stick is present.)

Any thoughts on the matter?

ase wrote:

I decided to write improvements to the rtl8366 switch driver. I've uploaded my work to http://koti.welho.com/ase/openwrt/rtl8366_smi.patch (or http://koti.welho.com/ase/openwrt/rtl8366_smi.c if you rather work with entire files instead of patch)

I've added an interface to the driver to work with the swconfig -tool available in openwrt.  (opkg install swconfig)

Driver changes include:
* VLANs are now working

swconfig dev eth1 port 0 set pvid 10 # Creates vlan for port 0 with id 10
vconfig add br-lan 10 && ifconfig br-lan.10 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255 up
swconfig dev eth1 set vlan_enable 1 # Now traffic from/to port 0 goes through br-lan.10 -interface

* Leds can be configured

# A nice blinking led configuration with bicolor information for 1Gb connections
swconfig dev eth1 port 1 set led 2
swconfig dev eth1 port 2 set led 6
swconfig dev eth1 port 5 set led 6
swconfig dev eth1 set blinkrate 3

* switch can be reset to defaults

swconfig dev eth1 set reset

* mib counter read support

swconfig dev eth1 port 0 get mib

* also some debugfs hooks added + plenty of other minor changes

# List supported commands
swconfig dev eth1 help

Enjoy!
Bug reports are welcome.

I included it in my build this week end, everything seems to run great.

I don't understand yet the led configuration, but I can see changes by trial and error with various values !

Thanks for the work!

aorlinsk wrote:

I don't understand yet the led configuration, but I can see changes by trial and error with various values !

Thanks for the work!

Yes the led configuration can be rather confusing. Here's what I think I know about it:

The switch on wndr3700 supports several led groups. On wndr3700 there are the following groups:

group 1: green leds for all ports on the switch
group 2: orange leds for all ports on the switch

Now, each group can be configured into one of 16 different modes. Here are the modes:

Mode 0: Led off
Mode 1: Collision, Full duplex Indicator. Blinks when collision happens. Led is on for full duplex, and off for half duplex mode.
Mode 2: Link, Activity Indicator. On for link established. Link/Act Blinks when the corresponding port is transmitting or receiving.
Mode 3: 1000Mb/s Speed Indicator. On for 1000Mb/s.
Mode 4: 100Mb/s Speed Indicator. On for 100Mb/s.
Mode 5: 10Mb/s Speed Indicator. On for 10Mb/s.
Mode 6: 1000Mb/s Speed/Activity Indicator. On for 1000Mb/s. Blinks when the corresponding port is transmitting or receiving.
Mode 7: 100Mb/s Speed/Activity Indicator. On for 100Mb/s. Blinks when the corresponding port is transmitting or receiving.
Mode 8: 10Mb/s Speed/Activity Indicator. On for 10Mb/s. Blinks when the corresponding port is transmitting or receiving.
Mode 9: 10/100Mb/s Speed/Activity Indicator. On for 10/100Mb/s. Blinks when the corresponding port is transmitting or receiving.
Mode 10: Fiber link Indicator. On for Fiber.
Mode 11: Fault Indicator. On for Fault.
Mode 12: Link, Activity Indicator. On for link established. Link/Rx Blinks when the corresponding port is transmitting.
Mode 13: Link, Activity Indicator. On for link established. Link/Tx Blinks when the corresponding port is receiving.
Mode 14: Link on Master Indicator. On for link Master established.
Mode 15: Led value is read from a separate register

My favourite configuration is green leds for 10/100 Mb/s connections and orange for 1000 Mb/s which are blinking on activity
swconfig dev eth1 port 1 set led 9
swconfig dev eth1 port 2 set led 6

(Notice how swconfig port number is actually the led group number and last number is the desired mode)

You can control the blinkrate of the leds via
swconfig dev eth1 set blinkrate <value>
(values: 0 = 43ms, 1 = 84ms, 2 = 120ms, 3 = 170ms, 4 = 340ms, 5 = 670ms)


Oh and my changes to the switch driver were integrated to the openwrt trunk along with fixes and several improvements. Many thanks to the devs!
(In the trunk the device name of the switch was changed from eth1 to rtl8366-smi e.g swconfig dev rtl8366-smi set blinkrate 1)

(Last edited by ase on 18 Jan 2010, 20:14)

essdz wrote:

Yes, there is! This is, apparently, where we get back into "standard OpenWRT" land:

http://wiki.openwrt.org/inbox/netgear/w … .newer.one

Great! That's what I was hoping (and after posting that, I'd started wondering if that's what the sysupgrade file was, and found the sysupgrade utility, but not really docs on how to use it). Thanks for pointing me in the right direction. That'll make it a lot easier to keep up to date with changes.

I finally tried a test flash.. and can confirm my wireless speed at least was not usable in comparison to original firmware, also, it failed to negotiate dhcp in other room, and when taken there after negotiating it near router, speed was randomly going between about 14K/s and 500K/s, opposed to original firmware where speed on 2.4ghz went from 1.6MB/s upto 5MB/s.

Anyone have both the Linksys WRT400N and the WNDR3700?  Can we get a comprehensive list of differences, such as recovery mode?  The WRT400N has been selling at Fry's for $49.99.  I know it lacks the USB and is only 100mbs switch... but same WiFi, CPU, and u-boot?

Sorry, posts 126 to 125 are missing from our archive.