Build for Netgear R7800


#1

I have built a nice build for Netgear R7800 that offers the basic router functionality plus some useful add-ons, but does not contain too much additional fancy stuff like multimedia.

The main build is based on the master branch and the new stable 18.06 branch.

Current version:

Branch Version
master master-r8665-f939598b7a-20181209-ct (ath10k-ct)
master-r8702-3198ec5b9d-20181212-ath10k ("old" ath10k)
openwrt-18.06 owrt1806-r7409-d5afaa4114-20181212

Note: master and 18.06 have now a larger kernel partition, so that kernel 4.14 and flow offloading is possible. You need TFTP flash once to upgrade/downgrade from one group to the other group. Sysupgrade works normally inside each of these groups:

  • kernel 4.4 or 4.9: 17.01, old master builds (<r7000), plus the quite earliest 18.06 builds
  • kernel 4.14: new master builds (>r7000), new 18.06 builds

Additionally, the both master and 18.06 use now 70 MB larger area on flash, so installing more packages is possible. That was made the default for master on 7 June 2018 on the main source repo, and on 27 June on 18.06. Flashing to these new "large flash" builds need TFTP flashing, again, if you are currently running an older small 19 MB flash build (like 17.01, old 18.06 and master builds).

R7800 firmware downloads are available in Dropbox:
Download site: https://www.dropbox.com/sh/ew0gap0crn30wyk/AADQLCBF5All8wc8RXmxisqAa

I only upload the versions after successfully flashing my own router, so the build has at least that much quality assurance process.

Full configuration and source code diffs are included in the download directory, in case somebody wants to utilize info in own builds. There is also a script to automatically re-create my build environment with all the sources patched with my patches.

Features included:

  • LuCI with HTTPS SSL support
    • LuCI statistics include CPU frequency scaling graph and CPU temp graph
    • Luci theme "material" included in addition to the default "bootstrap"
  • USB storage automounting
    • Support for various file systems to enable most drives.
      (ext2/3/4, FAT, HFS+, CIFS/SMB, NTFS, EFI/GUID partitions)
  • WiFi, WPS and reset buttons work
  • console tools: Nano text editor, htop, patch, ccrypt for file encryption/decryption
  • failsafe entrance trigger time window increased to 5 sec (from 2 s)

Network tools

  • SQM-scripts for QoS traffic control. The package is initially disabled, as max speed needs to be adjusted to WAN connection speed
    • Note: the "simple.qos" script may not work optimally in R7800, as it uses HTB qdisc that seems to perform weakly on dual-core arm-cortex platform (especially with kernel 4.4 in 17.01)
    • cake qdisc included for SQM, as it seems to perform better in R7800
  • Adblock package (initially disabled)
  • IPv6: tunnel support for 6in4, 6to4, 6rd, IPv6 NAT support
  • kmod-tun, enables opkg install of OpenVPN (openvpn-openssl variant)
  • DDNS support
  • miniupnpd settings: leave upnp off by default in /etc/config/upnp
  • Vsftpd FTP server package with TLS/SSL support (access initially disabled by "local_enable=NO" in vsftpd.conf)
  • IEFT BCP38 support
  • wget, curl
  • iptables-mod-ipsec and kmod-ipt-ipsec
  • Wake-on-LAN LuCI module
  • irqbalance for balancing irq load between CPU cores. You need to manually run it if you want.
    • see "cat /proc/interrupts" for summary of irq usage of CPU cores

Noteworthy recent changes:

  • June 2018: larger flash area utilised

Note: As I build with standard kernel options, the release and snapshot packages should be compatible with my builds, in case somebody wishes to add packages to my build. That goes for "userspace" packages. Installing kernel package is more difficult and risky.

Note: Jan 2018: Recent changes in master prevent installing 17.01 sysupgrade images into a router running a master firmware, as the device/board name has changed. A 17.01 sysupgrade image can be installed by downloading the image onto router's /tmp and using "sysupgrade -F" to override the image format check.


R7800 performance
Netgear R7800 exploration (IPQ8065, QCA9984)
Netgear R7800 only getting about 140Mbps down - why so slow?
OpenWrt 18.06.0 release
Netgear R7800 enters boot loop in LEDE but works with official firmware
Is Netgear R7800 really this slow?
Netgear R7800 exploration (IPQ8065, QCA9984)
LEDE Recommendation
How to identify (search for) a powerful wifi router with the ath10k driver?
New LuCI-GUI for dnscrypt-proxy
Netgear R7800 enters boot loop in LEDE but works with official firmware
Netgear R7800 exploration (IPQ8065, QCA9984)
Netgear R7800 exploration (IPQ8065, QCA9984)
What's your favorite enthusiast LEDE/OpenWrt device?
Suggest new router
Need a best gaming router
#2

Instructions for re-creating my build environment

My firmware release contains also a script to re-create my full build environment in a few minutes.

The creation script runs pretty automatically. The needed few steps are:

  • Create the base directory (I use /OwrtLEDE) and make it writable by your normal user account (non-root)
  • Download from my newest firmware the newBuildroot.sh file and the three/four *.patch files to /OwrtLEDE
  • Run newBuildroot.sh. It creates the complete build environment and applies the patches
  • Build firmware with hnscripts/updateNmake.sh

Detailed explanation of the steps in the build environment creation process :

  1. Create the base directory (like e.g. /OwrtLEDE) to your buildhost. chown/chmod that directory to be writable by your normal user account (chmod 755). Buildroot will be created in that directory, e.g./OwrtLEDE/lede or /OwrtLEDE/lede1701

  2. Download the "newBuildroot.sh" file from my newest firmware build package to /OwrtLEDE and chmod "newBuildroot.sh" to be executable

  3. Download the firmware's four patch files: -main.patch, -packages.patch, -luci.patch (and -routing.patch) to /OwrtLEDE. Note that the master build environment needs the master patches, and correspondingly the lede-17.01 environment needs the lede-17.01 patches.

  4. Verify that "newBuildroot.sh" references the correct patches: Check that the FILESTAMP variable definition matches the timestamp in actual patch names.

  5. Run "newBuildroot.sh". It installs the needed prerequisite packages to Ubuntu, creates trunk or chaos git repository and downloads the feeds' sources, patches them and also adds the new files to version control as well as chmods the known script files to be executable.

    • If patch names are correctly set in"newBuildroot.sh", all sources will get patched by the script. Main source needs to be patched first, as that patch possibly contains changes to feeds.conf.defaults. Then it updates the feeds (packages, luci, routing), patches the feed files and finally installs the packages from feeds with "scripts/feeds install -a".
    • Check the attributes of the possible script files added by the patches and chmod them executable, if needed. e.g. /etc/reinstall-packages.sh and other scripts in /etc
      Note: With the current button hotplug procd functionality also the button scripts in /etc/rc.button need to be executable. (E.g. files/etc/rc.button/BTN_2)
    • Verify that the build script files located in /hnscripts are executable and have been added to git version control.
    • Verify that the new files have been added to git tracking. The script has commands for the "files" directory & ".config.init", but you should check if there are other unknown files added by the patches. The script tries to automatically include the noticed new files created by the patches.
  6. Copy possibly needed additional files and prepare the build system:

    • Copy extra custom files to /files . E.g. your personal settings to be the included in the firmware.
    • Copy build keys to if you want to maintain the same build key in the new environment
    • Possibly also create a file share for transferring files. For example, I need /media/windows-share to easily move files from Virtualbox to PC.
    • Additionally, I need to set git options (username etc.) and to set minor OS options like gedit not producing backup files etc.

Steps 1-5 should be done automatically by the script, but verify the results :wink:

After this you should have an identical build environment as I have. I have actually recreated my current build environment several times with this process.

Note: The -main.patch also contains the device profile recipe ".config.init" with all the needed package selections and all build scripts used in my build environment.

Steps in the actual firmware build process in /OwrtLEDE/lede:

  1. Copy .config.init as the new .config to initialize the build profile: cp .config.init .config
    ("make defconfig" will expand the recipe to a full .config . You can run that command also manually.)
  2. Do the actual make: hnscripts/updateNmake.sh
  3. transfer files from bin/target/ipq806x to wherever you need them. I use a script: hnscripts/mountNcopy.sh

Explanation of the scripts in /hnscripts:

  • updateNmake.sh is the main build script that updates sources and builds the firmware
  • mountNcopy.sh is the script that I use to copy firmware files to my PC
  • newBuildroot.sh is the build environment creation script
  • Other scripts (timestampVersion, parallelcompile, singlecompile, kernelcompile, copypackages2tmp) are just helpers. createbuildinfo.sh creates the firmware release package with docs & patches and is automatically called at the end of a build. (Usually there is no need to call that manually.)

Build for Netgear R6220
#3

Reserved for future use


#4

Did you try HZ=1000 instead of the default? When do you actually need to use nathelper-rtsp nowdays?


#5

I tried HZ=250 and did not see any difference compared to the default 100. But I did not test 1000 Hz, as I don't quite see how the timer interrupts would affect packet-driven QoS. As discussed in the SQM development forum, it looks the culprit is HTB qdisc which seems to dislike the dual-core with arm-cortex.

I am not using nathelper-rtsp myself, but I was asked to add that to my WNDR3700 build earlier and I have kept it in the recipe. It is so difficult to add kmods afterwards to private builds, so I have just kept it along in case somebody needs it.


#6

"Software Rate Limiting

Use of HTB to rate limit connections to a given speed is to be preferred, as HTB buffers up one, and only one packet. Note that HTB is timer based; default Linux kernels are often compiled with HZ=250 (or even lower), causing burstyness and non-uniform delivery of packets; building your kernels at HZ=1000 will reduce this effect. Very important also is that your kernel have support for hi resolution timers (hpet or better)."
https://www.bufferbloat.net/projects/codel/wiki/Best_practices_for_benchmarking_Codel_and_FQ_Codel/

This is also recommended on BSD's, FWIW


#7

Thanks for digging that up. That sounds rather clear.


#8

I tested with 1000HZ kernel and it has no significant impact, although there may be a marginal improvement. With 90/8 limits I get 85/7.6 with cake and 80/7.8 with simple, so the gap remains quite large. That is roughly the same that I got with the normal 100HZ after the first HTB performance patch. There are quite a lot of HTB performance patches in kernel 4.8, so I guess that I have to live with this until kernel 4.8 gets here.


#9

Since you have a rather fast connection I don't think you'll see much of a difference, it's more crucial on slow DSL/Cable connections. I haven't done any real measurements but as far as perception goes I'd say that connections appears to be more consistent in terms of speed.


#10

I will note that this advice is from May 2014 - 2 1/2 years ago. I know that a lot has changed in this time: but haven't followed it carefully enough to know whether it would make a difference.

I have posted a note on the Bloat mailing list to ask if it's still relevant.


#11

See response at: https://lists.bufferbloat.net/pipermail/bloat/2016-November/007607.html


#12

I uploaded a new build that has an older version of the "upstream thermal driver" adapted to ipq8065. It is still work in progress, but seems to work. More discussion about that thermal statistics driver at Supporting thermal sensors on ipq806x


#13

the thermal driver got successfully backported from upstream Linux 4.9 and the PR 533 has been updated with it, but the PR 533 has not yet got pulled in. My build includes now the commits from PR533
https://github.com/lede-project/source/pull/533

EDIT:
PR533 has been accepted and the source code is included in the main LEDE repo.


#14

Nothing build-specific, but nice to see that the router properly adjusted for the leap second :wink:

[91901.925431] Clock: inserting leap second 23:59:60 UTC

#15

Note: the newest version lede-r2750-18152e71d8-20170104-musl1116 has been compiled with musl clib 1.1.16 that is not yet the default (and not yet used by the buildbot). So, no add-on packages can be installed to lede-r2750-18152e71d8-20170104-musl1116


#16

Hello!
I love your builds I am using them for my wndr3700 and wndr3800.
I have just ordered new device. Zyxel NBG6817, do you think you could include it to your builds? It seems to be the same hardware just eMMC flash different which is 4gb on Zyxel.


#17

Sorry but no. I only build for devices that I have, so that I can test the builds.


#18

I understand. I was building long time ago on Openwrt and Then there was Arokh and you (actually arokh was before me). so I quit building my builds :smiley:
but seems like I will have to start building myself again :slight_smile:


#19

If you like my build, you can easily copy my config and build scripts and just change the device.

I publish a script that easily creates my build environment and patches. I use it myself 3-4 times a year to move to new Ubuntu etc.


#20

I will definitely try at least. Can you please point me to the exact direction? where is the script and how to set it up? I would start setting up the environment already. Router should come tomorrow around 18:00 CET and I would already try without even checking the stock firmware if i am ready by then.