OpenWrt Forum Archive

Topic: Netgear R7900

The content of this topic has been archived between 19 Apr 2018 and 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Did OpenWrt refuse to flash original firmware?

It didn't, I was able to use CFE to flash the stock firmware.  But after OpenWRT formatted its own JFFS2 in flash, the stock firmware was not happy later.  It prints hundreds or thousands of lines complaining about the magic value of stock JFFS2 being wrong.  This stalls the router from starting up too quickly, and its web portal just about stops responding for quite awhile.  I gave up, came back a half hour later, and the stock web portal was eventually working.

I've reflashed back to OpenWRT and am trying to get through wifi configuration using the terminal.

I'm not able to use uci to set up wifi.  Running 'wifi detect' returns nothing.  Do I need to manually install wifi drivers for the R7900 router?

I installed the trunk build with today's timestamp:
Kernel 4.4.7  / OpenWrt Designated Driver r49377 / LuCI Master (git-16.135.27427-6415c04)

Let me know which dumps/logs to attach.  I prefer privacy, so let me know which parts you need the most, otherwise I will redact or strip out lines that look like they contain unique info, MAC, serial etc.  Get as technical as you like, I'm a seasoned SDET in Linux, shell and DD-WRT jockeying, but new to OpenWRT.  I'm redacting syslog and kernel logs grabbed from luci and will post when I have the data ready.

(Last edited by neveroddoreven on 16 May 2016, 05:21)

neveroddoreven wrote:

But after OpenWRT formatted its own JFFS2 in flash

If you really had OpenWrt use JFFS2, you did something wrong. I'll just wait for the logs, I don't have my crystal ball.

System logs with kernel logs at top, a few UUID and MAC/IPV6 redacted, nothing else.
http://www.neveroddoreven.com/openwrt/R … em-log.txt

I didn't especially select anything or run commands that I believe involve JFFS2 on OpenWRT.  It could be that my past attempts to install R8000 DD-WRT were what caused the JFFS2 issues.  I wish I saved the stock image logs that printed the error.

EDIT:  I found the log snippet below from elsewhere on the Internet, which is exactly what the stock image was printing to serial console (except the hex values were different).  The first line repeats several dozen times with the address number incrementing by some offset each time, then the second line prints once.  This kept going on for quite a number of seconds, I would just walk away after awhile and it would eventually stop.

159 [    3.010000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000030: 0xe039 instead
160 [    3.020000] jffs2: Further such events for this erase block will not be printed

EDIT2: it occurred to me that the stock Netgear firmware is looking for it's own magic JFFS2 byte sequence, not the DEADC0DE sequence set at the end-of-partition by OpenWRT. It seems that whatever/wherever it used to be, it got overwritten during OpenWRT installation, and reflashing back to stock didn't re-add it where it needs to be.

(Last edited by neveroddoreven on 18 May 2016, 07:01)

neveroddoreven wrote:

System logs with kernel logs at top, a few UUID and MAC/IPV6 redacted, nothing else.
http://www.neveroddoreven.com/openwrt/R … em-log.txt

This is the important part:

Mon May 16 04:55:21 2016 kern.info kernel: [   12.467777] brcmfmac 0000:01:00.0: enabling device (0140 -> 0142)
Mon May 16 04:55:21 2016 kern.warn kernel: [   12.791263] brcmfmac 0000:01:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2
Mon May 16 04:55:21 2016 kern.warn kernel: [   12.801176] brcmfmac 0000:01:00.0: Falling back to user helper
Mon May 16 04:55:21 2016 kern.err kernel: [   12.842681] firmware brcm!brcmfmac43602-pcie.txt: firmware_loading_store: map pages failed
Mon May 16 04:55:21 2016 kern.err kernel: [   15.020119] brcmfmac: brcmf_msgbuf_query_dcmd: Timeout on response for query command
Mon May 16 04:55:21 2016 kern.err kernel: [   15.027891] brcmfmac: brcmf_c_preinit_dcmds: Retreiving cur_etheraddr failed, -5
Mon May 16 04:55:21 2016 kern.err kernel: [   15.035322] brcmfmac: brcmf_bus_start: failed: -5
Mon May 16 04:55:21 2016 kern.err kernel: [   15.040047] brcmfmac: brcmf_pcie_attach_bus: dongle is not responding
Mon May 16 04:55:21 2016 kern.info kernel: [   17.620229] pci 0001:00:00.0: enabling device (0140 -> 0142)
Mon May 16 04:55:21 2016 kern.info kernel: [   17.625915] pci 0001:01:00.0: enabling device (0140 -> 0142)
Mon May 16 04:55:21 2016 kern.info kernel: [   17.631623] pci 0001:02:01.0: enabling device (0140 -> 0142)
Mon May 16 04:55:21 2016 kern.info kernel: [   17.637310] brcmfmac 0001:03:00.0: enabling device (0140 -> 0142)
Mon May 16 04:55:21 2016 kern.warn kernel: [   17.791858] brcmfmac 0001:03:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2
Mon May 16 04:55:21 2016 kern.warn kernel: [   17.801777] brcmfmac 0001:03:00.0: Falling back to user helper
Mon May 16 04:55:21 2016 kern.err kernel: [   17.814636] firmware brcm!brcmfmac43602-pcie.txt: firmware_loading_store: map pages failed
Mon May 16 04:55:21 2016 kern.err kernel: [   20.000118] brcmfmac: brcmf_msgbuf_query_dcmd: Timeout on response for query command
Mon May 16 04:55:21 2016 kern.err kernel: [   20.007894] brcmfmac: brcmf_c_preinit_dcmds: Retreiving cur_etheraddr failed, -5
Mon May 16 04:55:21 2016 kern.err kernel: [   20.015323] brcmfmac: brcmf_bus_start: failed: -5
Mon May 16 04:55:21 2016 kern.err kernel: [   20.020050] brcmfmac: brcmf_pcie_attach_bus: dongle is not responding
Mon May 16 04:55:21 2016 kern.info kernel: [   22.790196] pci 0001:02:02.0: enabling device (0140 -> 0142)
Mon May 16 04:55:21 2016 kern.info kernel: [   22.795886] brcmfmac 0001:04:00.0: enabling device (0140 -> 0142)
Mon May 16 04:55:21 2016 kern.warn kernel: [   22.951794] brcmfmac 0001:04:00.0: Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2
Mon May 16 04:55:21 2016 kern.warn kernel: [   22.961715] brcmfmac 0001:04:00.0: Falling back to user helper
Mon May 16 04:55:21 2016 kern.err kernel: [   22.974725] firmware brcm!brcmfmac43602-pcie.txt: firmware_loading_store: map pages failed
Mon May 16 04:55:21 2016 kern.err kernel: [   25.160120] brcmfmac: brcmf_msgbuf_query_dcmd: Timeout on response for query command
Mon May 16 04:55:21 2016 kern.err kernel: [   25.167893] brcmfmac: brcmf_c_preinit_dcmds: Retreiving cur_etheraddr failed, -5
Mon May 16 04:55:21 2016 kern.err kernel: [   25.175324] brcmfmac: brcmf_bus_start: failed: -5
Mon May 16 04:55:21 2016 kern.err kernel: [   25.180043] brcmfmac: brcmf_pcie_attach_bus: dongle is not responding

Unfortunately 15.05.1 is missing following commit:
http://git.openwrt.org/?p=15.05/openwrt … bb7d8bc729
r49173

I tried building the image with the patch you linked, but still no wifi.  Can you help me get unstuck?  What did I miss?  Do I need a particular .config file?  Here's what I did.

# follow wiki instructions for building OpenWRT -- https://wiki.openwrt.org/doc/howto/buildroot.exigence
# install build toolchain packages on Ubuntu 14.04 LTS (I already had most of them)
git clone https://git.openwrt.org/openwrt.git
cd openwrt/
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
## set the target system to Broadcom BCM47xx/53xx (ARM), save to .config, and don't change anything else
make
## install built chk image onto R7900, to just make sure the unmodifed trunk build is basically working
## same errors as before, wifi detect returns nothing
## now try applying the patches
make target/linux/update package/index V=s QUILT=1
make world
## install chk image onto R7900.. still no wlan working, same errors as before, wifi detect returns nothing
## opkg update/install luci, OpenWRT luci page shows its running Designated Driver build 49377
## maybe I got the wrong patches, try adding another directory
make target/linux/update target/linux/brcm47xx package/index V=s QUILT=1
make clean
make menuconfig
make world
## still not working, same errors

Hi - I'm wondering if you were successful in getting OpenWRT working on the R7900, or if you gave up?

Thanks!

Designated Driver trunk build 49918 has a prebuilt R7900 chk image that is now working for me, as of 2-Sep-2016.
https://downloads.openwrt.org/snapshots … uashfs.chk

I suspect the problem was me.  Specifically, in my having forcibly flashed an R8000 chk build back in 15.05 (dot-naught) before R7900 was supported.  My settings, NVRAM, radios got partially hosed somehow.  I was able to get it fully recovered and working in OpenWRT today like so.

0) You must be using a wired Ethernet cable to your PC, and auto DHCP to get your IP address from the router.

1) Flash the latest Netgear stock R7900-V1.0.1.4_10.0.12.chk build from their website.  If you already flashed an OpenWRT build, be sure to uncheck "keep settings".  Wait a few minutes after the flash completes.

2) Release/renew your PC IP address (or re-plug your Ethernet cable) and visit 192.168.1.1. Wait for router to finish detecting its network environment.

3) In Netgear's new router wizard, tell the router you will configure Internet yourself.  Log in with defaults of "admin" / "password".  Go to Advanced tab, click the Administration section on the left, then choose Backup Settings. Click Erase on the right and confirm your choice.  Wait a few minutes.

4) Repeat steps 1 and 3 again to erase a second time.

5) Repeat step 1 only to erase a third time.  While you are waiting this time for the router to erase/reboot, you should also power off your cable modem for ten second and power it back on, to ensure Netgear fully goes through their config from a clean state.

6) Walk through the Netgear genie configuration and pick the autoconfigure settings that are closest to your desired situation (don't use "I'll do it myself").  Once it gets to downloading Netgear software to your PC, just ignore the download and continue on, then skip the Netgear account creation part.  You'll be misdirected to Netgear's own website.

7) Return to the router portal 192.168.1.1. Go to the Advanced tab.  You need to write down the following for future reuse:
LAN Port MAC address
Internet Port MAC address (this is your WAN port)
2.4GHz channel, usually Auto
5GHz channel list, for example "36 + 40 + 44(P) + 48"
5GHz Second Radio channel list, for example "149 + 153(P) + 157 + 161"

8) Perform another router upgrade with the same latest Netgear stock R7900-V1.0.1.4_10.0.12.chk build.  You don't need to factory erase the settings this time.

9) By now the router should be fully reverted to normal stock functionality.  You can now flash to the latest trunk Designated Driver R7900 chk build.

10) After flashing OpenWRT, wait a few minutes, then unplug your cable modem for 10 seconds again, then replug.  Wait awhile until you're sure the Internet is being provided to the router.

11) Follow these steps in the SSH terminal to enable the web interface:

passwd          (and set a new secure password)
opkg update     (stuff should download from Internet -- if not, wait awhile, press ctrl-C and try again)
opkg install luci
/etc/init.d/uhttpd start
/etc/init.d/uhttpd enable

12) In your browser, open 192.168.1.1 and log in.  Scroll down, you should see three Wireless interfaces radio0, radio1 and radio2.

13) Go to Network > Interfaces.  Click on the Edit button for LAN interface, then go to Advanced tab.  In the "Override MAC address" field, paste the LAN MAC address that you copied from the stock Netgear settings.  Click Save and Apply.  Note it might take a few moments to take effect in the Interfaces list.

14) Repeat step 13 for the WAN interface, using the Internet (WAN) MAC address from stock Netgear.  Go back to the Network > Interfaces page, you'll see this change automatically also get applied to WAN6 interface.  After the updated WAN MAC address is displaying, reboot your cable modem.

15) Verify you have working Internet after the cable modem finishes booting up.  Go to System > Backup and download a backup archive.  Go to System > Reboot and perform a reboot of the router only (don't touch the cable modem).

16) After the router reboots, check in Network > Interfaces that your override MAC addresses are still there for LAN and WAN.  Your Internet should continue working without needing any more cable modem reboots.

After this point, I tinkered around with the Network > Wireless for quite some time and never got working WLAN using the GUI.  I used the SSH terminal instead to configure WLAN and it works fine now.
Use vim in the SSH shell to edit /etc/config/wireless as follows.  Maybe it's best to use the leftmost channel number from the Netgear stock channels you wrote down earlie in step 7.  Radio0 must be >148, and radio2 must be <149.  Save the file, then issue a reboot. Ta-da! Working 2.4 and dual-radio 5GHz WLAN.

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11a'
        option path '18000000.axi/bcma0:7/pci0000:00/0000:00:00.0/0000:01:00.0'
        option txpower '20'
        option country '00'
        option channel '149'
        option htmode 'VHT80'

config wifi-iface
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option key 'A stupid phrase that gets laughs'
        option ssid 'My Witty SSID-5G'
        option encryption 'psk2'

config wifi-device 'radio1'
        option type 'mac80211'
        option path '18000000.axi/bcma0:8/pci0001:00/0001:00:00.0/0001:01:00.0/0001:02:01.0/0001:03:00.0'
        option hwmode '11g'
        option channel '6'
        option htmode 'HT20'
        option txpower '20'
        option country '00'

config wifi-iface
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option key 'A stupid phrase that gets laughs'
        option ssid 'My Witty SSID'
        option encryption 'psk2'

config wifi-device 'radio2'
        option type 'mac80211'
        option hwmode '11a'
        option path '18000000.axi/bcma0:8/pci0001:00/0001:00:00.0/0001:01:00.0/0001:02:02.0/0001:04:00.0'
        option htmode 'VHT80'
        option txpower '20'
        option country '00'
        option channel '36'

config wifi-iface
        option device 'radio2'
        option network 'lan'
        option mode 'ap'
        option ssid 'My Witty SSID-5G'
        option encryption 'psk2'
        option key 'A stupid phrase that gets laughs'

(Last edited by neveroddoreven on 24 Sep 2016, 00:46)

The 2.4GHz isn't stable, especially after having added a second guest SSID to it.  It keeps slipping into Client mode, even though it's marked to be the Master as an AP.

UPDATE:  I've got 2.4GHz running again.  It turns out that, any time I use Luci web GUI to make any WLAN edits (even just disable/enable a radio), it overwrites the following two settings.  I just have to change them back, reboot, and the 2.4GHz starts working again.

config wifi-device 'radio1'
...
...
        option channel '6'  <<< Luci overwrites this as "(Auto)" which breaks things
        option hwmode '11g'    <<< Luci overwrites this as "11a" which breaks things

(Last edited by neveroddoreven on 3 Sep 2016, 06:18)

Any update of where the development of the r7900 is at? Is it safe to install at this point?

Necro-bump.  I've been using the R7900 version below since it was released and it's fairly stable.  Every two to three months something happens that I don't bother troubleshooting -- I just reboot the cable modem and router together, and it starts working again.  Usually this is when I have tons of heavy data WLAN traffic.  Most of my traffic is over wired and working fine.

OpenWrt Designated Driver 49941 / LuCI Master (git-16.271.33274-ddb98f1)

Today I've got some sort of switch or client problem in the house that causes a packet storm and then the router stops serving traffic.  I will try updating to a new version.

I took the plunge and updated to the trunk build on 2017-11-01, which includes the patch for the recently released KRACK WPA2 exploit.
OpenWrt Designated Driver 50129 / LuCI Master (git-16.271.33274-ddb98f1)

I just downloaded the R7900 build from here and used the LuCI web interface to upload the new image and perform the built-in sysupgrade.
https://downloads.openwrt.org/snapshots … x/generic/

Things seem to be working fine but it's only been about ten minutes (-:

After the upgrade, I had to reinstall LuCI from the terminal, then reinstall the following packages that I was previously using, and reboot.  Other than that, everything was where I left it, and the USB-based overlay filesystem continued working without skipping a beat.

opkg update
opkg install luci
opkg install block-mount kmod-fs-ext4 kmod-usb-storage-extras kmod-usb2 luci-app-openvpn luci-app-wol openvpn-easy-rsa openvpn-openssl sslh zile
reboot


For those starting from scratch with R7900, you can just follow the same verbose instructions I wrote in post 34 above, and also the workaround adjustment in post 35 every time after using LuCI to adjust any WLAN settings.

If you see no further posts from me in the coming months, you may assume everything is working fine for me with no new issues besides a random reboot needed every few months after super-heavy WLAN data traffic (say, backing up many gigs of data wirelessly all at a time, which crashes the WLAN interfaces)

EDIT:  I am using block-mount and fstab to automount USB stick ext4 partitions for overlay filesystem (to add space for logs and lots of opkg packages).  After I finished the sysupgrade via LuCI, block mount was not working, and the extra /dev/sda2 data partition was not mounted, resulting in loss of some configs.  I fixed this by doing:
opkg --force-reinstall install block-mount

This restored proper mounts using /etc/fstab and mounted my data partition.  From there, I rebooted, then I used opkg to list-upgradable, then I used opkg to upgrade all the reported packages, followed by a reboot.  LuCI stopped working after the upgrades, so I forced those to reinstall and that sorted things out:
opkg --force-reinstall install luci uhttpd uhttpd-mod-ubus luci-mod-admin-full luci-theme-bootstrap luci-app-firew
all luci-proto-ppp libiwinfo-lua

(Last edited by neveroddoreven on 4 Nov 2017, 18:00)

The discussion might have continued from here.