WNDR4700 New Install

Yes I do mean /overlay because all the packages are installed there. I just figured that out. Thanks.

Corresponding data from Netgear R6100 is as follows:

BusyBox v1.25.1 () built-in shell (ash)

     _________
    /        /\      _    ___ ___  ___
   /  LE    /  \    | |  | __|   \| __|
  /    DE  /    \   | |__| _|| |) | _|
 /________/  LE  \  |____|___|___/|___|                      lede-project.org
 \        \   DE /
  \    LE  \    /  -----------------------------------------------------------
   \  DE    \  /    Reboot (17.01.4, r3560-79f57e422d)
    \________\/    -----------------------------------------------------------

root@R6100:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00020000 00020000 "u-boot"
mtd1: 00040000 00020000 "caldata"
mtd2: 00040000 00020000 "caldata-backup"
mtd3: 00080000 00020000 "config"
mtd4: 00080000 00020000 "pot"
mtd5: 00200000 00020000 "kernel"
mtd6: 07760000 00020000 "ubi"
mtd7: 01900000 00020000 "firmware"
mtd8: 00200000 00020000 "language"
mtd9: 00300000 00020000 "traffic_meter"
root@R6100:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.8M      2.8M         0 100% /rom
tmpfs                    61.2M    608.0K     60.6M   1% /tmp
/dev/ubi0_1              99.8M      5.2M     89.9M   5% /overlay
overlayfs:/overlay       99.8M      5.2M     89.9M   5% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@R6100:~# 

The USB3 ports on the WNDR4700 require firmware that doesn't come with the default OpenWRT install. There was an .ipk file to install it at https://github.com/chunkeey but it looks like it's gone now.

1 Like

The firmware in the USB3 chip can sometimes survive a reboot just fine. If you installed the image through the netgear's web-ui, then there's a good chance that it survived the following reboot. However, if you unplug the now-flashed router and turn it back on later and you don't have the usb3 firmware installed, it won't work anymore.

(and if you then manually install the firmware by placing the firmware file into /lib/firmware, you either have to reboot or reload the kernel driver module to get it working)

Yes, problem here is that the vendor firmware has placed important stuff after its "rootfs" partition, so if the partition is extended it will overwrite other partitions and this makes it difficult to return to the stock firmware easily.

But if you really want to use more of the provided flash and you are not afraid of making and maintaining your own images: you can just change the size (it's the second hexadecimal value in the reg pair) in the netgear-wndr4700.dts from 0x014e0000 to 0x7ac0000.

(It's a good idea to make a backup of partitions your are overwriting though and safe them on a PC or somewhere... - and also for the wifi_data partition!)

Note: it might also be possible to use the "ecos" partition (~96 MiB) as an extroot in the future. The partition is currently set to "read-only". But it was empty on my WNDR4700 and I have no idea what Netgear was planning there. If it turns out that this space can be safely used, then sure: let's do something with it.

It was used at some point in the past:

But it became redundant when the partitions had to be reorganized due to ever increasing kernel size:

I guess I'll axe it at some point... Unless someone else is "looking for an easy PR" and wants to do it?

I can put it back up, once someone from Renesas gives the go-ahead to send it to the linux-firmware@kernel.org ML with a compatible license.

Ah the God has spoken! Thanks Christian, I appreciate your help:

  1. Yes the USB 3 drivers are gone. I just fired up and it no longer charges or recognizes connected device.
    Any idea where I can download the firmware and how do I manually place it in /lib/firmware? RCP/SCP/RSYNC??

  2. I am not confident enough to change the size myself and or backup partitions on an embedded device. If it can't be changed by you or someone expert then I think I should consider using the exroot on a flash drive. I have used that recipe from Openwrt website in the past. But for that too I will need USB drivers.

  3. I could use the SD Card slot to exroot the /overlay as I have many sd cards not in use and spare with me. But I wonder if that requires another set of drivers.

I can be a happy tester for you, if you'd like .... for wndr4700 and I can document my journey and put it into the forum for common cause.

Many thanks again.

Anil

(Don't forget to leave a like there)

The sdcard could be the better choice there. It is supported by the SoC's own usb 2.0 controller, so no firmware will be required. But it should also be possible to put the extroot on the HDD (provided you have one installed).

Further update: My SATA plans are in future but I decided to give a go to SDCARD. I put a ext4 formatted (mbr partition) into the slot and tried the 18.06.1 to recognize it. I tried the fdisk -l to see if there is any way to mount this partition. Then I loaded kmod ext4 and even then I wasn't able to see. So I decided to externally format this to fat32 and opkg added fs kmods as well. No luck still.

I used to have this puppy running fine on 17.01.4 and so decided to roll back the 18x to 17x using the LuCi firmware upgrade. There it refused to recognize and accept the openwrt image. After repeated try, I decided why not I restore to Netgear Factory condition using tftp and the netgear firmware from their site. Then just like the last time, I could move to 17.01.4 just like I did in the past. Picture of actual set up from that time is attached.

So my tftp to netgear factory went successful I left it on for 30 minutes to knock itself out updating and updating to its hearts delight....

NOW... This machine is partially functional. It boots and goes into first log in screen and displays netgear URL pointed to http://www.routerlogin.net/BRS_index.htm and then the ethernet connection disconnects. Moments later it comes up again and then it fails again. This it is doing in a perpetual do-loop.

Any advice? What I thought was an easy solution appears to have become obsession (wife thinks that) but we engineers don't give up. Do we?

Any guidance will be helpful.

Best
Anil Garg
1

Clear your browser cache if you have been accessing different firmware on the same 192.168.1.1 IP address.

Kmod-usb-storage must be installed to mount filesystems on USB. It is a stack of drivers like

kmod-usb2 (or usb3)
kmod-usb-common
kmod-usb-storage
kmod-fs-xxxx

Mike: I was clearing cache because I use private modes. Which clear cache as soon as I close browser.

However, using tftp, I have loaded the Netgear original WNDR4700_V1.0.0.28.img firmware.

However now the LAN ethernet is unstable. I have made thie tftp flash twice already and each time it said 19.2 seconds and loaded successfully but when it boots the the Netgear OEM, it goes into unstable perpetual connect disconnect of LAN connection. And this renders it useless.

Anil

I am not using USB and I was going to use Chris's pointer for USB and I have in past made exroot successfully several times.

RIght now I am trying to recover this wndr4700 so that I can step up to 17.1.4 / 17.1.6 that may be more stable...I could retry the 18x too...but how do I get there...

Anil

I know that when the Netgear OEM firmware is loaded, for some strange reasons, it keeps connecting and disconnecting LAN ports.

What if the built-in TFTP server is used to flash a openwrt 17.1.4 image? Perhaps it might give us a stable LAN connection after booting. But this is truly a strange behavior for me to understand.

Boot up the Netgear firmware then hold down the reset button to make sure it is running default settings.

Thanks. Solved... Now I am on 17.1.06
Will keep you guys posted..and I am making a recipe
Thanks.

Looks like I'm late to the party.

Netgear went for an off-the-shelf GL827L SD/MMC/MS Flash Card Reader chip, which is soldered to the PCB and hardwired to the SoC's USB pins. The device should get announced during boot:

[    8.862031] dwc2 4bff80000.usbotg: DWC OTG Controller
[    8.867118] dwc2 4bff80000.usbotg: new USB bus registered, assigned bus number 1
[    8.874527] dwc2 4bff80000.usbotg: irq 37, io mem 0x4bff80000
[    8.880828] hub 1-0:1.0: USB hub found
[    8.884761] hub 1-0:1.0: 1 port detected
[    8.971348] usb 1-1: new high-speed USB device number 2 using dwc2

and once userspace is ready and loaded (kmod-) usb-storage, it should detect a device

[   80.959801] usb-storage 1-1:1.0: USB Mass Storage device detected
[   80.966680] scsi host1: usb-storage 1-1:1.0
[   81.982703] scsi 1:0:0:0: Direct-Access     Generic  STORAGE DEVICE   9454 PQ: 0 ANSI: 0
[   82.275151] sd 1:0:0:0: [sda] 2012160 512-byte logical blocks: (1.03 GB/983 MiB)
[   82.283673] sd 1:0:0:0: [sda] Write Protect is off
[   82.288570] sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00
[   82.289488] sd 1:0:0:0: [sda] No Caching mode page found
[   82.294877] sd 1:0:0:0: [sda] Assuming drive cache: write through
[   82.305560]  sda: sda1 sda2
[   82.312894] sd 1:0:0:0: [sda] Attached SCSI removable disk
[...]

Switching between 17.01.x and 18.06 is a pain because the NAND partition layout has changed because the kernel got too big. That's why the the patch:

included the recommendation to go with the tftp method.

Hm, is the LAN unstable in u-boot, the stock netgear firmware or just now in OpenWrt 18.06/-master?

the LAN and WAN ports are all handled by an AR8327N switch. The ethernet "eth0" doesn't directly receive any actual link information so it should never get into a DOWN state on its own, so a daemon or scripts needs to put it there.

Hi Chris: Here is the update

I tried but none of my sd cards (tried both mbr and gpt) were accepted and I did not see them in /dev or fdisk .. I should have checked dmesg and I still will next time I start to monkey with it. Right now its on a mission critical role (serve internet at my home!).
To make it silent, I opened the box and unhooked the 3 pin fan connector and used a double sided 3M take to stick in a 2.5 in SSD drive inside it. The kmod-fs-ext4 was addded along with samba and now I have an additional 500MB swap file in it and a share directory for sharing files.

I would love to put a LAMP in it some day to run local drupal / wp off it but that I will do when I can comprehend how to enlarge the /overlay that may be leaving bunch of wasted flash. It does have 128MB and 256MB RAM.

Totally understood the 3.5 MB challenge. I think I will take a back up of config. Roll back to Netgear Factory and then go straight to 18x and then upload config bundle.

I wish I was technical enough to do that. I will upgrade to 18.x when you have lifted your proverbial axe! In the meanwhile I will clean up the recipe for dual wan set up that I want to share for this machine.

I will test the usb ports out in the next couple of days and report back and WILL leave a like there. Its a great help.

I have not done a detailed RCA but I am confident that the problem would have been one of my retractable Ethernet cable that I junked and did not see the problem since.

If you do, you should check if the sdcard "suddendly" pops up, if you reload the dwc2 or usb-storage kernel module. The sdcard media change detection is handled by a "virtual" button event BTN_1, is triggered if you insert/remove a sdcard from the slot.

The usb-storage module has no way of monitoring sdcard presence on its own. On full desktop linux distributions this isn't much of a problem for those cardreader chips, since daemons like udisks do the media polling there. But OpenWrt doesn't have the udisks daemon so the WNDR4700 currently has a "hack":
https://github.com/openwrt/openwrt/blob/master/target/linux/apm821xx/base-files/etc/rc.button/BTN_1

that does trigger the media change detection be unloading and reloading the dwc2 module (usb driver) based on virtual BTN_1 state.

The fan is software controllable. From what I remember (haven't touched the WNDR4700 in a long time), you should be able to control it through the /sys/class/hwmon inteface. Just note: There are two hwmon instances, one is the lm87-like temperature sensors, the other the tc654 fan controller.

I checked on my install and it appears that the code is already similar. Code on my 17.1.06 is:

root@WNDR4700:/etc/rc.button# cat BTN_1 
#!/bin/sh

. /lib/functions.sh
. /lib/apm821xx.sh

BOARD=$(apm821xx_board_name)

if [ $BOARD == "wndr4700" ]; then
	case "$ACTION" in
	released)
		rmmod dwc2
	;;
	pressed)
		modprobe dwc2
	;;
	esac
fi

return 0
root@WNDR4700:/etc/rc.button# 

This is way above my current skill level. I will try and read about this a little and then figure out..
Thanks.

A lot of code has changed since the 17.1.x release, it's in constant flux. For example: the APM821xx target moved from the 4.4 kernel via 4.9 to the current 4.14 branch. Furthermore, the target's infrastructure has been modified and updated a lot over the time as well: introduction of metadata, switch to dts-compatible identifier, dts cleanups and more. It's not too unlikely that something externally broke the script that was working in 17.1 you should check if the dwc2 module really gets loaded and unloaded when you insert and remove a card.

1 Like

Folks:

Just a few updates. The router wndr4700 is working fine with Openwrt 17.1.06 dual wan and statistics and samba loaded. I plan to write up my detailed observations for other newB / novices like me. Summary is like this:

  1. My Ethernet drop that I was troubleshooting may have been due to a faulty retractable ethernet cable because after I changed to a normal Cat5e cable, I never encountered that anomaly.

  2. I was tempted and did try to install and configure 18x with a clean TFTP to Factory Netgear (and then to 18x) to bypass the 3.5MiB patch as I am not very confident of applying patches myself. It was fine but the front page kept pointing out multi-wan status to wan6 and to wanb even though I had wan and wan2 that I now have reserved my 18x adventure a few weeks later when I am bored of not having tried something new!!!

  3. I did not have to add any SDCARD or USB as the 16MB (or so for /overlay) was enough for mwan3, usb-kmod, samba, and statistics etc. and its working great.

  4. I did install the USB3 drivers as per the pointers given by Chris. And I had an unused 512MB USB that I was having trouble sending to landfill!!! So I added that as a swap device.

  5. I also put in 2.5 inch hdd (used a double sided 3M tape to secure it and avoid it falling off) and have been watching its temperature and it has not exceeded 54 Centigrade even though the fan has been disconnected. Perhaps the 2.5 inch introduces enough space around it to allow for reasonable passive heat loss. IT could also be because, I also entered and saved "hdparm -S 120 /dev/sda" in the local start up.

  6. In addition, I have a reboot in the scheduled job by entering "30 4 * * * sleep 70 && touch /etc/banner && reboot" which reboots at 4:30AM everyday. Keep memory leak etc away, although I think this is perhaps needless as Linux usually have a much cleaner code.

Much Much thanks to all you wonderful folks for helping me when I was getting this wndr4720 working.

Anil Garg

1 Like

Hi Folks
my WNDR4700 slept too long in the shelf and I do not see anything better than to update to OpenWRT.
I have just found this interesting article.
What is not clear to me is : is more beneficial to run with 18x or with 17x ?
is there any drawback with 18x with respect to 17x ?
thank you
Gege